ErmDataPreparator

The data preparation runs, on the digital elevation model, the chain of hydro-geomorphological modules that defines the basin and its sub-basins:

  1. Pitfiller removes the depressions of the DTM;

  2. FlowDirections and DrainDir compute the drainage directions and the total contributing areas;

  3. ExtractNetwork extracts the river network, with the threshold pDrainThreshold;

  4. Skyview computes the sky view factor, used later for the radiation;

  5. ExtractBasin extracts the basin of the outlet, and all the rasters are cut to it with RasterResizer and CutOut;

  6. NetNumbering splits the basin into sub-basins of about pDesiredArea;

  7. GeoframeInputsBuilder writes the sub-basins, the network, their topology and the stream gauges into the GeoFrame database.

All the rasters are written to an outputs folder next to the DTM, each with a QGIS style, so they can be checked in QGIS. Rasters already present are reused, unless doOverwrite is set.

Parameters

First step of the ERM/GeoFrame water budget workflow: from the DTM it derives the drainage directions, the river network and the basin of the outlet, splits the basin into sub-basins (the hydrological response units) and stores them, with their topology and the stream gauges, in the GeoFrame database.

Toolbox folder: GeoFrame
Status: Certified
Keywords: ERM, GeoFrame, DEM, basin, network, data preparation
Authors: Andrea Antonello
Class: org.hortonmachine.hmachine.geoframe.ermworkflow.ErmDataPreparator

Inputs

Parameter

Type

Unit

Default

Description

inDtm

raster file

The digital elevation model of the area. All the outputs are written to an outputs folder next to it.

outGeopackageName

String

geoframe_data.gpkg

File name of the GeoFrame database (a GeoPackage) created in the outputs folder.

pDrainThreshold

int

cells

2000

Minimum contributing area for a cell to be part of the river network: lower values give a denser network.

pDesiredArea

double

m²

1000000.0

Target area of the sub-basins (hydrological response units).

pDesiredAreaDelta

double

%

20.0

Allowed deviation of the sub-basin areas from the target area.

pOutletEasting

Double

Easting of the basin outlet, in the projection of the DTM. Without the outlet, only the rasters of the whole DTM are computed.

pOutletNorthing

Double

Northing of the basin outlet, in the projection of the DTM.

doOverwrite

boolean

false

If true, the rasters already present in the outputs folder are computed again, else they are reused.

inStreamGauge

vector file

The stream gauges (point vector layer), placed on the network as observation points of the discharge.

pStreamGaugeIDField

String

Field of the stream gauges layer holding the station id.

Example

import org.hortonmachine.hmachine.geoframe.ermworkflow.ErmDataPreparator;

// the folder containing the input data: change it to yours
var workspace = "/data/COURSE_WATER/"

var prep = new ErmDataPreparator()
prep.inDtm = workspace + "dem.tif"
prep.outGeopackageName = "geoframe_data.gpkg"

// this defines the network roughness
prep.pDrainThreshold = 2000

// this the size of the hydrological response units
prep.pDesiredAreaDelta = 20.0
prep.pDesiredArea = 1_000_000.0

// the basin's outlet
//176033.934,3926035.360
prep.pOutletEasting = 176033.934
prep.pOutletNorthing = 3926035.36

// observation points
prep.pStreamGaugeIDField = "stationid"
prep.inStreamGauge = workspace + "discharge/dams.shp"

prep.process();