Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplification makes geometry-based expression values (such as $area) vary for symbology and labels #22292

Closed
qgib opened this issue Feb 15, 2016 · 2 comments
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

Comments

@qgib
Copy link
Contributor

qgib commented Feb 15, 2016

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

  1. Open the attached project
  2. Notice the rule-based expression being used: ($area / 10000) > 1309 AND ($area / 10000) < 1310
  3. 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.


@qgib
Copy link
Contributor Author

qgib commented Mar 11, 2016

Author Name: Alvaro Huarte (@ahuarte47)


Hi, I would like to propose this pull [https://github.com//pull/2900] to fix the issue.

Best regards
Alvaro

@qgib
Copy link
Contributor Author

qgib commented May 27, 2016

Author Name: Nyall Dawson (@nyalldawson)


Fixed in changeset "d4a482b982b6748a1812efa0ef075b65bf668ba4".


  • status_id was changed from Open to Closed

@qgib qgib added 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 labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant