The module *r.stream.order* calculates Strahler's and other stream
hierarchy methods. It is a basic module for topological analysis of
drainage networks.

Input stream network map (**stream_rast**) may be produced using
either
*r.watershed*
or *r.stream.extract*. Since
stream network maps produced
by *r.watershed*
and *r.stream.extract* may
slightly differ in detail, it is required to use both stream and
direction maps produced by the same module. Non-stream cell values
must be set to NULL.

Input **direction** raster map with flow direction may be produced
using either *r.watershed*
or *r.stream.extract*.
If *r.stream.extract*
output map is used, it is non-NULL only where streams occur and NULL
elsewhere. NULL (nodata) cells are ignored, zero and negative values
are valid direction data only if they vary from -8 to 8 (CCW from East
in steps of 45 degrees). Flow direction map shall be of integer type
(CELL).

Optional input flow **accumulation** map may be produced
by *r.watershed*
or *r.stream.extract*. This
map is an option only if Horton's or Hack's ordering is
performed. Normally both Horton and Hack ordering are calculated on
cumulative stream length which is calculated internally. Flow
accumulation can be used if the user wants to calculate the main channel
as the stream with the highest value of accumulation. Flow
accumulation map shall be of DCELL type, as is by default produced by
*r.watershed* or converted to
DCELL with *r.mapcalc*.

If **-z** is specified than *r.stream.order* creates
zero-value background instead of NULL (no-data). For some reason (like
map algebra calculation) zero-valued background may be required.

If **-a** is specified than *r.stream.order* uses
accumulation raster map instead of cumulated stream length to
determine main branch at bifurcation. Works well only with stream
network produced with SFD algorithm.

Flag **-m** force to use segment library to optimise memory
consumption during analysis. Recommended only for very large data
sets.

Input **elevation** map can be of type CELL, FCELL or DCELL. It is
used to calculate geometrical properties of the network stored in the
table.

Output **stream_vect** vector map stores stream network. It has a
table associated, where stream network topology can be stored. Because
*r.stream.order* is prepared to work either
with *r.watershed* or
*r.stream.extract*, it may
be used to create corrected stream vector from
*r.watershed* results.

*r.stream.order* may produce various output raster
maps **strahler** (Strahler's stream order raster
map), **shreve** (Shreve's stream magnitude raster
map), **horton** (Horton's stream order raster map - requires flow
accumulation map), **hack** (Hack's stream order output raster
map), and **topo** (topological dimension streams raster map).

- if the node has no children, its Strahler order is 1.
- if the node has one and only one tributary with Strahler greatest order i, and all other tributaries have order less than i, then the order remains i.
- if the node has two or more tributaries with greatest order i, then the Strahler order of the node is i + 1.

r.mapcalc expr="scheidegger = shreve * 2.0"

r.mapcalc expr="drwal = int(log(shreve,2.0)) + 1.0"

`cat`integer: category;`stream`integer: stream number, usually equal to cat;`next_stream`integer: stream to which contribute current stream (downstream);`prev_streams`; two or more contributing streams (upstream);`strahler`integer: Strahler's stream order;`horton`integer: Hortons's stream order;`shreve`integer: Shreve's stream magnitude;`hack`integer: Hack's main streams or Gravelius order;`topo_dim`integer: Topological dimension streams order;`scheidegger`integer: Scheidegger's Consisted Associated Integers;`drwal`integer: Drwal's stream hierarchy;`length`double precision: stream length;`stright`double precision: length of stream as stright line;`sinusoid`double precision: fractal dimension: stream length/stright stream length;`cum_length`double precision: length of stream from source;`flow_accum`double precision:`out_dist`double precision: distance of current stream init from outlet;`source_elev`double precision: elevation of stream init;`outlet_elev`double precision: elevation of stream outlet;`elev_drop`double precision: difference between source_elev and outlet_elev + drop outlet;`out_drop`double precision: drop at the outlet of the stream;`gradient`double precision: drop/length;

g.region -p -a raster=elevation r.watershed elevation=elevation threshold=10000 drainage=direction stream=streams r.stream.order stream_rast=streams direction=direction strahler=riverorder_strahler \ horton=riverorder_horton shreve=riverorder_shreve hack=riverorder_hack \ topo=river_topodim # vector river network r.watershed elevation=elevation threshold=10000 accumulation=accum r.stream.order stream_rast=streams direction=direction elevation=elevation \ accumulation=accum stream_vect=river_vector

- Drwal, J., (1982),
*Wyksztalecenie i organizacja sieci hydrograficznej jako podstawa oceny struktury odplywu na terenach m;odoglacjalnych*, Rozprawy i monografie, Gdansk 1982, 130 pp (in Polish) - Hack, J., (1957),
*Studies of longitudinal stream profiles in Virginia and Maryland*, U.S. Geological Survey Professional Paper, 294-B - Horton, R. E. (1945),
*Erosional development of streams and their drainage basins: hydro-physical approach to quantitative morphology*, Geological Society of America Bulletin 56 (3): 275-370

Scheidegger A. E., (1966),*Statistical Description of River Networks*. Water Resour. Res., 2(4): 785-790 - Shreve, R., (1966),
*Statistical Law of Stream Numbers*, J. Geol., 74, 17-37. - Strahler, A. N. (1952),
*Hypsometric (area-altitude) analysis of erosional topology*,Geological Society of America Bulletin 63 (11): 1117-1142 - Strahler, A. N. (1957),
*Quantitative analysis of watershed geomorphology*, Transactions of the American Geophysical Union 8 (6): 913-920. - Woldenberg, M. J., (1967),
*Geography and properties of surfaces*, Harvard Papers in Theoretical Geography, 1: 95-189.

See also r.streams.* modules wiki page.

*Last changed: $Date$*