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, [email protected] wrote:
On 7/21/25 Ann-Christin Voss<[email protected]>  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<[email protected]>

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<[email protected]>   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.

_______________________________________________
QGIS-User mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to