GRASS logo

NAME

r.richdem.terrainattribute - Calculate terrain attributes using RichDEM

KEYWORDS

raster, terrain, geomorphology

SYNOPSIS

r.richdem.terrainattribute
r.richdem.terrainattribute --help
r.richdem.terrainattribute input=name output=name [attribute=string] [zscale=float] [--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 terrain attribute raster
attribute=string
Terrain attribute to calculate
Options: slope_riserun, slope_percentage, slope_degrees, slope_radians, aspect, curvature, planform_curvature, profile_curvature
zscale=float
Z-axis scale factor applied before calculation
Default: 1.0

Table of contents

DESCRIPTION

r.richdem.terrainattribute calculates first- and second-order terrain attributes from a digital elevation model. Available attributes are slope (in four unit systems), aspect, and three curvature measures.

Slope

Slope is the magnitude of the terrain gradient—the rate of elevation change in the steepest downhill direction. It is computed using the Horn (1981) method, which uses a weighted average of finite differences over a 3×3 neighborhood to estimate the east–west and north–south gradient components. Slope is available in four unit systems:

Aspect

aspect is the compass direction of the steepest downhill gradient, measured in degrees clockwise from north (0–360°), using the Horn (1981) method.

Curvature

Curvature describes the rate of change of slope and is useful for identifying ridges, valleys, and areas of flow convergence or divergence. Three curvature attributes are available, following Zevenbergen and Thorne (1987):

Z-axis scaling

The optional zscale parameter multiplies elevation values before computation. This is useful when the vertical and horizontal units differ (e.g., elevation in meters, horizontal units in degrees for geographic coordinates). A common choice for degree-unit data is zscale = 1/111000 to convert degrees to meters.

NOTES

Computations use a 3×3 moving window and assume a planar local coordinate system. For data in geographic (latitude/longitude) coordinates, the horizontal scale varies with latitude and slope results will be approximate. In such cases, project to an equal-area or conformal coordinate system before computing terrain attributes, or apply an appropriate zscale.

To compute slope and aspect simultaneously in GRASS, consider r.slope.aspect. For more morphometric parameters computed over variable window sizes, see r.param.scale.

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

Calculate slope in degrees:
r.richdem.terrainattribute input=dem output=slope attribute=slope_degrees
Calculate aspect:
r.richdem.terrainattribute input=dem output=aspect attribute=aspect
Calculate planform curvature:
r.richdem.terrainattribute input=dem output=planform_curv attribute=planform_curvature
Scale vertical units (elevation in feet, horizontal in feet):
r.richdem.terrainattribute input=dem_ft output=slope attribute=slope_degrees zscale=1.0

REFERENCES

SEE ALSO

r.slope.aspect, r.param.scale, r.richdem.flowaccumulation

AUTHORS

Richard Barnes (RichDEM library)

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

SOURCE CODE

Available at: r.richdem.terrainattribute 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