QGIS Atlas – How to Turn Off Labels Within Polygon

atlaslabelingoverlapping-featuresprint-composerqgis

Is there a setting to turn off labels within a polygon in an Atlas?

In the example below I don't want labels to show in the grey inset area.

enter image description here

I have tried the new clipping functionality

enter image description here

All the label data to be clipped is in the chosen file DSC_Point_Symbology

The AOI (grey area) is defined as follows so that any area in a map frame that's not the current AOI is covered.

enter image description here

It's only the labels in the grey area that should not be shown, the labels from the same data should be shown in the other areas. The symbol should be shown in all areas.

I am using QGIS 3.22

I have checked Removing labels from area that is also shown on inset map using QGIS and as zoom level and the input features are relatively dynamic having to process all the labels separately seems inefficient.

Can a polygon from the map be selected in the Label Settings -> Placement -> Label Blocking items?

enter image description here

UPDATE as per @Pieter's response.

enter image description here

The labels don't show now anywhere in the map (blue highlight compared to previous screengrab). They should only be removed from the grey area.


Example and notes

Please download https://drive.google.com/file/d/1hVNCXfY8Zgvag1NFB3zjNoyYk7OSwZib/view?usp=sharing

This is just a quick example with some training data, packed using QPackage.

See map 7 and 12. 12 is a small area of map 7 but as the features are complex in it, I want it covered and the labels under it to not show. The labels should show in the rest of the map.

So in the zoomed out map (7) all the labels (yellow highlight) in the grey section should not show but they must be visible in the rest of the map.

enter image description here

On Inset 1 (map 13), the grey border should not be shown.
enter image description here

I'd say we need to forget about the atlas initially and see if labels can be clipped / masked by a polygon?

Best Answer

You could define an expression-based value on the labelfields.

if(intersects($geometry, @atlas_geometry), '', "labelfield")

This expression gives no label if it intersects the atlas_geometry. If not, a label will appear

enter image description here

Related Question