Bug report #16481

Using @parent with aggregate doesn't return expected results

Added by Harrissou Santanna over 7 years ago. Updated over 5 years ago.

Status:Feedback
Priority:Normal
Assignee:-
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 #:24389

Description

I have a polygon layer I would like to style according to the presence of features of another layer (site_concours).
Hence I used

 aggregate( layer:='site_concours', aggregate:='count', expression:="gid", filter:=contains( geometry( @parent ), $geometry ) )

to highlight polygon features that contains my site_concours features. As you can see in the attached map, the green polygons are not coherent with the orange ones. I unsuccessfully tried different geometry predicates with categorized or rule-based rendering (note that the results returned were always the same).

Added a project to replicate.

_parent_aggregate.PNG - Green and orange features should always overlap. Numbers are result of an aggregate count of orange features (also wrong) (180 KB) Harrissou Santanna, 2017-04-28 08:35 AM

aggregates.7z (159 KB) Harrissou Santanna, 2017-04-28 08:35 AM

History

#1 Updated by Giovanni Manghi over 7 years ago

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

#2 Updated by Giovanni Manghi over 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.

Also available in: Atom PDF