GRASS logo

Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

NAME - Calculates local parameters for individual streams.


raster, hydrology, stream network

SYNOPSIS --help [-dlcm] stream_rast=name direction=name elevation=name [identifier=name] [distance=name] [difference=name] [gradient=name] [curvature=name] [memory=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Calculate parameters from outlet (downstream values)
Calculate local values (for current cell)
Calculate distance in cell count (ignored local)
Use memory swap (operation is slow)
Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


stream_rast=name [required]
Name of input raster map with stream network
direction=name [required]
Name of input raster map with flow direction
elevation=name [required]
Name of input elevation raster map
Name for output unique stream identifier raster map
Name for output init/join/outlet distance raster map
Name for output elevation init/join/outlet difference raster map
Name for output mean init/join/outlet gradient of stream raster map
Name for output local stream curvature raster map
Maximum memory used in memory swap mode (MB)
Default: 300

Table of contents


The module is prepared to calculate some local properties of the stream network. It is supplementary module for, and to investigate channel subsystem. For slope subsystem parameters is It may use ordered or unordered network. It calculate parameters for every segment between it init to outlet/join to the next stream. it also may calculate parameters between outlet and segment's init. It can calculate parameters for every orders but best results are for these orders where order remains unchanged from stream init to natural outlet (Hack and Horton ordering).


Calculate downstream distance (from current cell DOWNSTREAM to outlet/join). Default is upstream (from current cell upstream to init/join.
Only for very large data sets. Uses segment library to optimize memory consumption during analysis
Stream network: name of input stream map. Map may be ordered according to one of the ordering systems as well as unordered (with original stream identifiers). Because the streams network produced by r.watershed and may slightly differ in detail it is required to use both stream and direction map produced by the same module. Non-stream cell values must be set to NULL.
Flow direction: name of input direction map produced by r.watershed or If the output map is used, it contains non-NULL values only in places where streams are present. NULL 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). The direction map shall be of integer type (CELL). The region resolution and map resolution must be the same. Also the stream_rast network map must have the same resolution. If resolutions differ the module informs about it and stops. Region boundary and maps boundary may be different 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 streams and direction.
Upstream distance of current cell to the init/join. Flag modifications:
-d: downstream distance of current cell to the join/outlet;
-l: local distance between current cell and next cell. In most cases cell resolution and sqrt2 of cell resolution. useful when projection is LL or NS and WE resolutions differs. Flag -d ignored
-c: distance in cells. Map is written as double. Use r.mapcalc to convert to integer. Flags -l and -d ignored.
Upstream elevation difference between current cell to the init/join. It we need to calculate parameters different than elevation. If we need to calculate different parameters than elevation along streams (for example precipitation or so) use necessary map as elevation. Flag modifications:
-d: downstream difference of current cell to the join/outlet;
-l: local difference between current cell and next cell. With flag calculates difference between previous cell and current cell
-c: Ignored.
Upstream mean gradient between current cell and the init/join. Flag modifications:
-d: downstream mean gradient between current cell and the join/outlet;
-l: local gradient between current cell and next cell. Flag -d ignored
-c: Ignored.
Local stream course curvature of current cell. Calculated according formula: first_derivative/(1-second_derivative2)3/2 Flag modifications:
-d: ignored;
-l: Ignored.
-c: Ignored.
Integer map: In ordered stream network there are more than one segment (segment: a part of the network where order remains unchanged) with the same order. To identify particular segments (for further analysis) every segment receive his unique identifier.


This example shows how to visualise the change of gradient map along the main stream of the catchment:
g.region -p -a raster=elevation
r.watershed elevation=elevation threshold=10000 drainage=direction stream=streams streams=streams direction=direction hack=hack streams=hack direction=direction elevation=elevation \
  identifier=stream_identifier distance=stream_distance gradient=stream_gradient

# Eg., 495 is a stream identifier. May be different in different situation
r.mapcalc "stgrad = if(stream_identifier==495,float(stream_gradient),null())"
r.mapcalc "stdist = if(stream_identifier==495,float(stream_distance),null())"

# Use R for plotting


r.mapcalc,,,,,,,,, r.watershed


Jarek Jasiewicz, Adam Mickiewicz University, Geoecology and Geoinformation Institute.


Available at: source code (history)

Latest change: Monday Jan 30 19:52:26 2023 in commit: cac8d9d848299297977d1315b7e90cc3f7698730

Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2023 GRASS Development Team, GRASS GIS 8.2.2dev Reference Manual