开发者

Finding lat/lng for based on postalcode

开发者 https://www.devze.com 2022-12-20 18:02 出处:网络
I have a dataset of thousands of fu开发者_Python百科ll addresses of business (specifically in the netherlands, but I guess the question can apply everywhere).

I have a dataset of thousands of fu开发者_Python百科ll addresses of business (specifically in the netherlands, but I guess the question can apply everywhere).

I want to find the lat/lng so I can do distance calculation, but because of the size of the dataset I'm worried it's not a wise idea to do this using for example google maps.

Is there a webservice I could query to find all this info?


The Google Geocoder web service is available for this:

http://code.google.com/apis/maps/documentation/geocoding/index.html

It's free (unless you abuse it, or volumes get too big), and returns JSON or XML.


I've been using Google but it misses many (Scandinavian) addresses which are caught by Yahoo. See http://developer.yahoo.com/maps/rest/V1/geocode.html and at least compare the two for your needs. If I were you I would have every miss returned by Google to be geocoded by Yahoo as fallback (or the other way around.)


Accurate postcode information is owned by someone in most jurisdictions and they charge for supplying the lat/lng information. In the UK it is the Post Office, I don't know about the Netherlands, but this looks quite promising. Even Google's geocoder is not that accurate outside the US.

One thing I should mention is that the lat/lng will not be sufficient for you to calculate distances (unless you are going everywhere by crow). One of the real advantages of Google's service is that GDirections uses knowledge of the road system and estimates journey time. If you are solving some sort of travelling salesman problem, lat/lng alone is not going to give you a very good estimate of actual distance, especially in cities.

HTH


Not sure of the quality/accuracy of the geocode but this could be an option, http://www.opengeocoding.org/geocoding/geocod.html

0

精彩评论

暂无评论...
验证码 换一张
取 消