Finding City and Zip Code for a Location

geocodinggislocationmappingmaps

Given a latitude and longitude, what is the easiest way to find the name of the city and the US zip code of that location.

(This is similar to https://stackoverflow.com/questions/23572/latitude-longitude-database, except I want to convert in the opposite direction.)


Related question: Get street address at lat/long pair

Best Answer

Any of the online services mentioned and their competitors offer "reverse geocoding" which does what you ask--convert lon/lat coordinates into a street address of some-sort.

If you only need the zip codes and/or cities, then I would obtain the Zip Code database and urban area database from the US Census Bureau which is FREE (paid for by your tax dollars). http://www.census.gov/geo/www/cob/zt_metadata.html.

From there, you can either come up with your own search algorithm for the spatial data or make use of one of a spatial databases such as Microsoft SQL Server, PostGIS, Oracle Spatial, ArcSDE, etc.

Update: The 2010 Census data can be found at: http://www2.census.gov/census_2010/