DistanceToOutlet

Calculates the distance of each cell from the outlet, along the path the water follows: in meters, also in 3D with the elevation, or as the number of cells crossed. The distances give the width function of the basin, how many cells are at each distance from the outlet, and with a velocity the time each cell needs to reach it.

The outlet must be marked with the value 10 in the drainage directions, for example with MarkOutlets: the paths that leave the map elsewhere get 0. RescaledDistance computes the same distance, with the hillslopes slowed down.

Parameters

Calculates the distance of each cell from the outlet, along the drainage directions. The outlets must be marked with the value 10 in the drainage directions, for example with MarkOutlets: the paths that leave the map elsewhere get 0.

Toolbox folder: Network
Status: Certified
Keywords: Network, Distance to outlet, Drainage directions
Authors: Andreis Daniele, Erica Ghesla, Antonello Andrea, Cozzini Andrea, PisoniSilvano, Rigon Riccardo
Class: org.hortonmachine.modules.DistanceToOutlet

Inputs

Parameter

Type

Unit

Default

Description

inPit

raster file

m

The optional map of the depitted elevation, to measure the distances in 3D, with the meters mode.

inFlow

raster file

The map of the drainage directions, with the outlets marked with 10.

pMode

int

0

The unit of the distance: 0 for meters, 1 for the number of cells crossed.

Outputs

Parameter

Type

Unit

Description

outDistance

output file

m or cells

The map of the distance to the outlet.

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

// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"

var distanceToOutlet = new DistanceToOutlet()
// the drainage directions with the outlet marked by MarkOutlets
distanceToOutlet.inFlow = folder + "drain_marked.tif"
// the elevation, to measure in 3D
distanceToOutlet.inPit = folder + "pit.tif"
// the distance in meters
distanceToOutlet.pMode = 0
distanceToOutlet.outDistance = folder + "distance.tif"
distanceToOutlet.process()
The distance from the outlet of the basin of ExtractBasin, in meters, measured in 3D.

The distance from the outlet of the basin of ExtractBasin, in meters, measured in 3D.