Processing performance: Singlepart vs Multipart Polygon

multipartqgissinglepart

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?

Best Answer

Clipping, intersection etc are performed two steps:

  1. Identify which features should be processed
  2. 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.

Related Question