[Qgis-user] How to make a raster blocking other labels

Garth Fletcher garth at jacqcad.com
Mon Jul 21 15:38:36 PDT 2025


So one could suppress labels when a raster layer was enabled by
adding to each vector layer whose labels you want to suppress, in
Layer properties > Labels > Rendering > Data Defined Show label > expression
  not(is_layer_visible('raster-layer-name'))
where raster-layer-name is the Name of your raster layer

That will repress the labels when your raster layer is checked.
Note: I believe it tests only whether the layer itself is checked, but 
not whether any enclosing group is checked.
Garth Fletcher
On 7/21/25 11:46 AM, qgis-user-request at lists.osgeo.org wrote:
> On 7/21/25 Ann-Christin Voss<ann-christin.voss at geoas.de>  wrote:
>> Is there a way to mark a raster as a block for other labels, as it is
>> possible for vector layers? The raster is loaded as vrt and I don't want
>>    to show any labels in the area of the raster.
>>
>> I'm used to labels connected to the layer itself; therefore, if a raster
>>    is stacked above vector layers, it should overlay also the labels of
>> all the layers lying underneath, but in QGIS the labels are all gathered
>>    in the top position.
>> From: Ludwig Kniprath<ludwig at kni-online.de>
>>
>> if their number is not too high, you can use the label-toolbar to hide
>> some of the?unwanted labels manually:
>>
>>  From Garth Fletcher garth at jacqcad.com
>>> See Mask plugin which installs a "is_layer_visible" function
>> From: Andrea Giudiceandrea<andreaerdna at libero.it>   actually the "Mask" plugin doesn't install the "is_layer_visible",Such function is available in QGIS without the need to install any plugin.
>> function.



More information about the QGIS-User mailing list