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
ENH: use query_bulk in fuzzy_contiguity #335
Conversation
Codecov Report
@@ Coverage Diff @@
## master #335 +/- ##
==========================================
- Coverage 81.22% 81.08% -0.14%
==========================================
Files 115 115
Lines 11678 11693 +15
==========================================
- Hits 9485 9481 -4
- Misses 2193 2212 +19
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Reimplements core part of
fuzzy_contiguity
using newsindex.query_bulk
introduced in GeoPandas 0.8.0. It brings cleaner code (once compatibility layer is removed), performance enhancements (438 ms
vs2.58 s
formap_RS_BR.shp
) and allows specification ofpredicate
, which means that we can generate weights not only based onintersects
but also'within', 'contains', 'overlaps', 'crosses', 'touches'
(plus more once pygeos/shapely 2.0 will support them).At the same time resolves #334.
Note that it now uses the actual index of the GeoDataFrame, not an integer (as per @sjsrey's suggestion).