Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have a raster which I want to cut. A second raster smaller, should be exactly the part where I want to cut the first layer (so I cut the same size as raster 2).
The idea is that raster 2 become the mask for the cut.
How can I do this?
You could convert "raster 2" to a polygon (Raster > Conversion > polygonize). Then run the Clipper tool (Raster > Extraction > Clipper...) and use the polygonized "raster 2" as the mask layer.
You can use Vector -> Research Tools -> Polygon from Layer Extent on the smaller raster.
Vector -> Research Tools -> Polygon from Layer Extent
In a second step, use this polygon as a clip mask for the second raster with Raster -> Extraction -> Clipper.
Raster -> Extraction -> Clipper
Try using "raster calculator": Deduct raster 2 from raster 1 and then change zero values to null values.