I'm working with QGIS 2.18

In a print composer I can filter the elements of a layer based on the attribute of the active element of an atlas. For example, show only the cities (points) of a state (polygons), when the state layer is the coverage layer of the atlas. I'm using rule-based symbolization, where both layers have a common attribute.

I would like to know if they can be filtered in the same way, but using geometry functions like the intersect. I would like to filter the elements of a layer, which intersect with the elements of the active element of the coverage layer of an atlas.

I'm trying with the intersects function, but I can not get the correct syntax.

Is it possible to make this query?

  • I'm sorry, I find the solution. intersects( transform( $geometry, 25829, 25830) , geometry( @atlas_feature ) ) . In my problem I need to transform the SRC. – Emilio Abad Aug 5 '18 at 7:49

This code should be the correct answer to your question:

[% aggregate('LAYER_NAME','concatenate',"ATTRIBUTE", within($geometry,@atlas_geometry), ',') %]

| improve this answer | |
  • if you only need the filter term within($geometry,@atlas_geometry) will do the trick. – nepluisse Sep 12 '19 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.