1. FOSS tools for modelling
natural hazards: the
HortonMachine library
Bucharest, August 2019
Silvia Franceschi, Andrea Antonello
Riccardo Rigon
2. ● small (very small) engineering company
● Bolzano (north Italy)
● 2 cofounders: Andrea Antonello, Silvia Franceschi
● from 2005 active in the GFOSS community
HydroloGIS
3. ● environmental engineers specialized in
– hydrology, hydraulics, geomorphology and forestry
– software development
● PhD in
– Environmental Sciences
– Mountain Environment and Agriculture
● developers of
– the HortonMachine library in the fields of: hydrology,
hydraulic, forestry
– Geopaparazzi app for digital field mapping
– gvSIG plugins and customization
● OSGeo Charter Members
HydroloGIS
4. HortonMachine: the purpose
It is developed with the purpose of giving some quantitative
and qualitative instruments for knowing the morphology
of catchments.
Main applications:
• alpine catchments of various dimensions (from some km2
to hundreds km2
)
• different type of DTM (SRTM, Aster, IGM 20 metri, PAT 10
m, LaserAltimetric 0,5-1-2 m)
5. HortonMachine: the history
● published before 2000 as a package of stand alone routines
operating system independently, written in C using the
FluidTurtle libraries and their input/output defined formats.
The visualization of the calculated matrices was made with
other graphical programs or with Mathematica
● integrated in the GIS GRASS to have a direct graphical
interface in TkTcl
● rewritten in Java (2003) and completely integrated in other
GIS systems as SpatialToolbox (uDig, gvSIG)
● available as a set of stand alone executables (2018)
6. HortonMachine: the concepts
MORPHOMETRY EROSION PROCESSES
The purpose of the library is to analyse the erosion
processes, incision processes of the network and the
possibility of landslides.
Considering that the main geomorphological processes in a
catchment are:
- diffusive erosion on the hillslopes
- network's incision processes
- landslides
- sediment transport in the channels
7. Workshop material
● a PDF file containg the tutorial to follow during the
workshop (HM_tutorial_2019.pdf)
● a PDF file with this presentation
(2019_08_26_foss4g_workshop_horton.pdf)
● a ZIP (DTM.zip) file with the data (DTM ascii format)
● a compressed (hortonmachine_0.9.6-20190618.tar.gz) file
containing the HortonMachine applications
8. The HortonMachine installation
● the HortonMachine (HM) tools are supplied as a
compressed file in tar.gz they are normally available on the
git website of the project
● the standalone package of the HM contains the library tools
for working with geospatial data, you can use your favorite
GIS application to visualize them
● extract the content of the compressed file into a folder on
your hard disk
● enter the HM application folder
9. The HM set of modules
different specific
applications
executable
available for
different operating
systems → choose
the right one:
exe / bat : windows
sh : linux / iOS
10. The HM set of modules
● dbviewer: simple and easy to use Spatialite database
viewer
● geopaparazzi_viewer: quick application to visualize the
contents of a Geopaparazzi project
● geoscript: the HortonMachine geoscripting console
● gforms: the application to create complex forms for
georeferenced notes in Geopaparazzi
● lasviewer: simple and easy to use visualizer of LAS data
● mapcalc: tool to perform raster map calculation
● quickfolder: quick visualizer for all GIS data contained in a
folder
● simplenww-viewer: simple visualizer of NWW data
11. The HM set of modules
● sld: tool to create SLD files of style for vector and rater data
● spatialtoolbox: the main application to run the
HortonMachine tools for GIS data analysis
● wms2geotiff: simple application to download a geotiff file
from a WMS service
All the tool of the HortonMachine library dedicated to the
analysis of GIS data, are available with a GUI in the
SpatialToolbox or can be called through a geoscript using the
geoscript console.
12. HortonMachine SpatialToolbox
Open the HM Spatial Toolbox by double clicking on the
right executable for your operating system.
Depending on the PC’s power, the application can take a
little moment to startup.
If it doesn’t on windows, run the hm-spatialtoolbox.bat
to have more informationabout the problems occurring
helping to solve them. One common issue mightfor
example be that the RAM memory given to the module
is larger than the one available on the pc.
13. HortonMachine SpatialToolbox
● to access subcategories: click on the
triangle before the name of the category
● to open a command: select it from the
list
● to search for a command: start typing
the name in the text box on the left side
of the panel
19. HortonMachine SpatialToolbox
The commands are divided in 7 categories:
● Basin
● Dem manipulation
● Geomorphology
● Hillslope
● Hydro-Geomorphology
● Network
● Statistics
20. Discretization of the Terrain
arboton:www.cuahsi.org
The topography is represented by a bivariate continuous
function z = f(x,y) with continuous derivative up to the second
order almost everywhere.
21. Discretization of the Terrain
A GRID is a geographical space of equidistant cells.
Each cell contains a value, for the DTM for example, of
altitude.
arboton:www.cuahsi.org
22. Digital Terrain Models (DTM)
● representation on a regular rectangular grid of the data
constitutes the most common and most efficient form in
which the terrain digital data can be found.
● data in this raster form usually is made by reporting the
vertical coordinate, z, for a subsequent series of points,
along an assigned regular spacing profile.
● main hypothesis on DEM:
➢ data are significant
➢ regular squared grid
➢ 8 direction topology
23. Preliminary operations
unzip the test dataset on harddisk
download the test dataset
merge DTM tiles on area of interest
(Mosaic12)
24. HortonMachine SpatialToolbox
search the module in the
list or start typing the
name in the text box
input files must have the
information of the projection
(CRS) using a prj file for both
vector and raster maps
output maps must be
specified with the
desired extention (shp,
tiff, asc)
25. Primary topographic attributes
Primary topographic attributes are:
● altitude
● slope
● curvature
In Hydrological Modelling the height data is not enough.
It is necessary to eliminate all the depressions that can exist
in the grid.
pit detection → Depitter
26. Primary topographic attributes
● Slope distribution
● Gradient: surface gradient → the water flow directions
and contributes to the determination of the speed
● Slope: drop between each pixel and the adjacent points
placed underneath divided per the length of the path
f y=
∂ z
∂ y
f x=
∂ z
∂ x
∇ z=(f x ,f y)
γ=arctan √f x
2
+f y
2
27. Primary topographic attributes
● Aspect: inclination angle of the gradient (zero towards the
east and the rotation angle anticlockwise)
● Curvatures: is the second derivative of a surface, or the
slope of the slope:
● normal and planar curvatures are locally proportional to each
other and measure the convergence/divergence of the flow
(positive for convergent flow)
● Longitudinal (profile): along the flowlines (max slope direction)
● Tangential (normal): along the contour lines
● Planar (horizontal): intersecting with the XY plane
α=arctan
f x
f y
29. Primary topographic attributes
pit detection
primary attributes
(gradient, slope, curvatures)
unzip the test dataset on harddisk
download the test dataset
merge DTM tiles on area of interest
30. Derived topographic parameters
● Drainage directions: shows how the water flows over the
surface with relation to the topography. Two methods
available:
● D8 (Flow): assign a pointer from each DEM cell to one of its
eight neighbors, either adjacent or diagonal in the direction of
the steepest downward slope
● D8-corrected (DrainDir): D8 method choose the direction
among the two which is closer to the real gradient direction,
this method calculates the estimation of the total deviation
from the gradients, just cumulating the angular or the linear
deviation going from the higher pixel downhill
32. Derived topographic parameters
● Drainage directions: shows how the water flows over the
surface with relation to the topography. Two methods
available:
● D8 (Flow): assign a pointer from each DEM cell to one of its
eight neighbors, either adjacent or diagonal in the direction of
the steepest downward slope
● D8-corrected (DrainDir): D8 method choose the direction
among the two which is closer to the real gradient direction,
this method calculates the estimation of the total deviation
from the gradients, just cumulating the angular or the linear
deviation going from the higher pixel downhill
● Total Contributing Area: upslope catchment (contributing)
areas as the planar projection of the areas afferent to a point
in the basin
35. Derived topographic parameters
● ExtractNetwork: extract channel network from drainage
directions using a threshold value on:
● TCA: only the pixels with contributing area greater than the
threshold are considered channel heads
● product of 2 quantities: i.e. TCA and slopes (representing the
stress tangential to the bottom) → need Gradient
● TCA only in convergent sites: network pixel can be only where
the morphology is convergent → need TopographicClasses
37. Derived topographic parameters
pit detection
definition of the drainage directions
definition of the main network
D8
(Flow)
D8 with correction
(DrainDir)
38. Watershed delineation
● ExtractBasin: extracts a watershed (part of the whole DTM)
from a map of flow directions given the position of the outlet
● coordinates of the basin outlet can be specified in two
ways:
● entering the coordinates in the relative boxes
● clicking on the position of the outlet in the View
● select a point of the extracted network: visualize the
stream river and zoom on the area where you want to
place the basin outlet (better to use the automatic
snapping on a given extracted network)
40. Derived topographic parameters
pit detection
definition of the drainage directions
definition of the main network
extraction of the catchment
D8 with correction
(DrainDir)
D8
(Flow)
41. Watershed analysis
● Cutout: extracts the data of a raster map on the area
defined in an other raster mask map
➢ cut the maps on the region of the extracted basin instead
of running all the commands again to be sure that all the
resulting maps cover exactly the same region
➢ possible problems with modules that need to consider all
the 8 surrounding cells → they miss one or more vaules
on the boundaries (put to NOVALUE)
● Maps to cut are: PIT, DRAINDIR, GRADIENT, SLOPE,
CURVATURES, EXTRACTEDNETWORK, TCA
43. Watershed analysis
● NetworkAttributesBuilder: extracts network attributes and
the vector network based on a raster, the attributes are:
● Hack numbering
● Strahler numbering
● Pfafstetter numbering
● concept for network enumeration: the “extracted”
hydrographic network is, mathematically speaking, an
oriented graph, the elements of such a graph have a tree
topology
44. Watershed analysis
Hack numbering
● HackStream arranges a
channel network starting
from the identification of
the branch according to
Hack.
● the main stream is of order
1
● the (first order) tributaries
of order 2
● the sub-tributaries are of
order 3 and so on.
45. Watershed analysis
Strahler numbering
● sources have Strahler
stream order 1 (marked in
yellow)
● two sources meet and for
a branch with Strahler
order 2
● at every junction of two
stream: if two branches of
different order, m and n,
meet, the resulting stream
has order max(m,n) + 1
46. Watershed analysis
Pfafstetter numbering
● main channel: odd
numbers starting from the
outlet changing at each
confluence
● main tributaries: second
level even numbers
● third level tributaries: third
level even numbers
47. Watershed analysis
● DistanceToOutlet: calculates the projection on the plane of
the distance of each pixel from the basin outlet, measured
along the drainage directions
➢ 0 = topological distance model: pixel number
➢ 1 = simple distance mode: meters
● RescaledDistance: calculates the rescaled distance of
each pixel from the outlet. The total distance to the outlet is
calculated as the sum of:
➢ the distance along the channels
➢ the distance in the hillslopes
➢ required input parameter: ratio between the velocity in
the channel and in the hillslope
49. Hillslopes analysis
● HillslopesToChannelDistance: distance from the river
networks for each hillslope pixel, following the steepest
descent (the drainage directions)
● 0 = topological distance model: pixel number
● 1 = simple distance mode: meters
● Net(Hillslope)Numbering: assigns numbers to the network
links and to their relative hillslopes:
● channel heads are numbered first
● starting again from each source, the drainage direction
are followed till a junction is found
51. Hillslopes analysis
● SplitSubbasins: labels the subbasins of a basin given the
Hack’s number of the channel network up to a selected
order
● i.e. Hack order 2 is specified: extract the subbasins of
Hack order 1 and 2 and the network of the same order
● TopographicClasses (Tc): subdivides the sites of a basin in
the 9 topographic classes identified by the normal
(tangential) and transversal (longitudinal) curvatures:
● 15 → concave sites (classes 30, 70, 90)
● 25 → planar sites (class 10)
● 35 → convex sites (classes 20, 40, 50, 60, 80)
53. Hydro-geomorphology tools
● Ab (AreaPerLength): calculates the draining area per
length unit (A/b),
● A the total upstream area
● b the length of the contour line which is assumed as
drained by the A area estimated based on curvatures
● TopIndex (TopographicIndex): calculates the topographic
index of a basin, it recognizes the sites generating dunnian
surface flow
● logarithm of the ratio between the contributing area and
the slope in each pixel
● sites with higher topographic index become saturated
before than sites with lower topographic index
54. Hydro-geomorphology tools
● Peakflow: semi-distributed model integrated in the
HortonMachine library based on the GIUH (Geomorphologic
Instantaneous Unit Hydrograph) and the width function
● maximum discharge
● the GIUH is calculated using the width function
● precipitation hyetographs constant
● separate superficial (saturated area) and subsuperficial
fluxes (unsaturated area)
● statistics (return time) or event based discharge
56. Hydro-geomorphology tools
● Shalstab: Shalstab algorithm developed by Montgomery
and Dietrich (1994)
● theory of infinite slope with a simplified hydrological
model
● resulting equation shows the ratio between the
contributing area and the length of the boundary in the
point
● function of the soil density, the water density, the angular
slope, the friction angle, the soil transmissivity and the
the effective rain