Bug report #15797

aggregate's @parent feature gives varying (and wrong) results

Added by Mathieu Pellerin - nIRV about 8 years ago. Updated about 7 years ago.

Status:Closed
Priority:Normal
Assignee:Matthias Kuhn
Category:Expressions
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 #:23717

Description

Further testing of aggregated’s @parent feature led to the discovery of another oddity, whereas a filtered aggregation with the following expression: (intersects($geometry,geometry(@parent))) will not work reliably, with results varying either based on the number of features drawn.

Steps to reproduce
  1. Open the test confused.qgs project (download it here: http://www.licadho-cambodia.org/confused.zip)
  2. Right click on ‘testing’ layer, and select “zoom to layer”
  3. Let it render, and count the number of red polygons in the cluster of polygons to the right (here, it’s 4 – see wrong screenshot below)
  4. Pan the canvas to totally hide the cluster of polygons to the left
  5. Let it render, and count the number of red polygons (here, it’s 3 – see correct screenshot below)

I have no idea why the aggregation expression gets confused and give two different result (one clearly wrong). This should be addressed so this feature can be relied upon with fear of wrong results :)

Screenshots
Wrong:

Correct:

Associated revisions

Revision c19fb1ca
Added by Mathieu Pellerin - nIRV about 7 years ago

[expression] fix caching for aggregate() and @parent exp. (fixes #15797)

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Priority changed from High to Normal

#2 Updated by Giovanni Manghi over 7 years ago

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

#3 Updated by Harrissou Santanna about 7 years ago

  • Description updated (diff)

@Matthieu. Is it the same issue than #16481?

#4 Updated by Mathieu Pellerin - nIRV about 7 years ago

Harrissou, I suspect it is indeed.

#5 Updated by Mathieu Pellerin - nIRV about 7 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF