When we search for a zip code in Google Maps we get the area highlighted in the map with a dotted border.

How is this calculated?

How do they know how to draw the polygon?

I'm looking at implementing something equivalent, an overlay on each zip code of the visible area of the map.


I am not entirely sure if you are asking about implementation hints (I can't help you there) or more specifically about the zip code boundaries.

In any case, the Census Bureau provides so-called zip code tabulation areas which are polygonic approximations of zip codes. I say approximations because zip codes are really points on a map and may not conform to neat boundaries as typically seen on a map. Nonetheless, they provide the approximation, pretending they are areas. So, to your question, Google presumably translates the address to lat/longs, then checks for spatial membership in any number of 'neighborhood' layers, including neighborhood proper, zip code, probably others. If you searched for a specific zip code, their parser recognizes that as such and returns the corresponding feature from the tabulation area shapefile, and returns the corresponding polygon.

Zip code tabulation areas can be fetched here: ftp://ftp2.census.gov/geo/tiger/TIGER2014/ZCTA5/tl_2014_us_zcta510.zip

  • Many thanks for the answer. I was hoping google provided this information through their APIs. I may need to find the equivalent of the zip code tabulation areas you suggest for The Netherlands, that's where I want to plot the zip codes. – Dante Sep 30 '14 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.