6. Create a Subset of the DEM

In order to reduce the calculation time of the algorithms, we will subset (or clip) the raster layer. However, it's important to make the boundary of your study area a little bit bigger to prevent boundary effects.

An easy way to select the boundary of your study area is to use OpenStreetMap. OpenStreetMap contains crowd sourced data. If the QuickMapServices plugin is installed, you can add an OpenStreetMap to QGIS as follows:

1. In the main menu choose Web | QuickMapServices | OSM | OSM Standard.

2. Now the OpenStreetMap layer will be shown in the Map Canvas. Temporarily hide the DEM by unchecking the box or dragging the OSM layer to the top.

In order to know the approximate extent of the Rur catchment, the exercise data contains a zipped shapefile with the bounding box (the same that we used for downloading the DEM tiles). Note that in reality you'll not have a bounding box, but you should use your expert knowledge to locate the approximate boundaries of the study area.

3. Unzip boundingbox.zip in your exercise folder.

4. Drag the boundingbox.shp layer to the Map Canvas.

add bounding box


5. Now, from the main menu select Raster | Extraction | Clip Raster by Mask Layer.

clip raster by mask layer

6. In the Clip Raster by Mask Layer dialogue, choose dem_reprojected for the Input layer. For Mask Layer, choose boundingbox. Keep the defaults for the other options. Choose dem_subset for the Clipped (mask) output and click Run. Click Close when done.

clip raster by mask dialogue

Often you'll not have a bounding box shapefile. In that case you can choose Raster | Extraction | Clip Raster by Extent. Then you can drag a box in the Map Canvas and use that for clipping. While using that, make sure your on-the-fly reprojection is similar to the layer that you want to clip, because the Map Canvas coordinates are used by the algorithm.

7. Now you can remove dem_reprojected from the layers list as we have done before for other layers that are no longer needed.