OPTIONS

-o
Calculate distance and elevation against basin outlets instead of streams. It choose only last outlets in the network ignoring nodes.

-s
Calculate distance and elevation against stream nodes instead of streams. It create distance and elevation parameters not for whole basins but for subbasins

stream
Stream network: name of input stream map on which ordering will be performed produced by r.watershed or r.stream.extract. Because streams network produced by r.watershed and r.stream.extract may slighty differ in detail it is required to use both stream and direction map produced by the same module. Stream background shall have NULL value or zero value. Background values of NULL are by default produced by r.watershed and r.stream.extract. If not 0 or NULL use r.mapcalc to set background values to null.

dir
Flow direction: name of input direction map produced by r.watershed or r.stream.extract. If r.stream.extract output map is used, it only has non-NULL values in places where streams occur. NULL (nodata) cells are ignored, zero and negative values are valid direction data if they vary from -8 to 8 (CCW from East in steps of 45 degrees). Direction map shall be of type CELL values. Region resolution and map resoultion must be the same. Also stream network map must have the same resolution. It is checked by default. If resolutions differ the module informs about it and stops. Region boundary and maps boundary may be differ but it may lead to unexpected results.

elev
Elevation: name of input elevation map. Map can be of type CELL, FCELL or DCELL. It is not restricted to resolution of region settings as stream and dir.

OUTPUTS

elevation
Returns elevation above the targer (outlet, node stream) along watercoures. The map is of FCELL type
distance
Returns distance to the targer (outlet, node stream) along watercoures. The map is of FCELL type

DESCRIPTION

Module r.stream.distance is prepared to calculate distance to streams and outlets and elevation above streams and outlets. The distance and elevation is calculated along watercourses. In outlets mode it can also calculate parameters for subbasins.

In streams mode (default) it calculates that parameters upstream from streams which are added as stream mask. In outlets mode there are some additional possibilities. If subbasin is off it calculate parameters only for last point of last (downstream) CELL. In subbasin mode it calculates parameters for every subbasin separately. Subbasin mode acts similar to subbasin mask. Streams file prepared to create basins and subbasins with r.stream.basins can use t to calculate distance and elevation parameters.

NOTES

If there are more than one point or one stream networks and some separate points or separate streams networks are in catchment area defined by others it will results as in subbasin mode. In stream mode subbasin options is ommited. Input maps must be in CELL format (default output of r.watershed, r.stream.order and r.stream.extract) The distance are calculated in meters both for planimeters and Latitude-Longitude projections. The distance is calculated for flat areas not corrected by topography. Distance correction by topography may be done with following mapcalc formula:

echo 'dist_corrected = sqrt(distance^2 + elevation ^2)'|r.mapcalc

Module can work only if direction map, stream map and region map has same settings. It is also required that stream map and direction map come from the same source. For lots of reason this limitation probably cannot be omitted. this means if stream map comes from r.stream.extract also direction map from r.stream.extract must be used. If stream network was generated with MFD method also MFD direction map must be used. Nowadays f direction map comes from r.stream.extract must be patched by direction map from r.watershed. (with r.patch). .

SEE ALSO

r.watershed, r.stream.extract, r.stream.order, r.stream.basins, r.mapcalc, r.reclass, r.patch

AUTHOR

Jarek Jasiewicz