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.

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.

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.


Output statistics are send to standard output. If there are no errors no addational messages are send to standard output. To redirect output to file use redarection operators: > or >>.


Module r.stream.stats is prepared to calculate Hotron's statistics of drainage network.

These statistics are calculated according formulas given by R.Horton (1945). Because Horton do not defined precisely what is stream slope, I proposed 2 different approaches: first (slope) use cell-by-cell slope calculation, second (gradient) use difference between elevation of outlet and source of every channel to its length to calculate formula. Bifurcation ratio for every order is calculated acording formula:


where i the current order and i+1 next higher order. For max order of the map number of streams is zero. Rest of the ratios are calculated in similar mode. The bifurcation and other ratios for the whole catchment (map) is calculated as mean i.e sum of all bifurcation ratio / max_order-1 (for max_order stream bifurcation ratio = 0) It is strongly recommended to extract stream network using basin map created with r.stream.basin. If whole stream order map is used the calculation will be performed but results may not have hydrological sense. For every order (std) means that statstic is calculated with standard deviation:

for the whole basin:


Module calculates statistics for all streams in input stream map.It is strongly recommended to extract only network of one basin, but it is not necessary for computation. Streams for desired basin first can be extracted with following mapcalc formula:

echo 'sel_streams=if(basin==xxx,streams,null())'|r.mapcalc #xxx category of desired basin

It is also possible to calculate Horton's statistics for Shreve ordering but it has limited hydrological sense. Hack main stream is not the same what so called Horton's reverse ordering.

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


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


Jarek Jasiewicz

Last changed: $Date$