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

GeorgeC
  • 8,228
  • 7
  • 52
  • 136

1 Answers1

2

Yes, try:

"LOCALITY" != @atlas_feature

or

attribute(@atlas_feature, 'LOCALITY')

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

rychlik
  • 319
  • 1
  • 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 Aug 29 '23 at 11:31
  • 1
    You need to use it in rule-based styling rather than in filtering of features. – rychlik Aug 29 '23 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 Aug 29 '23 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 Aug 30 '23 at 01:50