My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ReverseGeocoding  
Reverse Geocoding with Geopy
Phase-Deploy, Featured
Updated Feb 4, 2010 by david.zi...@gmail.com

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)
Comment by k0Sc...@gmail.com, May 29, 2009

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.

Comment by sli...@gmail.com, Mar 4, 2010

Is this still not merged?

Comment by staren...@gmail.com, Mar 5, 2010

Cannot install. What's my problem? http://openpaste.org/en/19712/

Comment by staren...@gmail.com, Mar 5, 2010

ok, if you get same bzr error as i did (above), just delete all .svn directories ;) find . -name ".svn" -exec rm -rvf {} \;

Comment by bradley....@gmail.com, Apr 23, 2010

I'd really like to see this put into trunk.

Comment by kikiestt...@gmail.com, Nov 15, 2010

How can I batch reverse geocoding from csv file ?

Comment by victor.d...@gmail.com, Dec 5, 2010

the reverse geocoding isn't implemented?! Oo

Comment by x...@xiao-yu.com, Jan 11, 2011

@victor.dvro, try http://code.xster.net/pygeocoder I a wrapper against Google's new V3 Geocoding API

Comment by lidong.m...@gmail.com, Feb 11, 2011

"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

Comment by p...@openplans.org, Nov 29, 2011

This is still not on trunk? Why?


Sign in to add a comment
Powered by Google Project Hosting