geoprimsField-grade geospatial math

Terrain ruggedness index (TRI)

The terrain ruggedness index at the center of a 3 x 3 elevation window, both as Riley's root of summed squares and as the mean absolute difference.

31.881m

Ruggedness is 31.881 m by Riley, or 9.775 m as a mean difference.

Ruggedness, mean absolute (Wilson)
Provenance
Computed by
raster.terrain.roughness-tri 1.0.0, core 0.1.0
Model
TRI as the root of the summed squared differences from the center cell (Riley and others 1999, as corrected) and as the mean absolute difference (Wilson and others 2007), as in raster.terrain.ruggedness
Accuracy
Exact arithmetic on the elevations given.
Notes
None
Cites
Riley, S. J., DeGloria, S. D., and Elliot, R., Intermountain Journal of Sciences, A terrain ruggedness index that quantifies topographic heterogeneity; Wilson, M. F. J., O'Connell, B., Brown, C., Guinan, J. C., and Grehan, A. J., Marine Geodesy, Multiscale terrain analysis of multibeam bathymetry data for habitat mapping on the continental slope

Something look off?

Your values

Showing an example. Change anything.
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: TRI as the root of the summed squared differences from the center cell (Riley and others 1999, as corrected) and as the mean absolute difference (Wilson and others 2007), as in raster.terrain.ruggedness

Accuracy: Exact arithmetic on the elevations given.

When to use this: Use this to put a number on how broken the ground is around a cell: for habitat studies, access planning, or matching a TRI value from a paper or a GIS layer. Enter the nine elevations around the cell. Both forms of the index are given, so you can match whichever one a source used.

Limitations: Two different indices are called TRI, and they differ by about a factor of three on the same ground; check which one a value you compare against used. Both depend on the cell size, so values are comparable only within one resolution.

Worked example: Broken ground on a 30 m grid. Source: The definitions in Python, checked against gdaldem 3.13.3 TRI (tools/vectors/gen_terrain_views.py). It is golden test vector v004, and every build checks the tool still gives its answer within its tolerance.

You enter

Cell size
30 m
Elevation window
1210.4, 1225.9, 1218.2 1204.7, 1220.0, 1231.6 1199.3, 1212.8, 1226.1

You get

Terrain ruggedness index (Riley)
31.881 m
Ruggedness, mean absolute (Wilson)
9.775 m

Review: Not yet independently reviewed by a GIS professional.

Last verified: 2026-09-22, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.

Status: version 1.0.0, core 0.1.0. See this tool in the verification report.

Changes

Checked against: 25 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Constants this tool assumes

Values you do not enter, and where each comes from.

WGS 84 semi-major axis, for cell sizes given in degrees
6378137 m — Department of Defense World Geodetic System 1984
WGS 84 inverse flattening, for cell sizes given in degrees
298.257223563 — Department of Defense World Geodetic System 1984

Sources

Terms

TRI: terrain ruggedness index
The mean absolute difference in elevation between a cell and its eight neighbours: how broken the ground is around it. Source: A terrain ruggedness index that quantifies topographic heterogeneity