Introduction
Reverse geocoding is the process of taking a lat,lng coordinate and translating it into a human readable address. Currently only the Google and GeoNames geocoders have reverse geocoding ability.
Installation
The reverse geocoding feature is currently in an experimental but stable development branch, which you can checkout here:
svn checkout http://geopy.googlecode.com/svn/branches/reverse-geocode geopy
cd geopy/
sudo python setup.py install
You may have to delete your old geopy installation.
Usage
All of the normal geopy features (geocoding, distance calculation, parsing, etc) found in trunk should work in this development branch.
Using the Google geocoder:
from geopy import geocoders
g = geocoders.Google(GOOGLE_KEY)
(place, point) = g.geocode("562 Kendall Ave, Palo Alto, CA")
print place
>> "562 Kendall Ave, Palo Alto, CA 94306, USA"
print point
>>(37.417447799999998, -122.1338166)
(new_place,new_point) = g.reverse(point)
print new_place
>> "543-567 Kendall Ave, Palo Alto, CA 94306, USA"
print new_point
>> (37.417447799999998, -122.1338166)Using the GeoNames geocoder:
from geopy import geocoders
g = geocoders.GeoNames()
(place, point) = g.geocode("Palo Alto, CA 94306")
print place
>> "Palo Alto, US 94306"
print point
>> (37.418008999999998, -122.127375)
(new_place,new_point) = g.reverse(point)
print new_place
>> 3998 Ventura Ct, Palo Alto, US 94306
print new_point
>> (37.417850000000001, -122.12793000000001)
I hope this is merged to trunk soon. If not, I hope that some sort of tag is added so that I can meaningfully put this in setup.py files. I am having a hard time trying to peg to this version of geopy for a project that needs it, as it finds the default geopy instead.
Is this still not merged?
Cannot install. What's my problem? http://openpaste.org/en/19712/
ok, if you get same bzr error as i did (above), just delete all .svn directories ;) find . -name ".svn" -exec rm -rvf {} \;
I'd really like to see this put into trunk.
How can I batch reverse geocoding from csv file ?
the reverse geocoding isn't implemented?! Oo
@victor.dvro, try http://code.xster.net/pygeocoder I a wrapper against Google's new V3 Geocoding API
"Currently only the Google and GeoNames? geocoders have reverse geocoding ability. " ---Bing maps also has reverse geocoding. check here-> http://msdn.microsoft.com/en-us/library/cc966828.aspx
This is still not on trunk? Why?