xdem.DEM.topographic_position_index

xdem.DEM.topographic_position_index#

DEM.topographic_position_index(window_size=3, mp_config=None)[source]#

Calculates the Topographic Position Index, the difference to the average of neighbouring pixels. Output is in the unit of the DEM (typically meters).

Based on: Weiss (2001), http://www.jennessent.com/downloads/TPI-poster-TNC_18x22.pdf.

Parameters:
  • window_size (int) – The size of the window for deriving the metric.

  • mp_config (MultiprocConfig | None) – Multiprocessing configuration, run the function in multiprocessing if not None.

  • engine – Engine to use for computing the attribute, “scipy” or “numba”.

Raises:

ValueError – If the inputs are poorly formatted.

Return type:

TypeVar(RasterType, bound= Raster)