geoprimsField-grade geospatial math

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.

7.938m

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?

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: 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

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

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