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

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

The Shapely GEOS version (3.9.1-CAPI-1.14.2) is incompatible with the GEOS version PyGEOS was compil 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 
    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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5670388.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存