[英]Geocoding error with geopandas and geopy
Per the geopandas docs I'm trying to geocode a list of strings, but I'm getting an error. 根据geopandas 文档,我正在尝试对字符串列表进行地理编码,但出现错误。
My env 我的环境
import geopandas as gdp
from geopandas.geocode import geocode
import geopy
import sys
print(sys.version)
print (gdp.__version__)
print (geopy.__version__)
3.4.3 |Anaconda 2.2.0 (x86_64)| (default, Mar 6 2015, 12:07:41)
[GCC 4.2.1 (Apple Inc. build 5577)]
0.1.1
1.10.0
I'm trying to do 我在努力
geocode(['boston, ma', '1600 pennsylvania ave. washington, dc'])
and I'm getting the following error 我收到以下错误
AttributeError Traceback (most recent call last)
<ipython-input-77-d7e5e2fb2b1d> in <module>()
----> 1 geocode(['boston, ma', '1600 pennsylvania ave. washington, dc'])
/Users/tbmh1/anaconda/envs/devData34/lib/python3.4/site-packages/geopandas-0.1.1-py3.4.egg/geopandas/geocode.py in geocode(strings, provider, **kwargs)
70 'bing': geopy.geocoders.Bing,
71 'yahoo': Yahoo,
---> 72 'mapquest': geopy.geocoders.MapQuest,
73 'openmapquest': geopy.geocoders.OpenMapQuest,
74 'nominatim' : geopy.geocoders.Nominatim}
AttributeError: 'module' object has no attribute 'MapQuest'
I have no clue why it's trying to do MapQuest when the docs say googlev3 is the default provider. 当文档说googlev3是默认提供程序时,我不知道为什么要尝试执行MapQuest。 I get the same error with python 2.7
我在python 2.7中遇到相同的错误
It doesn't matter whether or not it uses MapQuest
; 是否使用
MapQuest
无关紧要; geopandas can't build that dictionary unless the name exists. 除非名称存在,否则geopandas无法建立该词典。 geopy removed that coder in this commit :
geopy在此提交中删除了该编码器:
MapQuest geocoder removed as the API it uses is now only available to enterprise accounts.
由于其使用的API而被删除的MapQuest地理编码器现在仅对企业帐户可用。 OpenMapQuest is a replacement for Nominatim-sourced data.
OpenMapQuest替代了源自名义上的数据。
In the meantime, you could work around it by binding the name to something else, so the dictionary works at least: 同时,您可以通过将名称绑定到其他名称来解决该问题,因此字典至少可以运行:
>>> geopy.geocoders.MapQuest = None
>>> geocode(['boston, ma', '1600 pennsylvania ave. washington, dc'])
address \
0 Boston, MA, USA
1 1600 Pennsylvania Avenue Southeast, Washington...
geometry
0 POINT (-71.0588801 42.3600825)
1 POINT (-76.9816788 38.8786589)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.