I have a single-part polygon containing thousands of features which I converted/dissolved into a multipart polygon. Which is faster to process (i.e. when I clip them using a simple rectangular polygon)? Is there any basis or explanation for that?
1 Answer
Clipping, intersection etc are performed two steps:
- Identify which features should be processed
- Process each feature found in the previous step.
For step #1, the bounding box of each feature is typically used first, ideally stored in a spatial index. If using a layer with a single giant (multi)polygon, then the feature will be typically returned. If using a layer with many small (single)polygons, only the features truly intersecting will be found.
For step #2, the number of vertices in each feature to be process matters a lot. If a single giant (multi)polygon is to be processed, the computation becomes very complex and slow. If many small features were to be processed, the clipping/intersection becomes very fast.
Overall, it is faster to process many small polygons rather than bigger ones.
-
+1 You might note that there is a law of diminishing returns involved -- once all the polygons are tiny, making more of them may slow things down again.– VinceCommented Jan 22 at 13:27