Latitude and Longitude based on Zip Code [closed]

半腔热情 提交于 2019-11-27 18:35:14

Please have a look at Google Geocoding API and at Yahoo! PlaceFinder.

Both of them have Geocoding features, which is exactly what you want (obtaining map (latitude, longitude) coordinates from partial or full addresses).

You can download zip code and corresponding lat and long values for different countries from here: (this is open source data and free of charge)

http://download.geonames.org/export/dump/

You can then import the data into your database and query it.

Hope this helps.

If you need commercial grade, consider this: http://greatdata.com. If you do not need this level of quality, here is a list of some other sources w/ pros & cons (it's worth reading just to understand the differences between zip, zcta, usps, census, etc. versions of the data).

ps - you said 'entire world' but your other responses and the term 'zip code' itself seem to imply primarily US. The above link goes beyond US but not the entire world.

Regarding the Google API mentioned already, please be aware of Google's TOS. Specifically: "Note: the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited."

I am an employee for greatdata.

GeoNames has a nice straightforward API with pretty good coverage. (Docs)

example usage: http://api.geonames.org/postalCodeSearch?postalcode=98122&maxRows=10&username=demo

I have a situation where there are 12 warehouses nationwide and I needed to find the nearest one that has inventory for an item. My simple solution was to take the absolute value of the difference between the target zip code and the 12 warehouses. And then, simply ordering them by the lowest to highest difference in zip code numbers and querying the inventory in that order. It seems that just getting the ABS(zip1 - zip2), yields the closet distance between two zipcodes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!