Asked • 03/18/19

Needing to find parent zip code of a bunch of missing zip codes in the US?

We're using MapPoint to export zip code / territory combinations. Unfortunately, the export doesn't include PO Box zip codes which mean that we're missing a lot of zip codes The PO Box zip codes are contained within a parent zip code and so I just need to work out what the parent zip code is for each of the missing zip codes. I have 2 SQL tables: - ALL zip codes with Lat/Lng and Geography column. Also has a GeometryShape column - standard zip codes with Lat/Lng and Geography column. Couple of ways I was looking to do it... - either find the closest Geography point to each missing zip code and make the closest one the parent zip (using STDistance) OR - Convert the geometry shape to a geography shape of the standard zips, then use STIntersects to find which shape the missing zip lat/lng belongs to. Having a bit of bother with this, first time I've worked with geospatial querying in SQL

1 Expert Answer

By:

Jerald N. answered • 10/08/22

Tutor
New to Wyzant

30 Years of Real-World Experience in SQL and Database Design

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.