Topographic position index (TPI)
The topographic position index at the center of a 3 x 3 elevation window: the cell less the mean of its eight neighbors, and whether it sits above or below them.
The position index is 7.938 m, so the cell sits above its neighbours: a ridge, a summit, or a spur.
- Position
Provenance
- Computed by
- raster.terrain.tpi 1.0.0, core 0.1.0
- Model
- TPI as the center elevation less the mean of its eight neighbors (Wilson and others 2007), as in raster.terrain.ruggedness
- Accuracy
- Exact arithmetic on the elevations given.
- Notes
- None
- Cites
- 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?
How we got thisFormula, worked example, sources, and proof
Model: TPI as the center elevation less the mean of its eight neighbors (Wilson and others 2007), as in raster.terrain.ruggedness
Accuracy: Exact arithmetic on the elevations given.
When to use this: Use this to tell whether a cell stands above its surroundings, like a ridge or a summit, or below them, like a valley or a hollow. It is the first step of most landform classifications. Enter the nine elevations around the cell; a positive index is high ground and a negative one is low ground.
Limitations: It looks only at the eight cells around the center, so it sees small landforms: a cell can sit above its neighbors and still lie in a broad valley. Values depend on the cell size and are comparable only within one resolution.
Worked example: A ridge crest on a 30 m grid. Source: The definition in Python, checked against gdaldem 3.13.3 TPI (tools/vectors/gen_terrain_views.py). It is golden test vector v005, and every build checks the tool still gives its answer within its tolerance.
You enter
- Cell size
- 30 m
- Elevation window
- 842.0, 845.5, 841.2 846.1, 851.3, 847.0 840.4, 844.8, 839.9
You get
- Topographic position index
- 7.938 m
- Position
- above its neighbours: a ridge, a summit, or a spur
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
- 2026-10-14, changed: Slope, aspect, hillshade, the terrain ruggedness index, and the topographic position index, each as its own tool, are now stable. Each matches gdaldem 3.13.3 on 24 windows (hillshade exactly; the rest within gdaldem's 32-bit rounding) and its parent tool on 208 fixture windows, with invariant tests for turning, raising, and inverting the ground. Results are unchanged. Changelog
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
- Multiscale terrain analysis of multibeam bathymetry data for habitat mapping on the continental slope, Wilson, M. F. J., O'Connell, B., Brown, C., Guinan, J. C., and Grehan, A. J., Marine Geodesy, Volume 30, issues 1-2, pages 3-35. Topographic position index and roughness on a 3 x 3 window.
Terms
- TPI: topographic position index
- A cell's elevation less the mean of its neighbours: positive on a ridge or summit, negative in a valley or hollow. Source: Multiscale terrain analysis of multibeam bathymetry data for habitat mapping on the continental slope