GRASS logo

NAME - Snap point to modelled stream network.
Input can be stream network, point vector map with outlets or outlet coordinates.


raster, hydrology, stream network, basins creation

SYNOPSIS --help input=name output=name [stream_rast=name] [accumulation=name] [threshold=float] [radius=integer] [memory=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


input=name [required]
Name of input vector map
Name of input vector points map
output=name [required]
Name for output vector points map
Name of input raster map with stream network
Name of input accumulation raster map
Minimum accumulation threshold to snap
Default: -1
Maximum distance to snap (in cells)
Default: 1
Max memory used (MB)
Default: 300

Table of contents


The module is a supplementary module for and to correct the position of outlets or stream initial points as they do not lie on the streamlines.

For the outlet, the point is snapped to the nearest point which lies on the streamline.

For the stream initial points, when there is a small tributary near the main stream, the accumulation threshold shall be high enough to force the program ignoring this tributary and snap to the main stream. If there is no accumulation map, the points will be snapped to the nearest stream line, which in particular situations may be wrong. Because the* modules are prepared to work with MFD accumulation maps, both stream network and accumulation map are necessary.

While it is assumed that the accumulation map is a MFD map, if the stream network is not supplied, the snap point is calculated in different way: the threshold is used to select only those points in the search radius which have accumulation value greater than the given threshold. The next mean value of these points is calculated and its value is taken as a new threshold. This procedure guarantees that points are snapped to the center of the stream tube. While for inits small thresholds are in use, it is probable that points were snapped to the stream tube border instead of its center.

It is strongly recommended to use both stream network (even pre-generated with small accumulation threshold) and accumulation raster map, than accumulation or stream raster map only.


Stream network created by or r.watershed. If used, the points are snapped to the nearest streamline point whose accumulation is greater than the threshold. If the accumulation is not used, the point is snapped to the nearest stream.
Accumulation map created with r.watershed and used to generate the stream network with If the stream network is not used, the point is adaptively snapped to the point where the value is greater than mean values of accumulation greater than given threshold in a search radius. See the description for details.
Search radius (in cells). If there are no streams in the search radius, the point is not snapped. If there are no cells with accumulation greater than accumulation threshold, the point also is not snapped.
Minimum value of accumulation to snap the point. This option is added to the snap stream inits to the stream tubes and to distinguish between local tributaries and main streams.
Vector file containing outlets or inits as vector points. Only point's categories are used. Any table attached to it is ignored. Every point shall have its own unique category.
Vector file containing outlets or inits after snapping. On layer 1, the original categories are preserved, on layer 2 there are four categories which mean:
  1. skipped (not in use yet)
  2. unresolved (points remain unsnapped due to lack of streams in search radius
  3. snapped (points snapped to streamlines)
  4. correct (points which remain on their original position, which were originally corrected)


g.region -p -a raster=elevation
r.watershed elevation=elevation threshold=10000 drainage=dirs stream=streams accumulation=accum
# snap a point sampled in the riverine landscape to the calculated river network input=mysampleoutlet output=mysampleoutlet_snapped stream_rast=streams accumulation=accum


r.mapcalc, r.patch, r.reclass,,,,,,,,,,,, r.watershed

See also r.streams.* modules wiki page.


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

Last changed: $Date: 2014-12-27 14:30:46 +0100 (Sat, 27 Dec 2014) $


Available at: source code (history)

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

© 2003-2017 GRASS Development Team, GRASS GIS 7.2.3svn Reference Manual