Bug report #15810

Geometry generator creates too many geometries for multipart input

Added by Anita Graser over 7 years ago. Updated about 5 years ago.

Assignee:Nyall Dawson
Affected QGIS version:3.4.5 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23730


I'm using geometry generator to buffer island polygons and style them with a dashed outline. The style looks wrong if applied to multipart features. It seems like the geometry generator computes the buffer around all features for every part of the multipart feature. So if there are three parts, all buffers are drawn three times on top of each other.

I can work around it with a more elaborate expression, but I think that's not how it is supposed to be:

if (
  @geometry_part_count > 1,
  buffer( geometry_n( $geometry, @geometry_part_num), 0.5 ),
  buffer( $geometry, 0.5 )


#1 Updated by Giovanni Manghi about 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Giovanni Manghi about 5 years ago

  • Status changed from Open to Feedback

Please check if this issue is still valid on QGIS 3.4.5 or 3.6.

#3 Updated by Anita Graser about 5 years ago

  • Status changed from Feedback to Open
  • Description updated (diff)

Still happens in 3.4.5 and master. The easiest way to reproduce is

1. create a multipolygon memory layer
2. draw one polygon
3. style the polygon using buffer($geometry) and use a semi-transparent fill
4. split the polygon into two parts and observe how the fill goes less transparent because the buffers are drawn twice

#4 Updated by Giovanni Manghi about 5 years ago

  • Affected QGIS version changed from master to 3.4.5

Also available in: Atom PDF