mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
Before the algorithm was written to optimise clipping a few features against thousands of mask features. The revised algorithm is optimised for clipping thousands of input features against a few mask features. Given that this second operation is much more likely, it makes sense to optimise for this use case. I've also applied some other optimisations like taking advantage of spatial indexes on the providers, using prepared geometries and also only applying an intersection operation if the geometry isn't wholly contained by the mask geometry. Benchmarks: clipping roads layer with 1 million lines against 2 polygons before: 5 mins 30 seconds after: 10 seconds clipping address layer with 5 million points against 2 polygons before: 50 minutes after: 30 seconds