Slope and Flow Direction from DHM — Recipe (QGIS)
Tool-bound implementation of the Slope and flow direction (Task) Task Schema.
Editorial note: the processing steps below were run end to end in QGIS 4.2.2 (headless, 8 October 2026) on a 2 × 2 km window around Himmelbjerget, using the DHM WCS from Datafordeleren. The menu paths are written from QGIS conventions; check the wording against your own QGIS version.
Load the terrain model (Task Schema step 1)
With the SemanticGIS plugin: Elevation › Datafordeleren: Danmarks Højdemodel (DHM) › DHM WCS › dhm_terraen (double-click). It needs your own Datafordeleren API key in the plugin settings. dhm_terraen is the terrain model (DTM); dhm_overflade is the surface model (DSM) and is not the right input here.
Without the plugin: Layer → Data Source Manager → WCS, a new connection with the URL https://wcs.datafordeler.dk/DHMNedboer/dhm_wcs/1.0.0/WCS?apikey=<your key>, then the coverage dhm_terraen.
The layer shows heights in metres. Check with the Identify tool: Himmelbjerget’s summit reads about 146.7 m.
Save a local copy (Task Schema step 2)
Zoom to the study area plus a margin. Right-click the WCS layer → Export → Save As…:
- Format: GeoTIFF
- CRS: EPSG:25832 — the coverage’s own system; do not reproject a height model before analysis
- Extent: Map Canvas Extent, or type the coordinates
- Resolution: horizontal and vertical 1.6 (m) for landscape scale, or 0.4 for the full detail (16 times as many cells)
The test window (542000–544000 E, 6217000–6219000 N) at 1.6 m gave 1,250 × 1,250 cells, heights 20.8 m (Julsø) to 158.1 m, in about 4 seconds.
Fill sinks and get flow directions (Task Schema steps 3 and 5)
Processing Toolbox → Fill sinks (Wang & Liu) (native:fillsinkswangliu; native in QGIS 4, formerly a SAGA tool):
- Input layer: the local GeoTIFF
- Minimum slope (degrees): 0.01
- Outputs: the filled DEM, flow directions and watershed basins
The flow-direction raster codes the direction to the steepest downhill neighbour, clockwise from north:
| Code | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| Direction | N | NE | E | SE | S | SW | W | NW |
(Verified on the test window: the code matched the steepest-descent neighbour in 98% of cells; the rest are flats and ties.) Style it with Paletted/Unique values and eight colours.
Compute slope (Task Schema step 4)
Processing Toolbox → Raster terrain analysis → Slope (native:slope): input the filled DEM (or the local DTM if you are not doing flow analysis), Z factor 1. The output is in degrees. The test window ranged from 0 to 52.7°, with a mean of 9.4° (the steep slopes are the valley sides around Julsø).
Optional: flow accumulation (Task Schema step 6)
GRASS r.watershed (grass:r.watershed) on the filled DEM gives flow accumulation and stream segments; tick Single Flow Direction (D8) to match the flow directions above. It needs a QGIS installation with GRASS, which not every QGIS 4 package includes; the test installation did not have it.
ArcGIS
(To fill in: the equivalent in ArcGIS Pro — Fill, Flow Direction and Slope in the Spatial Analyst toolbox; same Task Schema. Note that ArcGIS codes D8 directions as powers of two, 1 = E … 128 = NE, not 0–7.)