我正在使用geopy软件包来获取位置地理代码,但始终运行到HTTP Error 400: Bad Request
。
下面是我的代码,该代码遵循官方文档https://geopy.readthedocs.io/en/stable/:
from geopy.geocoders import ArcGIS
geolocator = ArcGIS(scheme="http")
loc_home = geolocator.geocode("175 5th Avenue NYC")
以下是错误:
geopy.exc.GeocoderQueryError: HTTP Error 400: Bad Request
请先帮助并感谢!
答案 0 :(得分:1)
您需要使用https
方案,我猜http
被ArcGIS阻止了。
from geopy.geocoders import ArcGIS
geolocator = ArcGIS(scheme="https")
geolocator.geocode("175 5th Avenue NYC")
#Location(175 5th Ave, New York, 10010, (40.741110006692395, -73.98968797828522, 0.0))