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

pNorth

double

-1.0

The northing of the basin outlet, in the projection of the map.

pEast

double

-1.0

The easting of the basin outlet, in the projection of the map.

inFlow

raster file

The map of the drainage directions.

inNetwork

vector file

A user supplied network map. If available, the outlet point is snapped to it before extracting the basin.

pSnapbuffer

double

200.0

The maximum distance for the snapping of the outlet to the network, in map units.

doSmoothing

boolean

false

Flag to enable vector basin smoothing.

doHighSpeed

boolean

false

Enable high speed extraction. This requires -xss to be set high (ex -Xss1024g) on the JVM for huge basins.

Outputs

Parameter

Type

Unit

Description

outArea

double

The area of the extracted basin, in squared map units.

outBasin

output file

The extracted basin mask.

outOutlet

output file

The optional outlet point vector map.

outVectorBasin

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².

The basin of an outlet in the middle of the sample area: 1.9 km².