我正在尝试使用 Google Colab 上的 gdf.overlay 函数与 2 个 GeoDataFrame 进行交集。请看下面的代码
!sudo apt install libspatialindex-dev
!sudo pip3 install rtree
!pip install pygeos
overlap = gpd.overlay(gdf1,gdf2, how='intersection')
overlap.plot(figsize=(10,10), cmap='jet')
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息
ImportError: Spatial indexes require either `rtree` or `pygeos`. See installation instructions at https://geopandas.org/install.html
Run Code Online (Sandbox Code Playgroud)
是什么导致了这里的问题?