ErmDataPreparator¶
The data preparation runs, on the digital elevation model, the chain of hydro-geomorphological modules that defines the basin and its sub-basins:
Pitfiller removes the depressions of the DTM;
FlowDirections and DrainDir compute the drainage directions and the total contributing areas;
ExtractNetwork extracts the river network, with the threshold
pDrainThreshold;Skyview computes the sky view factor, used later for the radiation;
ExtractBasin extracts the basin of the outlet, and all the rasters are cut to it with RasterResizer and CutOut;
NetNumbering splits the basin into sub-basins of about
pDesiredArea;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 |
|---|---|---|---|---|
|
raster file |
The digital elevation model of the area. All the outputs are written to an outputs folder next to it. |
||
|
String |
|
File name of the GeoFrame database (a GeoPackage) created in the outputs folder. |
|
|
int |
cells |
|
Minimum contributing area for a cell to be part of the river network: lower values give a denser network. |
|
double |
m² |
|
Target area of the sub-basins (hydrological response units). |
|
double |
% |
|
Allowed deviation of the sub-basin areas from the target area. |
|
Double |
Easting of the basin outlet, in the projection of the DTM. Without the outlet, only the rasters of the whole DTM are computed. |
||
|
Double |
Northing of the basin outlet, in the projection of the DTM. |
||
|
boolean |
|
If true, the rasters already present in the outputs folder are computed again, else they are reused. |
|
|
vector file |
The stream gauges (point vector layer), placed on the network as observation points of the discharge. |
||
|
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();