空间索引#

GeoPandas使用R-Tree算法为空间索引提供内置支持。取决于导入的能力 pygeos ,GeoPandas将使用 pygeos.STRtreertree.index.Index 。两者的主界面是相同的,并遵循 pygeos 模特。

GeoSeries.sindex 创建空间索引,该索引可以使用下面介绍的方法和属性。

构造器#

GeoSeries.sindex 

生成空间索引

空间索引对象#

从返回的空间索引对象 GeoSeries.sindex 具有以下方法:

目前可用的具体实现有 geopandas.sindex.PyGEOSSTRTreeIndexgeopandas.sindex.RTreeIndex

除了上面列出的方法外, rtree -基于空间索引 (geopandas.sindex.RTreeIndex )提供了完全的 rtree.index.Index -查看完整的API rtree documentation

类似地, pygeos -基于空间索引 (geopandas.sindex.PyGEOSSTRTreeIndex )提供了完全的 pygeos.STRtree ,包括最近邻查询。中查看完整的API PyGEOS STRTree documentation