DEM and Slope
Last updated
Last updated
Before you continue with the next steps, make sure that you have opened the “Processing Toolbox” in QGIS (see Figure 23). Next make sure that you select the “Advanced interface” from the “Processing Toolbox” (see Figure 24).
Use your own DEM or otherwise the DEM provided in the database. You will need to project your DEM in the model’s projection and resample the DEM to model resolution and extent. You can do that using the following steps:
Drag the DEM inside the QGIS canvas;
Use the Warp tool in QGIS to reproject the DEM to the Coordinate Reference System (CRS) of your basin (EPSG:XXXXXX). This can be found under Raster 🡪 Projections 🡪 Warp (Reproject) (see Figure 25).
Within the Warp tool you need to select the “Input file”, the “Output file”, and the “Target SRS”. The “Input file” is the layer that you need to reproject, which is in this case the dem. The “Output file” is the file to which you want to save the reprojected dem in GeoTiff format (*.tif). Give it a useful name and save it in a directory that is useful. In the example of Figure 26, the reprojected dem is saved under the SPHY/input/ directory with the name: dem_pr.tif. Finally, it is important that you select the correct “Target SRS” (EPSG:XXXXX), which you defined in Section 5.1. In the example of Figure 26 it is EPSG:32737. Then click OK to do the reprojection. After the reprojection is finished click OK, and again OK, and finally Close.
The next step involves resampling the projected dem from step 3) to the extent and spatial resolution of the clone.map. For this you need to type “resampling” in the “Processing Toolbox” search window (see Figure 27).
Then double click “Resampling” under SAGA 🡪 Grid – Tools to open the Resampling tool as shown in Figure 28.
Within this tool you need to select the “Grid” file that you want to resample, the “Interpolation Methods” for scaling up and for scaling down, the “Output extent”, the “Cellsize”, and the “Grid” to which you want to save the resampled file. You also need to check or uncheck the “Preserve Data Type” option. You can use Table 3 to determine which options to set for the “Preserve Data Type”, and the “Interpolation Methods” for scaling up and for scaling down.
Table 8: Resampling settings based on the layer data type.
Layer data type
Preserve Data Type
Interpolation Method (scale Up)
Interpolation Method (scale Down)
Example layer
Continuous
No
Bilinear
Bilinear
DEM
Classified
No
Majority
Nearest neighbor
Landuse
Since the projected dem that we want to resample is continuous data, we select “Bilinear Interpolation” for both the interpolation methods, and we uncheck the “Preserve Data Type” option. For the “Grid” we select the projected dem from step 3). For the “Output extent” we use the layer extent (see Figure 28) of the clone.map. For the “Cellsize” (=cell length) you can fill in the value that you determined in Section 5.1. Then, save the resampled Grid as GeoTiff in the “Grid” in a useful directory. In the example of Figure 28 the file is saved as dem_res.tif under the directory SPHY/input/. Finally, click Run to finish the resampling. If these steps are performed correctly, then your resampled dem should have the same extent and spatial resolution as your clone.map.
The final step involves converting the GeoTiff format to the PCRaster *.map format. This can be done using the Translate function under Raster 🡪 Conversion 🡪Translate (Convert Format) (see Figure 29).
In the “Translate” box (see Figure 30) make sure that you select the “Input Layer” (result from step 7) and set the “Output Layer”. The “Output Layer” should be save as PCRaster Raster File format (*.map). In the example of Figure 31 we save it in the SPHY\input\ directory with the name dem.map. Finally click OK, and OK, and OK, and Close to finish this step.
Now you should have the DEM in the model resolution and extent and in PCRaster format.
pcrcalc slope.map = slope(dem.map)
The slope map can be derived from the DEM using the command. This can be done in the Windows Command line window by typing: