Closed martinfleis closed 8 months ago
Got it down to Wall time: 10.6 s
in 2ca9832 :)
Attention: 21 lines
in your changes are missing coverage. Please review.
Comparison is base (
29c0e5d
) 97.5% compared to head (9de5899
) 97.1%. Report is 1 commits behind head on main.
Squeezed it under 10s to 9.77, 5x times faster than before with cleaner geometry (it resolves #537).
It is at the moment less robust in terms of input data. Original tessellation does not error on overlapping polygons and similar issues. It produces erroneous geometry but produces something. This fails on GEOSException. I am not sure which way is better but I tend to say that geometries should be cleaned before running tessellation. We can probably provide some tooling for that, maybe on top of @sjsrey's geoplanar
.
Still missing support of LineString tessellation (edge points conflict) and enclosed tessellation.
I'm thinking that since this is fairly generic polygon-based Voronoi tessellation it may be better to have it in libpysal.cg, no? Rather than hidden in momepy.
When passing a limit
, the main bottleneck becomes clip
. See the profiling below. Might be worth looking in https://github.com/geopandas/geopandas/issues/1803#issuecomment-778637626 but the issue is not union here but a ton of intersections that is essentially void since the whole geom is within the limit. I might need to look into clip
in geopandas and try to fix this over there.
Will be superseded by https://github.com/pysal/libpysal/pull/678
Superseded by https://github.com/pysal/libpysal/pull/678 and #559
WIP but f****ing hell how the time has changed what is possible now.
Performance comparison on 10k buildings - new
Wall time: 35 s
, oldWall time: 47.7 s
Still space for improvements I think. What is great is that GEOS gives us directly polygons which we know are topologically clean.