GRASS logo

NAME

r.richdem.flowaccumulation - Calculate flow accumulation using RichDEM

KEYWORDS

raster, hydrology, flow accumulation, flow direction

SYNOPSIS

r.richdem.flowaccumulation
r.richdem.flowaccumulation --help
r.richdem.flowaccumulation input=name output=name [method=string] [exponent=float] [weights=name] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

input=name [required]
Input elevation raster
output=name [required]
Output flow accumulation raster
method=string
Flow accumulation method
Options: D8, D4, Dinf, Tarboton, Quinn, Holmgren, Freeman, Rho8, Rho4, FairfieldLeymarieD8, FairfieldLeymarieD4, OCallaghanD8, OCallaghanD4
Default: D8
exponent=float
Exponent for Holmgren or Freeman methods
weights=name
Optional flow accumulation weights raster

Table of contents

DESCRIPTION

r.richdem.flowaccumulation calculates the contributing (upslope) area for each cell in a DEM using one of several flow routing algorithms. The accumulation value at each cell equals the total number of cells—or total weighted flow—draining through it.

Flow accumulation is a fundamental quantity in terrain analysis: large values identify channels and valley bottoms, while the spatial pattern of accumulation describes the drainage network. The input DEM should be hydrologically conditioned (depressions filled or breached) before running this module.

NOTES

Flow routing methods

r.richdem.flowaccumulation supports both single-flow-direction (SFD) and multiple-flow-direction (MFD) algorithms:

Single flow direction (SFD) — each cell drains entirely to one neighbor:

Multiple flow direction (MFD) — flow is distributed across multiple downhill neighbors:

Weighted accumulation

The optional weights map specifies the amount of flow generated by each cell. If omitted, each cell contributes 1 unit. Weights can represent precipitation, effective rainfall, or any other spatially variable runoff source.

Pre-processing

Depressions and flat areas cause incorrect or undefined flow directions. Apply r.richdem.filldepressions (with optional -e flag) or r.richdem.breachdepressions followed by r.richdem.resolveflats before computing flow accumulation.

REQUIREMENTS

This module requires the RichDEM Python package, which is not a standard GRASS GIS dependency and must be installed separately:

pip install richdem

If pip install richdem fails (the package requires a C++ compiler), build from source:

git clone https://github.com/r-barnes/richdem.git
cd richdem/wrappers/pyrichdem
pip install -e .

Ensure that RichDEM is installed into the same Python environment used by GRASS GIS.

EXAMPLES

Compute D8 flow accumulation on a pre-filled DEM:
r.richdem.filldepressions input=dem output=dem_filled
r.richdem.flowaccumulation input=dem_filled output=accum_d8
Use D-infinity flow routing:
r.richdem.flowaccumulation input=dem_filled output=accum_dinf method=Dinf
Use the Holmgren algorithm with exponent 4 (moderately convergent):
r.richdem.flowaccumulation input=dem_filled output=accum_holmgren method=Holmgren exponent=4
Weight flow accumulation by a precipitation raster:
r.richdem.flowaccumulation input=dem_filled output=discharge method=D8 weights=precip_mm

REFERENCES

SEE ALSO

r.richdem.filldepressions, r.richdem.breachdepressions, r.richdem.resolveflats, r.richdem.terrainattribute, r.watershed, r.stream.extract

AUTHORS

Richard Barnes (RichDEM library)

GRASS GIS bindings: Andrew D. Wickert, with assistance from Claude Sonnet 4.6

SOURCE CODE

Available at: r.richdem.flowaccumulation source code (history)

Latest change: Saturday May 30 11:40:25 2026 in commit: 6b92b3683d38e4bda357b11ae56563b8ba60d0ce


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

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual