Skip to main content
added 815 characters in body
Source Link
Oto Kaláb
  • 6.9k
  • 3
  • 31
  • 53

This is how exactly Raster --> Extraction --> Clipper... works. You can also use Clip raster by mask layer from processing toolbox. Both running gdalwarp command.

As mask layer you have to choose vector layer, the raster will by clipped to vector layer extent rectangle, but all values outside of shape will be nodata if you leave the no data value option unchecked, it will remain 0 (intiger).

enter image description here

If you want to crop the extent to the shape check Crop the extent of the target dataset to the extent of the cutline option.

update:

I thing there isn't build-in tool for clip raster and vector layer at once. But it can be easily created with graphical modeler or python custom processing tool. Create model with Clip raster by mask layer for raster and Clip vectors by polygon for vector. The model should looks like:

enter image description here

Once you have working model saved, you can run it as a batch process for as many different raster and vector inputs you want.

For creating models and batch processing see QGIS documentation:

The graphical modeler

The batch processing interface

This is how exactly Raster --> Extraction --> Clipper... works. You can also use Clip raster by mask layer from processing toolbox. Both running gdalwarp command.

As mask layer you have to choose vector layer, the raster will by clipped to vector layer extent rectangle, but all values outside of shape will be nodata if you leave the no data value option unchecked, it will remain 0 (intiger).

enter image description here

If you want to crop the extent to the shape check Crop the extent of the target dataset to the extent of the cutline option.

This is how exactly Raster --> Extraction --> Clipper... works. You can also use Clip raster by mask layer from processing toolbox. Both running gdalwarp command.

As mask layer you have to choose vector layer, the raster will by clipped to vector layer extent rectangle, but all values outside of shape will be nodata if you leave the no data value option unchecked, it will remain 0 (intiger).

enter image description here

If you want to crop the extent to the shape check Crop the extent of the target dataset to the extent of the cutline option.

update:

I thing there isn't build-in tool for clip raster and vector layer at once. But it can be easily created with graphical modeler or python custom processing tool. Create model with Clip raster by mask layer for raster and Clip vectors by polygon for vector. The model should looks like:

enter image description here

Once you have working model saved, you can run it as a batch process for as many different raster and vector inputs you want.

For creating models and batch processing see QGIS documentation:

The graphical modeler

The batch processing interface

Source Link
Oto Kaláb
  • 6.9k
  • 3
  • 31
  • 53

This is how exactly Raster --> Extraction --> Clipper... works. You can also use Clip raster by mask layer from processing toolbox. Both running gdalwarp command.

As mask layer you have to choose vector layer, the raster will by clipped to vector layer extent rectangle, but all values outside of shape will be nodata if you leave the no data value option unchecked, it will remain 0 (intiger).

enter image description here

If you want to crop the extent to the shape check Crop the extent of the target dataset to the extent of the cutline option.