Exercice 4
Exercice 4
9 Catchment delineation
9.1 Introduction
In order to delineate a catchment from a DEM we need to follow these steps:
1) Download the DEM tiles of your study area. Make sure that the tiles cover at least the study
area and that the catchment you want to derive is covered completely. Better to take it a bit
larger to avoid boundary effects
2) If your study area is covered by multiple DEM tiles, you need to mosaic (merge) the tiles to
create a single raster DEM layer
3) The DEM tiles might be in a different coordinate system then desired. In that case you have
to reproject the DEM layer to the projection you want to use in the study area
4) In the case that the merged tiles are much larger than your study area, you can subset (clip) it
to a smaller area to reduce calculation time
5) Make a hydrological correct DEM by filling sinks and removing spikes from the raw DEM
6) Calculate the flow direction for each cell
7) Calculate the flow accumulation for each cell: how many upstream cells contribute to the
runoff in each downstream cell of the DEM
8) Derive the drainage network
9) Calculate the catchment for the outflow point of the catchment
When a map with the stream network already exists, the procedure can be improved by "burning"
the river network into the DEM. In that way the DEM is always lower at rivers and runoff will follow
the actual river network. This is out of the scope of this exercise.
Calculate the
Fill sinks /
flow direction Subset DEM
remove spikes
map
66
9.2 Download the DEM tiles
For the Rur study area, we will use 4 tiles from the SRTM 1 Arc-Second global data set. The United
States Government announced on September 23 2014 that the highest possible resolution of global
topographic data derived from the SRTM mission will be released to public. Since the end of 2014 a
1-arc second global digital elevation model (30 meters) has been released. Most part of the world
has been covered by this dataset ranging from 54 degrees south to 60 degrees north latitude except
for the Middle East and North Africa area. A description of the SRTM data products can be found
here: https://lta.cr.usgs.gov/SRTM1Arc.
If you want to download data yourself, you can use the USGS EarthExplorer
(http://earthexplorer.usgs.gov).
67
4) You should be able to see this map in the Map Area (as shown below).
We see the four tiles in greyscale. We can distinguish the tiles, because QGIS automatically stretches
the grey values per tile. That means that the grey values are distributed according to the minimum and
maximum value of each tile. When we mosaic (merge) the tiles, QGIS will stretch the values for the
whole area, using the minimum and maximum value of the merged raster layer. You'll see that in the
next section.
68
9.4 Mosaic DEM tiles
Before we proceed, we have to merge the four DEM tiles, which in GIS terminology is called mosaic.
There are two ways to mosaic the tiles:
The first option is slower. If we have many tiles, we prefer to make a virtual file that virtually merges
all the tiles. That will be done with the following steps:
2) In the Build Virtual Raster dialogue you can choose each file individually or merge all files in a
directory (folder). We can also merge the files that are visible in the Map Canvas. We use the
last option:
Check the box before Use visible raster layers for input.
Use the button to browse to the location where you want to save the output
file (e.g. D:\QGIS_Exercises\Exercise_5) and give it the name
dem_mosaic.vrt
Make sure that Load into canvas when finished is checked.
69
3) Click OK to run the algorithm. Click OK, OK, Close to get back to the main screen where you
can see the merged DEM. You notice that in the Map Canvas the borders of the tiles are not
visible anymore in the merged DEM, because QGIS stretches the greyscale using the
minimum and maximum of the entire merged DEM. This is only for visualisation, the values
in the tiles are the same as in the mosaic.
4) Now remove the individual tiles (not the dem_mosaic) from the layers list by selecting
them while the Ctrl button is pressed. Then clicking right one of the tile names and select
Remove. Click OK to confirm. This will remove the tiles from the screen, but not from the
hard disk.
70
9.5 Reproject DEM
Before continuing, we need to know the projection of the DEM and reproject it to the projection of
our project.
2) In the new window select General (the top tab on the left hand-side of the new window).
71
3) In the General window check in the middle, under Coordinate reference system, as shown
below the CRS. Never change the coordinate reference system of the layer here, unless you
are sure what you are doing. It can result in assigning the wrong projection to the layer. This
is not the same as reprojection!
4) The DEM is in its original Lat/Lon Geographic Coordinate System (EPSG: 4326). We need to
convert it into the projection of our project. Because the project covers multiple countries,
we will not use a local projection but a global projection: UTM Zone 32 North, with WGS-84
as datum.
We can find the EPSG codes at http://www.spatialreference.org
Use the website to search for UTM 32N. You can leave QGIS opened and open a browser:
72
5) The database returns:
We have to look at the EPSG codes. We will use the EPSG: 32632 throughout this project. If
you click on it you can see more details.
73
6) Now we are going to reproject the DEM from unprojected (Lat/Lon WGS 84 - EPSG: 4326) to
UTM Zone 32 North / WGS 84 (EPSG: 32632). From the main menu choose Raster
Projections Warp (Reproject)
7) In the Warp window, as Input file choose the suggested one (dem_mosaic) and define as
Output file the name dem_reprojected.tif. Use the Select... button to browse to the
right folder (e.g. D:\QGIS_Exercises\Exercise_5)! Click Save to return to the
dialogue.
74
Check the No data values box and type -9999. Because the raster
layer will be reprojected there will be "no data" at the borders. In this way we define
that "no data" has a value -9999 and will not be visualised as "data".
10) To complete this operation, and display properly the new dataset, we need to change the
on-the-fly projection of the Project. To do so click on the EPSG: 4326 (OTF) in the lower right
of the screen.
11) In the new dialogue window select the EPSG:32632 projection that is already in the list of
Recently used coordinate reference systems, as shown below, and click OK.
In the Map area the DEM is now displayed in the correct position (with the North pointing up),
as shown below. The coordinates of the new display are also in meters as we want.
76
North up
12) You can now remove the file dem_mosaic by right clicking on it and choosing Remove. Click
OK to confirm.
An easy way to select the boundary of your study area (always make it a little bit bigger to prevent
boundary effects) is to use OpenStreetMap. OpenStreetMap contains crowd sourced data (see
http://www.openstreetmap.org for more info). If the QuickMapServices plugin is installed, you can
add an OpenStreetMap to QGIS as follows:
77
2) Now an OpenStreetMap will be shown in the Map area.
3) In order to know the approximate extent of the Rur catchment, the exercise data contains a
shapefile with the sources and the mouth of the catchment. Open the vector layer
source_mouth.shp
4) Now, from the Main Menu select Raster Extraction Clipper as shown below:
5) Then from the new dialogue window you can decide on the new raster name (here we use
dem_subset.tif). Use the Select... button to browse to the right location (e.g.
D:\QGIS_Exercises\Exercise_5).
6) Then draw on the Map Area the extent that you want to clip the raster to. A red rectangle
will appear. It should be similar to the one below, around the 3 points in the shapefile. Click
OK in the Clipper dialogue window and dem_subset will appear. Note that if you make it
78
too large, the calculation time will be too large, if you make it too small, your catchment
might not fit within the choosen area and has square borders.
7) Now you can remove dem_reprojected from the layers list as we have done before for
other layers that are not longer needed.
1) We will use the QGIS Processing Toolbox. If you don't see the Processing Toolbox at the right
of your screen, you can enable it by choosing from the main menu Processing Toolbox
79
2) In the Processing Toolbox use the Search... field to search for fill sinks
3) Go to SAGA Terrain Analysis - Hydrology Fill sinks (wang & liu). You see that there
are more algorithms for filling sinks. Each has its own advantages and disadvantages in terms
of calculation time, memory usage and accuracy. For your own research you need to make a
decision based on the documentation of the algorithms or by analysing the results of several
algorithms.
4) In the dialogue keep the defaults. Make sure to select dem_subset as the input and define
dem_fill.tif as the Filled DEM. Always use the button and Save to file... to
browse to the right location (e.g. D:\QGIS_Course\Exercise_5). We only need the
Filled DEM at this point, so you can uncheck the boxes for opening the output of Flow
Directions and Watershed Basins. The dialogue should look like this:
5) Now remove dem_subset from the layers list, because it is no longer needed.
80
9.8 Calculate Strahler order and determine threshold for streams
Before we can derive the streams from the DEM, we need to determine what we consider streams.
For this purpose we use the Strahler order. The higher the order, the bigger the stream.
2) In the dialogue select the Filled DEM for the elevation. And use strahler.tif as the
output filename and click Run.
3) Check the result. What are the minimum and maximum values? Is the Strahler raster discreet
or continuous? Make a nice legend, where the highest Strahler orders are more blue so you
can clearer see what the rivers are.
81
4) Use the Raster Calculator to create a Boolean map with 1 for Strahler order >= 5 and 0 for
the other values. Call the output file strahler5.tif
5) Make a nice legend where 1 is blue and 0 is transparent. Check the result with the rivers in
OpenStreetMap.
6) Repeat steps 4 and 5 with different threshold values and choose the best result.
In the Processing Toolbox you can also find related tools that use different algorithms. Always check
the documentation of the algorithm to find the right one or do a comparative analysis.
82
2) In the dialogue select the Filled DEM for the elevation and put the threshold at the value
you found in step 6 of the previous section, e.g. 8). This means that streams with a Strahler
order larger than or equal to this value will be considered as rivers. The algorithm will
calculate flow direction and the Strahler order to determine the channels and drainage
basins.
Select the checkboxes for the following outputs:
Flow direction and save it as flowdir.tif
Channels and save it as channels.shp.
Drainage basins and save it as basins.shp (the other one is for raster)
Always use the button and Save to file... to browse to the right location (e.g.
D:\QGIS_Exercises\Exercise_5). If the dialogue is similar as below, click Run.
83
3) Inspect the results. Make legends for all these maps (are they discrete, continuous or
Boolean?).
What does the Drainage Basins map show? Does it already give a good indication of
the Rur catchment?
What does the Flow Direction map show? What does the legend mean? Make a nice
legend using styling.
Does the stream delineation map (channels) reflect well the flowline of the Rur
river? Drag it to the top of the layers list and give it an intuitive style. Overlay the
Channels vector on OpenStreetMap to see if the derived streams fit with the rivers
on the map (make them different than blue to see the difference with the map.
What went well? What went wrong? Why?
The outflow point of the Rur catchment is in Roermond an can be found in the given shapefile
source_mouth.shp . The channel network that has been derived is in channels.shp .
1) Make sure you have the channels.shp layer on top of the OpenStreetMap layer from the
QuickMapServices plugin.
2) Check that the source_mouth.shp (1) has the same projection as channels.shp, and
(2) that the outflow point is located exactly overlapping the delineated river in
channels.shp. If the outflow point is not exactly over the delineated river, the catchment
will not be delineated. In that case we need to look for a location over the delineated
channels as in this example:
85
3) Now use the coordinate capture tool to get the coordinates of the outflowpoint in
channels.shp. You can find the coordinate capture tool from the menu: Vector
Coordinate capture Coordinate capture. Or look for this icon in the icon panel on the left
of the screen: . Note that the plugin needs to be installed and activated (check the box
in the Plugins Manager). Another panel will show up:
4) Click on Start capture and click on a point on the delineated river close to the mouth of the
Rur as indicated in the figure. Make sure you capture it from the river in channels.shp,
because the background map (OpenStreetMap) has not been derived from the DEM and will
result in errors in the catchment delineation. What projection are we using? How do you
know?
1) In the Processing Toolbox search for Upslope Area and choose SAGA Terrain
Analysis - Hydrology Upslope Area
86
2) Fill in the dialogue as below. Use the coordinates that you captured near the outflow point.
For elevation use your filled DEM. Use the default D8 method. Name the output
Rur_catchment.tif. Click Run.
87
The result should look like the screenshot below.
3) In order to overlay the catchment boundary with other data, it is better to convert it from
raster to vector (polygon). To convert the raster layer to vector, go to the menu and choose
Raster Conversion Polygonize (Raster to vector). Make sure you choose the right input
and call the output Rur_catchment.shp. Click OK to run. Click OK, OK, Close to get back
to the main screen.
88
4) Look at the result. Also check the attribute table (Click right on layer name catchment
Open attribute table). What value has the inside of the catchment polygon? What
value has the outside area?
5) Of course we are only interested in the catchment area, so we have to remove the outside
polygon. In the attribute table toggle to editing mode by using this button: . Then select
the record that you want to remove. The selection will be highlighted in yellow on the map.
Then click to delete the selected feature and toggle off the editing by clicking again
and save the changes.
6) Now remove all unnecessary layers from the layers list so that we have only
Source_mouth, Channels, Rur_catchment, OSM Standard and Filled DEM
(in that order).
89
7) We can clip the Channels vector layer to see only the streams that are inside the
catchment. Go to the menu and select Vector Geoprocessing Tools Clip.
8) Fill in the dialogue as below to use the catchment layer as a "cookie cutter" to clip the
channels shape file to the catchment extent. Call the output channels_clip.shp. Click
OK to run the tool. Click Close to return the main screen.
90
9) Remove Channels form the layers list and drag channels_clip to the top of the list.
10) Give channels_clip an intuitive colour and make the Rur_catchment polygon
hollow (no fill colour) and give it a thick red border. You can do this by clicking right on the
layer name, selecting Properties... and go to the Style tab. You can also press <F7> to open
the styling dock and set the styling options for different layers from there.
91
The result should be similar to this:
11) At this point save your project. Choose from the main menu Project Save as...
92
Now try to calculate slope, aspect and hillshade using the functions in the menu
Raster Analysis DEM (Terrain Models) or the processing toolbox and make some nice maps
with good legends.
93