2016-04-13 6 views
3

私は約2ヶ月間pythonプロジェクトにgeopyを使用しています。私はおそらく一度に1つのリターンを得る100回未満のコードを使用している。だから私はそれを離れて虐待しているとは思わない。地理エラーとタイムアウト

昨日、私はタイムアウトエラーを得ていたし、今日の私は、次のエラーを取得しています:

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

は、どのように私は、「十分な特権」を得ることができますか?誰でも私がこの仕事をするために電子メールや支払いをする方法を知っていますか?

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"  

答えて

2

Nominatimが動作を停止していますので、GoogleV3を使用しました。これはアドレスの情報を少なくしますが、それでも動作する可能性があります。

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"  
+0

私は、GoogleV3でランダムタイムアウトを参照していますが、1日に最大2500件のクエリを実行できます。ある日、私はcronジョブを正しくセットアップしなかったので、限界に達しました。 –

関連する問題