I have a raster layer that I have clipped using a polygon in qgis. The extent of the raster layer did not change. How do I update the extent of my raster layer so that it is the minimum bounding box of my clipping?
To change the extent of raster,
(1) SAGA tools from
Processing Toolboxcan fit the raster extent to the clipped image.
Step 1: Reclassify the area outside of the image from zero to nodata
Processing Tools | SAGA | Raster Tools | Reclassify values
Options can be set as:
Grid: your raster file
Method: single (default)
old value: 0.000000 (default)
new value: -99999
replace no data valuescheckbox
new value for no data values: -99999
replace other values
Step 2: Crop to data
Then next tool is
Processing Tools | SAGA | Raster Tools | Crop to data
- Input layer: Reclassified layer
However, if you can go back to the clipping process (Clipper), you would get an optimized extent, and the above steps are unnecessary.
- Choose Mask layer clipping mode
- Assign a polygon as Mask
- Select an option
Crop the extent of the target dataset to the extent of the cutline