This is a google error. Pass along the parameter: exactly_one=False as in: place, (lat, lng) = g.geocode('1091 chamberlain drive, gravenhurst p1p 1a2, canada', exactly_one=False)
On Mon, Mar 3, 2008 at 7:58 PM, dbusarow <dbusa...@gmail.com> wrote:
> Hi, I'm also getting the error message
> ValueError: Didn't find exactly one placemark! (Found 0.)
> like a previous post but in my case it does not seem to be a bad > address format causing the problem.
> Here's what I have
> from geopy import geocoders > g = geocoders.Google('My API Key') > # I've tried this with the non-API key version too, no difference > place, (lat, lng) = g.geocode('1091 chamberlain drive, gravenhurst p1p > 1a2, canada') > Traceback (most recent call last): > ... > ValueError: Didn't find exactly one placemark! (Found 0.)
> Entering the same address at Google does work although it changes > "drive" to "dr". Making the same change in the geocoder call does not > help.
> Any ideas??
> Thanks, > Dan
-- --------------------------------------------------------------------------- ----------------------- There is a tragic flaw in our precious Constitution, and I don't know what can be done to fix it. This is it: Only nut cases want to be president. - Kurt Vonnegut
On Mar 3, 7:00 pm, "Hajo Smulders" <hajosmuld...@gmail.com> wrote:
> This is a google error.
> Pass along the parameter: exactly_one=False
> as in:
> place, (lat, lng) = g.geocode('1091 chamberlain drive, gravenhurst p1p
> 1a2, canada', exactly_one=False)
> Hajo
Hajo,
You are correct of course. I mis-stated my problem. It's not the
ValueError being raised that I was trying to fix, it's the fact that
using the address shown I get back 0 results.
If I go to Google and enter the same address manually it works fine.
I'm looking for suggestions on what I can do to coax a lat/lon out of
Google/geopy for that address.
Have you tried to "scrape" google method (ie: the one where you don't use a google key; but it scrapes the google mapping page? The google mapping page is more up to date that the data you access by key. Sometimes significantly so. I work for a pretty big company and although we all have API keys we use the scrape method a lot.
On Tue, Mar 4, 2008 at 12:39 PM, dbusarow <dbusa...@gmail.com> wrote:
> On Mar 3, 7:00 pm, "Hajo Smulders" <hajosmuld...@gmail.com> wrote: > > This is a google error. > > Pass along the parameter: exactly_one=False > > as in: > > place, (lat, lng) = g.geocode('1091 chamberlain drive, gravenhurst p1p > > 1a2, canada', exactly_one=False)
> > Hajo
> Hajo,
> You are correct of course. I mis-stated my problem. It's not the > ValueError being raised that I was trying to fix, it's the fact that > using the address shown I get back 0 results.
> If I go to Google and enter the same address manually it works fine.
> I'm looking for suggestions on what I can do to coax a lat/lon out of > Google/geopy for that address.
> Thanks!
> Dan
-- --------------------------------------------------------------------------- ----------------------- There is a tragic flaw in our precious Constitution, and I don't know what can be done to fix it. This is it: Only nut cases want to be president. - Kurt Vonnegut
On Mar 4, 12:03 pm, "Hajo Smulders" <hajosmuld...@gmail.com> wrote:
> Have you tried to "scrape" google method (ie: the one where you don't use a
> google key; but it scrapes the google mapping page? The google mapping page
> is more up to date that the data you access by key. Sometimes significantly
> so. I work for a pretty big company and although we all have API keys we use
> the scrape method a lot.