试图使用Anaconda进行反向地理编码,但遇到了几个问题

问题描述 投票:1回答:1

我正试图在Anaconda中运行反向地理编码。以下是我的三个问题:

  1. 当我在终端中安装-c conda-forge geopandas时,它显示一条错误消息:conda.compat模块已弃用,将在以后的版本中删除。我该怎么办?
  2. 我知道在Anaconda中使用GeoPandas我必须使用谷歌,但我不想为此付费。有没有其他免费的API,我可以使用,但也与Anaconda紧凑。
  3. 我尝试在Anaconda中导入reverse_geocode(Python中的一个包),但它给了我一条错误消息:ImportError:没有名为future.moves.urllib.request的模块
python anaconda reverse-geocoding
1个回答
1
投票
  1. 可能只是一个警告:https://github.com/conda/conda/issues/8512
  2. 默认提供者是Nominatim,也可以通过以下方式选择:
from geopandas.tools.geocoding import reverse_geocode
from shapely.geometry import Point
from geopy.geocoders import Nominatim

reverse_geocode([Point(-71.0582912,42.3602534)], provider=Nominatim)

结果:Boston City Hall, 1, Congress Street, Dock Squ...

理解基于:https://github.com/geopandas/geopandas/blob/master/geopandas/tools/geocoding.py#L27

  1. 安装future模块:pip install future
© www.soinside.com 2019 - 2024. All rights reserved.