The Shapely GEOS version (3.9.1-CAPI-1.14.2) is incompatible with the GEOS version PyGEOS was compil

3 篇文章 0 订阅
1 篇文章 0 订阅

geopandas The Shapely GEOS version (3.9.1-CAPI-1.14.2) is incompatible with the GEOS version PyGEOS was compiled with (3.10.0-CAPI-1.16.0)

问题:

>>> import geopandas
/lib/python3.8/site-packages/geopandas/_compat.py:84: UserWarning: The Shapely GEOS version (3.9.1-CAPI-1.14.2) is incompatible with the GEOS version PyGEOS was compiled with (3.10.0-CAPI-1.16.0). Conversions between both will be slow.
  warnings.warn(

解决办法:

1、卸载pygeo

pip uninstall pygeo
>>> import geopandas
Traceback (most recent call last):
  File "tif2geojson_isoband_v5_dissolve_clip_0_last.py", line 258, in <module>
    process(tif_file, result_path, sigma, each, levels)
  File "tif2geojson_isoband_v5_dissolve_clip_0_last.py", line 187, in process
    gpd_diff = gp.overlay(gpd_current,
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/tools/overlay.py", line 315, in overlay
    result = _overlay_difference(df1, df2)
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/tools/overlay.py", line 80, in _overlay_difference
    idx1, idx2 = df2.sindex.query_bulk(df1.geometry, predicate="intersects", sort=True)
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/base.py", line 2637, in sindex
    return self.geometry.values.sindex
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/array.py", line 292, in sindex
    self._sindex = _get_sindex_class()(self.data)
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/sindex.py", line 21, in _get_sindex_class
    raise ImportError(
ImportError: Spatial indexes require either `rtree` or `pygeos`. See installation instructions at https://geopandas.org/install.html

2、安装rtree

pip install rtree
>>> import geopandas
>>> 

参考:

https://github.com/geopandas/geopandas/pull/1794

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值