ExtractBasin¶
Extracts the basin upstream of an outlet point, following the drainage directions upstream from it. The outlet must lie on the network, as drawn by the drainage directions: when a network vector is supplied, the outlet is first snapped to it, within the snapping distance.
Parameters¶
Extracts the basin draining to an outlet point, from a map of drainage directions.
Toolbox folder: Dem Manipulation
Status: Experimental
Keywords: Dem manipulation, Basin, Watershed, Outlet
Authors: Andrea Antonello, Silvia Franceschi
Class: org.hortonmachine.modules.ExtractBasin
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
double |
|
The northing of the basin outlet, in the projection of the map. |
|
|
double |
|
The easting of the basin outlet, in the projection of the map. |
|
|
raster file |
The map of the drainage directions. |
||
|
vector file |
A user supplied network map. If available, the outlet point is snapped to it before extracting the basin. |
||
|
double |
|
The maximum distance for the snapping of the outlet to the network, in map units. |
|
|
boolean |
|
Flag to enable vector basin smoothing. |
|
|
boolean |
|
Enable high speed extraction. This requires -xss to be set high (ex -Xss1024g) on the JVM for huge basins. |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
double |
The area of the extracted basin, in squared map units. |
|
|
output file |
The extracted basin mask. |
|
|
output file |
The optional outlet point vector map. |
|
|
output file |
The optional extracted basin vector map. |
Example¶
The example runs on the sample elevation model of the manual, dtm_flanginec.tif in docs/manual/modules/maps/data, each module on the outputs of the previous ones:
import org.hortonmachine.modules.ExtractBasin
// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"
var extractBasin = new ExtractBasin()
extractBasin.inFlow = folder + "drain.tif"
// the outlet, on the network
extractBasin.pEast = 1638705.0
extractBasin.pNorth = 5112805.0
extractBasin.outBasin = folder + "basin.tif"
extractBasin.outVectorBasin = folder + "basin.shp"
extractBasin.outOutlet = folder + "outlet.shp"
extractBasin.process()
The basin of an outlet in the middle of the sample area: 1.9 km².¶