Latitude and Longitude based on Zip Code [closed]

2019-01-13 11:19发布

问题:

My requirement is to get the Latitude and Longitude value for a particular zip code. Is there any API that I can use to get these information. As I am working in a company so the requirement is coming for our team is to find the latitude and longitude value for a particular zip code. So we were thinking to build a new service for this. So what reliable data source we can use to get these information back if we are passing zip code to our service. Or what can be the best approach that I can propose to my PM about this requirement. Any pointers will be appreciated.

Just to add, that data source should have all the zip codes, latitudes and longitude in a world. Not that much accurate but mostly it should cover around more than 95% coverage.

Update

I did some research and I found that I can use Maxmind data for this but Maxmind data doesn't cover all the zip code list.

回答1:

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).



回答2:

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.



回答3:

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.



回答4:

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

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



回答5:

What about this: http://www.boutell.com/zipcodes/ ?



回答6:

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.