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

GeoPandas FutureWarning in fuzzy_contiguity #582

Closed
okunator opened this issue Oct 12, 2023 · 1 comment · Fixed by #591
Closed

GeoPandas FutureWarning in fuzzy_contiguity #582

okunator opened this issue Oct 12, 2023 · 1 comment · Fixed by #591

Comments

@okunator
Copy link

Hello,

Just a heads up that fuzzy_contiguity produces a FutureWarning

Example:

from libpysal.weights import fuzzy_contiguity
import geopandas as gpd

gdf = gpd.read_file("test.geojson")
gdf = gdf.set_crs(epsg=4328, allow_override=True)

fuzzy_contiguity(gdf, buffering=True, buffer=3, predicate="intersects", silence_warnings=True)

FutureWarning: The query_bulk() method is deprecated and will be removed in GeoPandas 1.0. You can use the query() method instead. inp, res = gdf.sindex.query_bulk(gdf.geometry, predicate=predicate)

print(gpd.__version__)
print(libpysal.__version__)

0.13.2
4.8.0

@martinfleis
Copy link
Member

Thanks for heads up. We're aware :).

If you'd like to make the PR fixing this yourself, it would certainly be welcome. We just need to mirror the implementation from fuzzy in the graph module.

if GPD_013:
head, tail = geoms.sindex.query(geoms.geometry, predicate=predicate)
else:
head, tail = geoms.sindex.query_bulk(geoms.geometry, predicate=predicate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants