raster_tools.surface.tpi#

raster_tools.surface.tpi(dem, annulus_inner, annulus_outer)[source]#

Compute the Topographic Position Index of a DEM.

This function compares each elevation value to the mean of its neighborhood to produce a scale-dependent index that highlights ridges (positive values) and valleys (negative valleys). Values close to zero, indicate areas with constant slope such as plains (slope of zero). The basic function looks like this: tpi = int(dem - focalmean(dem, annulus_inner, annulus_outer) + 0.5)

An annulus (donut) is used to select the neighborhood of each pixel. Larger radii values select features at larger scales.

The annulus radii values are in grid cell units or pixels so annulus_inner=10 for a 30m resoution raster, specifies a radius of 300m.

Parameters
  • dem (Raster or path str) – The DEM raster to use for TPI analysis.

  • annulus_inner (int) – The inner radius of the annulus in pixels. If 0, a circle of radius annulus_outer is used to select the neighborhood.

  • annulus_outer (int) – The outer radius of the annulus in pixels. Must be greater than annulus_inner.

Returns

tpi – The resulting TPI index for dem at the scale determined by the annulus radii.

Return type

Raster

References