Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with geopandas pygeos STRTree #37

Closed
tomalrussell opened this issue Mar 10, 2021 · 1 comment
Closed

Compatibility with geopandas pygeos STRTree #37

tomalrussell opened this issue Mar 10, 2021 · 1 comment
Projects

Comments

@tomalrussell
Copy link
Owner

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.

snkit currently uses the .nearest functionality from the rtree.index.Index.

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 - geopandas/geopandas#1344

@tomalrussell
Copy link
Owner Author

Closed by 9a1a7dc

snkit automation moved this from In progress to Done Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
snkit
  
Done
Development

No branches or pull requests

1 participant