Geocoding non-addresses: Geopy

Posted by Phil Donovan on Stack Overflow See other posts from Stack Overflow or by Phil Donovan
Published on 2012-10-25T21:13:04Z Indexed on 2012/10/25 23:01 UTC
Read the original article Hit count: 286

Filed under:
|
|

Using geopy to geocode alcohol outlets in NZ.

The problem I have is that some places do not have street addresses but are places in Google Maps. For example, plugging:

Furneaux Lodge, Endeavour Inlet, Queen Charlotte Sound, Marlborough 7250

into Google Maps via the browser GUI gives me

However, using that in Geopy I get a GQueryError saying this geographic location does not exist.

Here is the code for geocoding:

def GeoCode(address):
    g=geocoders.Google(domain="maps.google.co.nz") 
    geoloc = g.geocode(address, exactly_one=False)
    place, (lat, lng) = geoloc[0]
    GeoOut = []
    GeoOut.extend([place, lat, lng])
    return GeoOut

GeoCode("Furneaux Lodge, Endeavour Inlet, Queen Charlotte Sound, Marlboroguh 7250")

Meanwhile, I notice that "Eiffel Tower" works fine. Is there away to solve this and can someone explain the difference between The Eiffel Tower and Furneaux Lodge within Google 'locations'?

© Stack Overflow or respective owner

Related posts about python

Related posts about google-maps