Closed tomalrussell closed 2 years ago
Recent geopandas (since at lease 0.9) uses pygeos.STRTree as the spatial index if pygeos is installed, or else continues to use rtree.index.Index.
pygeos.STRTree
rtree.index.Index
snkit currently uses the .nearest functionality from the rtree.index.Index.
.nearest
As a workaround, if a recent geopandas and pygeos are installed, we can force compatibility by doing:
import geopandas as gpd gpd._compat.USE_PYGEOS = False import snkit
It looks like future pygeos - https://github.com/pygeos/pygeos/blob/b74773d5a7abbcfdf645ebd52b1ca4836a3fee80/pygeos/strtree.py#L180 - will have some variant of nearest and there's some discussion about the spatial index API compatibility going forward in geopands - https://github.com/geopandas/geopandas/issues/1344
nearest
Closed by https://github.com/tomalrussell/snkit/commit/9a1a7dc04f427cbb4e01303c433cb015f5a68964
Recent geopandas (since at lease 0.9) uses
pygeos.STRTree
as the spatial index if pygeos is installed, or else continues to usertree.index.Index
.snkit currently uses the
.nearest
functionality from thertree.index.Index
.As a workaround, if a recent geopandas and pygeos are installed, we can force compatibility by doing:
It looks like future pygeos - https://github.com/pygeos/pygeos/blob/b74773d5a7abbcfdf645ebd52b1ca4836a3fee80/pygeos/strtree.py#L180 - will have some variant of
nearest
and there's some discussion about the spatial index API compatibility going forward in geopands - https://github.com/geopandas/geopandas/issues/1344