simplification makes geometry-based expression values (such as $area) vary for symbology and labels #22292
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Expressions
Related to the QGIS expression engine or specific expression functions
Author Name: Mathieu Pellerin - nIRV (Mathieu Pellerin - nIRV)
Original Redmine Issue: 14301
Affected QGIS version: master
Redmine category:simplification
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
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.
The text was updated successfully, but these errors were encountered: