Setting extents with masks
The extent of a layer can be set using a second layer, which acts as a mask. This recipe shows you how to do this.
How to do it…
To mask the DEM with the watershed mask, follow these steps:
- Open the
watershed.tiflayer and the
- Open the Raster Calculator algorithm present in the Processing Toolbox menu.
- In Main input layer, select the DEM, and in the Additional layers field, select the watershed layer.
- In the Formula field, enter the formula, a*b.
- Click on Run to run the algorithm. You will get a masked DEM, as follows:
How it works…
When using the raster calculator, all operations involving a no-data value will result ...