3

I have been using geopy for a python project for about two months. I have maybe used the code under 100 times getting one return at a time. So I don't think that I am abusing it in away.

Yesterday I was getting a timeout error and today I am getting the following error:

geopy.exc.GeocoderInsufficientPrivileges: HTTP Error 403: Forbidden.

How can I get "sufficient Privileges"? Anyone know how I can email or pay to make this work?

from geopy.geocoders import Nominatim
import csv

   def geopy(): 

       loc = raw_input("What location? ")
       geolocator = Nominatim()
       location = geolocator.geocode(loc, timeout=None) # timeout is the amount of time it will wait for return 
       if location != None:
           Address = location.address
           lat_long = location.latitude,location.longitude

      else:
           print "There is no geographic information to return for the word in input. \n"    
Adam Konieska
  • 2,805
  • 3
  • 14
  • 27
jeffkrop
  • 147
  • 1
  • 1
  • 9

1 Answers1

2

Nominatim has stopped working I guess so I used GoogleV3. This returns less information for the Address but it may still work.

from geopy.geocoders import GoogleV3
def geopy(): 

    loc = raw_input("What location? ")
    geolocator =  GoogleV3()
    location = geolocator.geocode(loc)
    if location != None:
        Address = location.address
        lat_long = location.latitude,location.longitude
        print Address, lat_long

    else:
        print "There is no geographic information to return for the word in input. \n"    
jeffkrop
  • 147
  • 1
  • 1
  • 9
  • I see random timeouts with GoogleV3, supposedly you can do up to 2500 queries in a day. I did hit the limit one day when I didn't setup a cron job correctly. – Michael Mathews Nov 02 '17 at 21:32