1

How can I clip my DEM raster in a irregular shape in QGIS?

I have used the clipping tool but it only does rectangles I believe.

2
  • You can use a polygon layer with totally irregular shape, like a state boundary. The only thing is you have to define the value of no data values for pixels outside the boundary Commented May 16, 2017 at 16:36
  • how do I do what you just described? I do not need a state boundary but I have to create my own custom shape. Commented May 16, 2017 at 16:46

1 Answer 1

3

Within QGIS you can use the 'clipper' tool in Raster > Extraction > Clipper. Alternatively, you can use the gdalwarp command line utility if you have this installed (this is what QGIS will run on your behalf).

gdalwarp -of GTiff -cutline shapefile.shp -crop_to_cutline input.tiff output.tiff 
4
  • the regular clipping tool does irregular shapes? Commented May 16, 2017 at 20:43
  • It should do, provided you tick the 'crop the extent of the target dataset to the extent of the cutline' box. You will have to select 'Mask Layer' before this tick box appears. Commented May 17, 2017 at 0:30
  • I tried it but I didn't understand how to draw my desired shape Commented May 17, 2017 at 16:28
  • Go to Layer > create Layer > New Shapefile Layer. When the tool appears, choose polygon. name it and change the type to whole number. Click OK. Save the shapefile. Look for a tool on the toolbar that looks like a pencil. click this. next to it is 'add feature' tool. select this and draw your shapefile by clicking the left mouse button. When finished, click the right mouse button and enter the number 1 in the box. Click the pencil again to save your edits. You now have a shapefile. detailed instructions: docs.qgis.org/2.8/en/docs/training_manual/create_vector_data/… Commented May 17, 2017 at 16:36

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.