Repository navigation
ENH: geometry agnostic Voronoi based on shapely - #678
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #678 +/- ##
=======================================
- Coverage 85.0% 85.0% -0.1%
=======================================
Files 141 141
Lines 15061 15187 +126
=======================================
+ Hits 12809 12907 +98
- Misses 2252 2280 +28
|
| ids_objects, ids_polygons = polygons.sindex.query( | ||
| objects, predicate="intersects" | ||
| ) |
There was a problem hiding this comment.
With shapely/shapely#1968 we may be able to avoid sindex query, though given it is mentioned that the ordered Voronoi can be up to 50% slower, I am not sure if it will be worth here. Need to test it.
|
I think this is great. I would just drop this in directly, and write a wrapper to intercept the old arguments and warn about the new argument names next release, with |
|
I have merged this with
I can try to expand that but I don't think it is worth it very much, so I'd just say this is a price to pay.
Still need to update docstring and add tests. |
|
CI failing due to some deep dependency in GDAL causing segfaults... solution in progress elsewhere. |
|
The only remaining failures are caused by a geopandas regression on main geopandas/geopandas#3178. Ready for review! |
|
The test failure looks like geopandas#3180, which should resolve once that lands in geopandas. So, given that the rest of the tests pass, I will merge this now! |
This pushes upstream code I have been refactoring for momepy. It is an implementation of Voronoi tessellation that works not only with points but also lines and polygons by discretising their boundaries into a set of points and dissolving the result back.
It also does not use scipy but shapely and avoids unnecessary bottlenecks when clipping the result to pre-defined limit.
It makes sense to me that it lives in
cgrather than in momepy, where I'll just wrap it and add sensible default values that work for building footprints.It is a bit different than existing
voronoi_framesso I am not sure what is the best way forward here... I can try to mimic the API and eventually replace the scipy version with this one. Not sure what is the best way forward.