1

I have a filter on a layer

"LOCALITY" != 'Queenton'

It just covers up the area outside of the AOI.

I want to connect this to the atlas so that this 'masking' happens as the Atlas moves between Localities.

Is there a way to do something like "LOCALITY" != '@Atlas' ?

I also tried

"LOCALITY" != '$feature'

I am using the new Clipping in QGIS 3.16 as suggested in Filtering features in other layers of QGIS Atlas to clip some unwanted features but I want the roads, rivers and protected areas (for example) to show but be covered by a translucent grey polygon as below...

enter image description here

1 Answer 1

2

Yes, try:

"LOCALITY" != @atlas_feature

or

attribute(@atlas_feature, 'LOCALITY')

You have to check which one will better suit to your needs.

4
  • For both I get an error like the following. This is in the Filter expression. ` - An error occurred when executing the query. The data provider said: OGR[3] error 1: SQL Expression Parsing Error: syntax error, unexpected $undefined. Occurred around : "LOCALITY" != @atlas_feature ^`
    – GeorgeC
    Commented Aug 29, 2023 at 11:31
  • 1
    You need to use it in rule-based styling rather than in filtering of features.
    – rychlik
    Commented Aug 29, 2023 at 18:31
  • I just tried both options and there's no error but when I cycle through the maps, I see no difference. Is it possible to use something similar in the filter?
    – GeorgeC
    Commented Aug 29, 2023 at 21:03
  • Worked it out in the end. Had to use "LOCALITY" not in (attribute(@atlas_feature, 'LOCALITY')) with an else statement that had no symbology. Then in the Atlas clip I had to exclude this layer from clipping.
    – GeorgeC
    Commented Aug 30, 2023 at 1:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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