Slope¶
The slope of each cell along its drainage direction: the drop to the downstream cell over their distance. It is the slope the water actually follows, used by the hydrological indices like the topographic index, while the Gradient is the steepest slope in any direction.
The drainage directions should come from the same depitted elevation map, with FlowDirections or DrainDir: otherwise the downstream cell can be higher, and the slope negative.
Parameters¶
Calculates the slope of each cell along its drainage direction, as the drop to the downstream cell over their distance. Unlike the gradient, it is the slope the water follows.
Toolbox folder: Geomorphology
Status: Tested
Keywords: Geomorphology, Slope, Drainage directions
Authors: Antonello Andrea, Erica Ghesla, Cozzini Andrea, Franceschi Silvia, Pisoni Silvano, Rigon Riccardo
Class: org.hortonmachine.modules.Slope
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
raster file |
m |
The map of the depitted elevation. |
|
|
raster file |
The map of the drainage directions. |
||
|
boolean |
|
Set the negative slopes, which can occur with drainage directions not computed on this elevation map, to the smallest positive value. |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
output file |
m/m |
The map of the slope, as the tangent of the slope angle. |
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.Slope
// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"
var slope = new Slope()
slope.inPit = folder + "pit.tif"
slope.inFlow = folder + "drain.tif"
slope.outSlope = folder + "slope.tif"
slope.process()
The slope of the sample area along the drainage directions of DrainDir, as the tangent of the slope angle.¶