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
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.
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:
- D8 / OCallaghanD8 — steepest descent among 8 neighbors.
Classic algorithm for hydrological applications
(O'Callaghan and Mark, 1984).
- D4 / OCallaghanD4 — steepest descent among 4 cardinal
neighbors only.
- Rho8 / FairfieldLeymarieD8 — stochastic D8: the
downhill neighbor is selected probabilistically in proportion to slope,
reducing the parallel-flow artifact of D8
(Fairfield and Leymarie, 1991).
- Rho4 / FairfieldLeymarieD4 — stochastic D4.
Multiple flow direction (MFD) — flow is distributed across multiple
downhill neighbors:
- Dinf / Tarboton — flow is apportioned between the two
neighbors bracketing the steepest downhill direction (Tarboton, 1997).
Reduces flow concentration artifacts compared to D8.
- Quinn — flow distributed to all lower neighbors weighted by slope;
equivalent to Holmgren with exponent = 1
(Quinn et al., 1991).
- Holmgren — flow distributed to all lower neighbors weighted by
slope raised to an exponent (requires exponent parameter).
Larger exponents produce more concentrated flow similar to D8;
exponent = 1 is equivalent to Quinn (Holmgren, 1994).
- Freeman — similar to Holmgren; distributes flow using slope raised
to an exponent (requires exponent parameter) (Freeman, 1991).
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.
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.
This module requires the
RichDEM Python package,
which is not a standard GRASS GIS dependency and must be installed separately:
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.
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
- O'Callaghan, J.F., Mark, D.M. (1984).
The extraction of drainage networks from digital elevation data.
Computer Vision, Graphics, and Image Processing Vol 28(3), pp 323–344.
DOI: 10.1016/S0734-189X(84)80011-0
- Fairfield, J., Leymarie, P. (1991).
Drainage networks from grid digital elevation models.
Water Resources Research Vol 27(5), pp 709–717.
DOI: 10.1029/90WR02658
- Freeman, T.G. (1991).
Calculating catchment area with divergent flow based on a regular grid.
Computers & Geosciences Vol 17(3), pp 413–422.
DOI: 10.1016/0098-3004(91)90048-I
- Quinn, P., Beven, K., Chevallier, P., Planchon, O. (1991).
The prediction of hillslope flow paths for distributed hydrological modelling
using digital terrain models.
Hydrological Processes Vol 5(1), pp 59–79.
DOI: 10.1002/hyp.3360050106
- Holmgren, P. (1994).
Multiple flow direction algorithms for runoff modelling in grid based elevation
models: An empirical evaluation.
Hydrological Processes Vol 8(4), pp 327–334.
DOI: 10.1002/hyp.3360080405
- Tarboton, D.G. (1997).
A new method for the determination of flow directions and upslope areas in grid
digital elevation models.
Water Resources Research Vol 33(2), pp 309–319.
DOI: 10.1029/96WR03137
- Barnes, R. (2016). RichDEM: Terrain Analysis Software.
URL: http://github.com/r-barnes/richdem
r.richdem.filldepressions,
r.richdem.breachdepressions,
r.richdem.resolveflats,
r.richdem.terrainattribute,
r.watershed,
r.stream.extract
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