QGIS Tutorial...WaterEurope QGIS step by step tutorial 6 3. Catchment Delineation We recommend...
Transcript of QGIS Tutorial...WaterEurope QGIS step by step tutorial 6 3. Catchment Delineation We recommend...
WaterEurope QGIS step by step tutorial 2
QGIS
Frank Molkenthin, BTU Cottbus-Senftenberg
Version 12 Nov 2019 WaterEurope2020
QGIS Tutorial
WaterEurope QGIS step by step tutorial 3
1. Introduction
QGIS Description
QGIS is a free and open-source cross-platform Geographical Information System (GIS). Initiated in
2002 the software version 1.0 has been released in 2009, actual LTR version in 2019 is 3.4. QGIS is
an open system including GIS geo-algorithms libraries such as GDAL, GRASS and SAGE and a long
list of additional plugins to support general as well as discipline oriented functionalities such as
support for several hydroinformatics modelling tools.
Software Version
This tutorial is using QGIS version 3.4.6. Maderia (Long term release) English version on a Windows
operation system with metric system. The tutorial might work also with older or newer versions of
QGIS. Please check the release notes in case of questions or version problems. The tutorial is using
besides the standard QGIS / GDAL tools the core plugin GRASS 7 as basic additional library. This
tutorial is not using any other libraries and plugins. However, the proposed workflow is not the
only way of the GIS analysis of the VAR catchment region. Other combinations of geo-algorithms
from different libraries and plugins will lead to similar results.
Update 09 Nov 2019: Tutorial was tested successfully with QGIS 3.10 Coruna (Latest Release) incl.
GRASS 7.6.1. We recommend to use the Long term release of QGIS as most stable version. For
installation, please use the Standalone Installer Version (not the network installer) and always start
the software with the “QGIS Desktop *.*.* with Grass 7.*.*” version. Case study and Data
The QGIS tutorial is using the WaterEurope caste study area of the Var river catchment nearby the
city of Nice/France using the 300 m resolution DEM, the 300 m landuse data and the 2000m soil
type data for the Var Catchment. In addition, the available rainfall station data are used for the
pre-processing of the hydrological analysis.
Tasks and Goals
This QGIS tutorial integrates all pre-processing steps for catchment delineation and hydrological
pre-analysis of the Var catchment structured in five work packages, described in chapter 2.-6.:
Project Preparation
Catchment Delineation
Rainfall Station Location Analysis
Landuse Data Analysis
Soil Data Analysis
Individual Exercise WaterEurope 2020
The QGIS tutorial has been adapted as individual exercise for WaterEurope 2020 (orange colour).
The work load has been reduced by skipping the longest flow path part of Step 10 and proposal of
skipping repetition of analysis steps for more than 2 sub-catchments.
WaterEurope QGIS step by step tutorial 4
Result Data
Results of the work packages are structured in tables to be used later for the hydrological analysis.
The Var catchment will be subdivided and analysed by five sub-catchments and related geospatial
and thematic numbers have to be calculated. The individual exercise Water Europe 2020 is
reduced to two sub-catchments (Tinee and Upper Var) and skipping the longest flow path part.
Sub-Catchments: geospatial parameters
value / sub catchment Tinee Upper Var Esteron Vesubie Lower Var
area [km**2]
longest flow path [km]
avg. slope [m/m] in %
Rainfall Gauges: area contribution Thiessen polygons <-> sub-catchment in [km**2]
gauge / sub catchment Tinee Upper Var Esteron Vesubie Lower Var
Carros
Levens
Roquesteron
Puget
Guillaumes
St Martin
Landuse: area contribution landuse <-> sub-catchment in [km**2]
value / sub catchment Tinee Upper Var Esteron Vesubie Lower Var
forest [km**2]
semi-natural [km**2]
agricultural [km**2]
artificial surfaces [km**2]
water bodies [km**2]
wetlands [km**2]
Soil Type Data: area contribution soil type <-> sub-catchment in [km**2]
value / sub catchment Tinee Upper Var Esteron Vesubie Lower Var
clay loam
loam
sandy clay loam
sandy loam
silt loam
silty clay loam
WaterEurope QGIS step by step tutorial 5
2. Project Preparation
Step 1: Creation of a QGIS Project
Please start “QGIS Desktop with Grass” and create a new Project (Menu Project - > New). Create a
new folder for the project in your file system with a suitable folder name. This folder will be named
GISProjectFolder in this tutorial. Update the project properties (Project -> Properties), esp. the CRS
of the project to NTF (Paris) / France II (EPSG: 27572). Save the project in your GISProjectFolder
folder as *.qgs or *.qgz file (Project -> Save As). Please save your project after each of the following
workflow step (Project -> Save or floppy icon).
Step 2: Load DEM Data
Copy the provided 300 m resolution DEM (topo300.asc) in your GISProjectFolder folder. Add the
DEM to your project as raster layer (Layer -> Add Layer -> Add Raster Layer or related icon) using
the project CRS NTF (Paris) / France II (EPSG: 27572) as layer CRS (right Mouse click on layer after
adding: Set CRS -> Set Layer CRS).
Step 3: Load Rainfall Station Location
Copy the provided rainfall station point shape file (provided as *.zip archive) in your
GISProjectFolder folder and extract it. Add the shape file as vector layer to your project (Layer ->
Add Layer -> Add Vector Layer or related icon). The shape file is using the project CRS NTF (Paris) /
France II (EPSG: 27572) as layer CRS.
Step 4: Load Landuse Data
Copy the provided 300 m resolution landuse raster data file landuse.asc and the related legend
table landuse_legend.txt and the prepared reclassification file landuse_reclassification_rules.txt in
your GISProjectFolder folder. Add the DEM to your project as raster layer (Layer -> Add Layer ->
Add Raster Layer or related icon) using the project CRS NTF (Paris) / France II (EPSG: 27572) as
layer CRS (right Mouse click on layer after adding: Set CRS -> Set Layer CRS).
Step 5: Load Soil Type Data
Copy the provided 2000 m resolution soil type raster data file soiltype.asc and the related legend
table soiltype_legend.txt in your GISProjectFolder folder. Add the DEM to your project as raster
layer (Layer -> Add Layer -> Add Raster Layer or related icon) using the project CRS NTF (Paris) /
France II (EPSG: 27572) as layer CRS (right Mouse click on layer after adding: Set CRS -> Set Layer
CRS).
Step 6: Update the Visualization
Change the visualization style for the loaded data in a suitable way using the Menu (Layer ->
Properties or right Mouse click on layer for layer menu). The sub-mask Style / Symbology offers the
visualization option of the layer e.g. to singleband pseudocolor as render type. Please consider the
min/max values.
WaterEurope QGIS step by step tutorial 6
3. Catchment Delineation We recommend structuring the layers in your GIS-Project using groups. You can add a new group
with the related icon Add Group in the head of the layer panel. All generated layers of the
catchment delineation work package might be handled in a separated, specific group.
Step 7: Fill Sinks
Generate a depressionless DEM by filling the sinks of the DEM. You will find the related
geo-algorithm in Processing -> Toolbox. In the Processing Toolbox use GRASS -> Raster (r.*) ->
r.fill.dir. Input layer is the original DEM. As results store the Depressionless DEM and the Flow
direction in your folder as files with related names and keep the flag Open output file after running
algorithm active. This flag can be deactivated for Problem Areas, this result can be kept temporary.
GRASS tool Raster r.fill.dir
Input: original DEM
Result: DepressionlessDEM
FlowDirection
You can analyse the sinks by calculate the difference of the depressionless DEM and the original
DEM using the Raster Calculator.
WaterEurope QGIS step by step tutorial 7
Step 8: Catchment Delineation
The main catchment delineation operation in QGIS is using the GRASS tool r.watershed as
watershed basin analysis program. This command combines several working steps in one tool and
generates several output results. As elevation input use the depressionless DEM. The four optional
raster data input are not needed in this tutorial. The r.watershed tool is combined with calculation
of parameters for the Universal Soil Loss Equation (USLE), input and output for this feature can be
ignored/deactivated.
The minimum size of exterior watershed basin is a threshold, as smaller the value, as more
sub-basins/sub-catchments will be identified and vice versa. You can play with this input parameter
to analyse the impact to the sub-catchment results. A suitable threshold value for the Var DEM
with 300 m resolution is 2500 to receive the main five sub-catchments.
Please store as result files the number of cells that drain through each cell (flow accumulation),
drainage direction, unique label for each watershed basin (sub-watersheds) and stream segments.
All other output results can be ignored, feel free to generate and analyse them.
GRASS tool Raster r.watershed
Input: DepressionlessDEM
Parameter:
Minimum size of exterior
watershed basin: 2500
Single Flow Direction D8
Results: FlowAccumulation
DrainageDirection
StreamSegments
WatershedBasins
WaterEurope QGIS step by step tutorial 8
Step 9: Sub-Catchment Specification and Extraction
The different sub-catchment are specified and extracted from the full catchment based on the
results of Step 8: (unique labels for each watershed basin).
The watershed basins raster data result
distinguished the main sub-catchments Tinee,
Esteron, Upper Var and Vesubie. The remaining
watershed basins downstreams are dissolved
towards the sub-catchment Lower Var.
The extraction will be done using vector data
operations. The existing watershed basin raster data
is converted to vector data using the GRASS
command r.to.vect. We recommend to use shape
files (compatibility to other GIS tools) as vector data
file type to store the vector data polygons.
GRASS tool Raster r.to.vect
Input: WatershedBasins (result of Step 8:)
Parameter: feature type: area
Results: watershed basins polygons (as shape file)
WaterEurope QGIS step by step tutorial 9
The resulting polygons are extracted and dissolved towards the five sub-catchment polygons. The
polygon(s) of each of the five sub-catchments are selected (e.g. with the select feature icon or
within the Attribute Table) and using the GRASS operation v.extract copied to a new vector data set.
The selection can be also done via SQL command within the v.extract command. The individual
exercise Water Europe 2020 is reduced to two sub-catchments (Tinee and Upper Var), you can skip
the extraction for the other three sub-catchments Esteron, Vesubie and Lower Var.
GRASS tool Vector v.extract
Input: watershed basins polygons
Parameter: selection of the relevant polygon of the sub-catchment
Selected feature only flag activated
(or SQL statement e.g. cat = catchment_id)
Advanced Parameter:
Dissolve common boundary flag activated
v.out.ogr output type: area
Results: sub-catchment polygons
WaterEurope QGIS step by step tutorial 10
Lower Var sub-catchment part can be skipped in the individual exercise Water Europe 2020.
In opposite to the other four sub-catchment the Lower Var sub-catchments consists of several
polygons, all the related polygons will be extracted in one new vector data layer and dissolved to
one new vector data layer with only one polygon (menu Vector -> Geoprocessing -> Dissolve).
End of skipping part.
Finally, the five resulting vector data layers for the different sub-catchments are merged in one
vector data layer for later analysis. The resulting vector data layer contains five polygons. (In the
individual exercise Water Europe 2020 two polygons!)
QGIS Menu Vector -> Data Management Tools -> Merge vector Layers
Input: five sub-catchment polygon layers
Results: vector data layer with the five sub-catchment polygons
WaterEurope QGIS step by step tutorial 11
Step 10: Sub-Catchment Analysis
Each sub-catchment will be analysed individually. The area of the sub-catchments can be
calculated in the Attribute Table for the related vector data polygons using the Field Calculator with
the Create a new field flag and decimal number as output filed type as well as using as expression
$area (row number: Geometry). The same operation can be done for the merged vector data layer
to receive the five values in one attribute table.
WaterEurope QGIS step by step tutorial 12
To determine the mean slope of each sub-catchment the DEM of the sub-catchment has to be
extracted from the original DEM using Menu Raster -> Extraction -> Clip Raster by Mask Layer
QGIS Menu Raster -> Extraction -> Clip Raster by Mask Layer
Input: original topo300 layer
Parameter: sub-catchment polygon as mask layer
deactivated: Match the extend of the clipped raster ….
Result: DEM of the sub-catchment
The slope of the sub-catchments can be analysed with the menu tool Raster -> Analysis -> Slope.
QGIS Menu Raster -> Analysis -> Slope
Input: DEM of a sub-catchment
Parameter: activated: Slope expressed as percent instead of degrees
Results: slope of the sub-catchment
The average slope is accessible by the statistical values of the properties information of the
resulting raster data.
WaterEurope QGIS step by step tutorial 13
This part can be skipped in Water Europe 2020!!
The longest flow length of the sub-catchments can be analysed using the GRASS addon tool r.lfp.
Start the GRASS GIS 7 tool and create a new GRASS Mapset. This addon has to be installed in a
GRASS shell using the command g.extension in the shell or via the menu Settings -> Addons
extensions -> Install extensions from addons. After installation run r.lfp from the GRASS shell. As
input the drainage direction raster data (see Step 8:) and the OutletPoints vector data has to be
integrated in the GRASS mapset (Import raster data and Import vector data).
GRASS GIS 7 command r.lfp
Input: required: DrainageDirection
required: name of result map
optional: name of the outlet vector map
Results: longest flow path as vector map (line feature)
The result map can be exported as shape file (or any other suitable vector data format) and added
to QGIS project. The length of the different lines are calculated with the FieldCalculator as
described in Step 10: using $length as expression for the new attribute. Please consider the length
of the Lower Var sub-catchment might include the length of the Upper Var sub-catchment, so the
difference of both values is the final longest flow path of the lower Var sub-catchment.
End of skipping part.
WaterEurope QGIS step by step tutorial 14
4. Rainfall Station Location Analysis The impact of the measured rainfall at the five rainfall station to the Var river sub-catchments will
be analysed using the Thiessen Polygons area contribution to the sub-catchments. The application
of Thiessen polygons is suitable for flat regions (such as the Netherlands). The impact of mountains
and hill ranges such as in the river Var catchment is not considered by this type of interpolation in
this tutorial.
Step 11: Thiessen Polygons
The Thiessen polygons for the six rainfall stations are generated using the GRASS GIS 7 command
Vector v.voronoi. By default the resulting Voronoi regions / Thiessen polygons are covering the
region in the bounding box of the rainfall stations, to cover the whole river catchment region,
define the region extent by the DEM raster layer.
GRASS tool Vector v.voronoi
Input: rainfall station point vector layer
Parameter: region extent: select extent from DEM raster layer
Result: Thiessen polygon vector layer
WaterEurope QGIS step by step tutorial 15
Step 12: Intersection of Sub-Catchments and Thiessen Polygons
The geo-spatial relationship of the generated Thiessen polygons and the sub-catchment polygons
is defined by the overlay method intersection. The resulting polygons are analysed towards the
area, these area values in km**2 are the results of the GIS processing part.
The 6 Thiessen polygons are intersected with the 5 sub-catchment polygon leading to the 30
polygons with the combination of rainfall station/sub-catchment. The area of these intersection
polygons can be calculated with the FieldCalculator as described in Step 10:.
The individual exercise WaterEurope 2020 can be reduced to the rainfall station analysis for the
two sub-catchments Tinee and Upper Var.
QGIS Menu tool Vector -> Geoprocessing Tools -> Intersection
Input: Thiessen polygon vector layer
vector layer with five sub-catchment polygons
Results: rainfall station/sub-catchment polygons
WaterEurope QGIS step by step tutorial 16
5. Landuse Data Analysis
Step 13: Landuse Reclassification
In total 41 classes structured on three levels, classify the available landuse data (see
landuse_legend.txt). To simplify the analysis, the landuse will be reclassified using the 3rd level
classes for the analysis. The GRASS method r.class is used for this purpose, the reclassification rules
are defined in the provided file landuse_reclassification_rules.txt.
GRASS tool Raster r.reclass
Input: landuse raster layer
Parameter: reclassification file landuse_reclassification_rules.txt
Result: landuse reclassified raster layer
WaterEurope QGIS step by step tutorial 17
Step 14: Intersection of Landuse polygons and Sub-Catchments
The contribution of the different landuse classes to the sub-catchments is analysed using the
vector data operation intersection. For this purpose, the reclassified landuse data are converted to
a vector data layer (see r.to.vect tool used in Step 9:):
GRASS tool Raster r.to.vect
Input: landuse reclassified raster layer
Parameter: feature type: area
Results: landuse reclassified vector layer
The resulting vector data layer can be simplified by dissolving the layer for the six landuse classes.
(see dissolve tool used in Step 9:):
QGIS Menu tool Vector -> Geoprocessing Tools -> Dissolve
Input: landuse reclassified vector layer
Parameter: dissolve field: value (landuse class index)
Results: dissolved landuse reclassified vector layer
The dissolved six landuse polygons are intersected with the 5 sub-catchment polygon leading to
the 30 polygons with the combination of landuse/sub-catchment (see intersection tool used in
Step 12:). The area of these intersection polygons can be calculate with the FieldCalculator as
described in Step 10:.
QGIS Menu tool Vector -> Geoprocessing Tools -> Intersection
Input: dissolved reclassified landuse vector layer
vector layer with 5 sub-catchment polygons
Results: intersection landuse/sub-catchment
The individual exercise WaterEurope 2020 can be reduced to the landuse analysis for the two
sub-catchments Tinee and Upper Var.
WaterEurope QGIS step by step tutorial 18
6. Soil Data Analysis
Step 15: Intersection of Soil types and Sub-Catchments
The soil data analysis is using a similar strategy as the landuse data analysis. The contribution of
the different soil types to the sub-catchments is analysed using the vector overlay operation
intersection. For this purpose, the soil type raster data is converted to a vector data layer:
GRASS tool Raster r.to.vect
Input: soil data raster layer
Parameter: feature type: area
Results: soil data vector layer
The resulting vector data layer can be simplified by dissolving the layer for the 6 soil type classes
using menu Vector -> Geoprocessing -> Dissolve.
QGIS Menu tool Vector -> Geoprocessing Tools -> Dissolve
Input: soil type vector layer
Parameter: dissolve field: value (soil type class index)
Results: dissolved soil type vector layer
The dissolved six soil type polygons are intersected with the five sub-catchment polygon leading to
the 30 polygons with the combination of soil type/sub-catchment. The area of these intersection
polygons can be calculate with the FieldCalculator as described in Step 10:
QGIS Menu tool Vector -> Geoprocessing Tools -> Intersection
Input: dissolved soil type vector layer
vector layer with 5 sub-catchment polygons
Results: intersection soil type/sub-catchment
The individual exercise WaterEurope 2020 can be reduced to the soil type analysis for the two
sub-catchments Tinee and Upper Var.
WaterEurope QGIS step by step tutorial 19
Result Data
The results of the performed working steps are summarized in the tables below.
Sub-Catchments: geospatial parameters
value / sub catchment Tinee Upper Var Esteron Vesubie Lower Var
area [km**2] 749,07 1087,47 451,71 393,39 150,12
longest flow path [km] 67,58 85,73 57,47 45,41 31,67
avg. slope [m/m] in % 39,97 32,62 26,78 38,45 22,06
Rainfall Gauges: area contribution Thiessen polygons <-> sub-catchment in [km**2]
gauge / sub catchment Tinee Upper Var Esteron Vesubie Lower Var
Carros 0,00 0,00 13,26 0,00 91,65
Levens 14,45 18,14 46,70 48,42 58,47
Roquesteron 0,09 75,03 203,80 0,00 0,00
Puget 0,70 418,46 187,95 0,00 0,00
Guillaumes 396,44 567,30 0,00 0,00 0,00
St Martin 337,36 8,52 0,00 344,97 0,00
Landuse: area contribution landuse <-> sub-catchment in [km**2]
value / sub catchment Tinee Upper Var Esteron Vesubie Lower Var
forest [km**2] 263,25 393,39 271,35 196,47 50,31
semi-natural [km**2] 488,52 654,66 143,28 181,35 47,79
agricultural [km**2] 5,67 36,36 34,47 13,05 32,58
artificial surfaces [km**2] 1,80 2,43 1,80 2,34 15,12
water bodies [km**2] 0,36 0,00 0,00 0,09 3,33
wetlands [km**2] 0,00 1,62 0,09 0,00 0,00
Soil Type Data: area contribution soil type <-> sub-catchment in [km**2]
value / sub catchment Tinee Upper Var Esteron Vesubie Lower Var
clay loam 107,95 295,94 92,03 84,40 18,05
loam 557,00 726,55 340,52 292,12 124,86
sandy clay loam 60,91 39,75 2,22 16,87 0,00
sandy loam 11,20 12,96 3,65 0,00 0,00
silt loam 12,00 8,00 12,00 0,00 4,00
silty clay loam 0,00 4,00 1,29 0,00 2,71