4

In QGIS 3.22.5, is there possible to use polygons for the masking layer? I want to use numerous little polygons to mask lines (only layer which consists of lines).

In ArcGIS that works just by clicking the layers you want to use in "appearance -> masking".

For example in QGIS: labels can be created as masks which work fine.

f

enter image description here

I hope that picture in above explain what I'm looking for. Polygon (red) masking lines (black) and result is in right side picture.

1
  • If you create your "masking" polygons in their own layer, symbolize them as white with no outline and have that layer just above your lines layer in the layers panel, they should block seeing the lines.
    – John
    Jun 1, 2022 at 12:54

2 Answers 2

7

In QGIS version 3.24, it is now possible to mask layers using other layers. It is necessary to create a group of layers, where the mask layer and the masked layer will be located.

  1. In the layers panel, select a group and enable the "Render layers as a group" option for it: enter image description here

  2. In the layers panel, select the mask layer and set the appropriate blending mode for it: enter image description here

It's done! https://qgis.org/ru/site/forusers/visualchangelog324/index.html#feature-rendering-layers-as-groups

EDIT: To mask a raster layer, there must be two vector layers in the group. One vector layer is a mask. The second vector layer is any other (even empty).

1

You are looking for the Difference tool:

Extracts features from the input layer that don’t fall within the boundaries of the overlay layer.

0

Your Answer

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

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