Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geocoding libraries [closed]

I'm using python and I need to map locations like "Bloomington, IN" to GPS coordinates so I can measure distances between them. What Geocoding libraries/APIs do you recommend? Solutions in other languages are also welcome.

like image 262
bgoncalves Avatar asked Dec 17 '08 01:12

bgoncalves


3 Answers

Geopy lets you choose from several geocoders (including Google, Yahoo, Virtual Earth).

like image 109
Aaron Avatar answered Nov 07 '22 08:11

Aaron


The Google's web service is very easy to use. Just put the query in the URL. To make it even easier/lazier, I will shamelessly advertise pygeocoder, a Python wrapper for Google Geocoding. Then you can just do something like

print Geocoder.geocode("Montreal, Canada")[0].coordinates

to get a tuple with coordinates. You can also do stuff like

Geocoder.geocode("sushi, San Francisco").count

or

Geocoder.geocode("sushi, San Francisco")[0].postal_code
like image 30
xster Avatar answered Nov 07 '22 07:11

xster


The Google Maps API supports geocoding, and the Python Cookbook has a simple example of accessing it from Python (although the recipe doesn't use the API directly, just simple maps.google.com URLs).

like image 8
dF. Avatar answered Nov 07 '22 06:11

dF.