Bug report #14301
simplification makes geometry-based expression values (such as $area) vary for symbology and labels
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Simplification | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 22292 |
Description
When simplification is activated for a given vector layer, geometry-based expression values - such as $area - will vary within a symbology or label context when the zoom level in changed. I haven't looked at the code, but what I'm assuming happens here is that the expression is run against the simplified geometry, leading to varying values as the geometry is morphed.
That's a significant shortcoming that would be worth addressing. I discovered this when a number of polygons were going missing in a project using a density-based expression to make a graduated symbology.
I'm attaching a small test project to this issue that shows a polygon disappearing when zooming out (due to simplified polygon having an erroneous $area value).
Steps to reproduce- Open the attached project
- Notice the rule-based expression being used: ($area / 10000) > 1309 AND ($area / 10000) < 1310
- Zoom out onto the canvas a couple of times, you'll see the polygon go missing
If you change the symbology to a single symbol, you can zoom in and out and notice the label (which shows the result of the following expression: $area / 10000) value varies as the simplified polygon returns different $area values.
Associated revisions
History
#1 Updated by Alvaro Huarte over 8 years ago
Hi, I would like to propose this pull [https://github.com/qgis/QGIS/pull/2900] to fix the issue.
Best regards
Alvaro
#2 Updated by Nyall Dawson over 8 years ago
- Status changed from Open to Closed
Fixed in changeset d4a482b982b6748a1812efa0ef075b65bf668ba4.