How Topographic Position Index works

Available with Spatial Analyst license.

The output raster of the Topographic Position Index tool stores the topographic position index (TPI) value calculated within the specified neighborhood for each cell location. A TPI value is the difference between the elevation of the current cell and the mean elevation of its neighborhood. Positive TPI values indicate that the current cell is in a higher position than its neighborhood (such as peaks or ridges). Negative values indicate that the current cell is in a lower position than its neighborhood (such as valleys or canyons).

The output TPI values, combined with other topographic metrics (such as slope), can be used to classify landforms or slope positions on the input surface.

Topographic Position Index tool input and output rasters
The Topographic Position Index tool output rasters are calculated using circular neighborhoods with two different radiuses

TPI value calculation

To calculate the TPI value, the Topographic Position Index tool does the following for each cell in the input surface raster:

  1. An analysis neighborhood is determined, centered at the target cell.
  2. The mean elevation is calculated using the cells within the analysis neighborhood. NoData cells in the neighborhood will be excluded from the calculation.
  3. The TPI value is calculated by taking the difference between the target cell elevation value and the analysis neighborhood mean elevation.
  4. The TPI value is stored at the target cell.

Neighborhood types

The shape of a neighborhood can be an annulus (a donut), a circle, a rectangle, or a wedge. Using a kernel file, you can also define a custom neighborhood shape.

Following are descriptions of the neighborhood shapes and how they are defined:

  • Annulus
    • The annulus shape is composed of two circles, one inside the other to make a donut shape. Cells with centers that fall outside the radius of the smaller circle but inside the radius of the larger circle will be included in processing the neighborhood. The area that falls between the two circles constitutes the annulus neighborhood.
    • The radius is identified in cells or map units, measured perpendicular to the x- or y-axis. When the radii are specified in map units, they are converted to radii in cell units. The resulting radii in cell units produce an area that most closely represents the area calculated using the original radii in map units. Any cell center encompassed by the annulus will be included in the processing of the neighborhood.
    • The default annulus neighborhood is an inner radius of one cell and an outer radius of three cells.
    • An example illustration of an annulus neighborhood follows:

    Processing cell with default annulus neighborhood
    A processing cell with the default annulus neighborhood (inner radius = 1 cell, outer radius = 3 cells) is shown.

  • Circle
    • A circle neighborhood is created by specifying a radius value.
    • The radius is identified in cell or map units, measured perpendicular to the x- or y-axis. When the radius is specified in map units, additional logic is used to determine which cells are included in the processing neighborhood. First, the exact area of a circle defined by the specified radius value is calculated. Next, the area is calculated for two additional circles, one with the specified radius value rounded down and one with the specified radius value rounded up. These two areas are compared to the result from the specified radius, and the radius of the area that is closest will be used in the operation.
    • The default circle neighborhood radius is three cells.
    • An example illustration of a circle neighborhood follows:

    Processing cell with circle neighborhood
    A processing cell with a circle neighborhood (radius = 2 cells) is shown.

  • Rectangle
    • The rectangle neighborhood is specified by providing a width and a height in either cells or map units.
    • Only the cells with centers that fall within the defined object are processed as part of the rectangle neighborhood.
    • The default rectangle neighborhood is a square with a height and width of three cells.
    • The x,y position for the processing cell within the neighborhood, with respect to the upper left corner of the neighborhood, is determined by the following equations:

      x = (width of the neighborhood + 1)/2
      y = (height of the neighborhood + 1)/2

      If the input number of cells is even, the x,y coordinates are computed using truncation. For example, in a 5-by-5 cell neighborhood, the x- and y-values are 3,3. In a 4-by-4 neighborhood, the x- and y-values are 2,2.

    • The following are example illustrations of two rectangle neighborhoods:

    Processing cell with two rectangle neighborhoods
    A processing cell with two different rectangle neighborhoods is shown.

  • Wedge
    • A wedge is a pie-shaped neighborhood specified by a radius, a starting angle, and an ending angle.
    • The wedge extends counterclockwise from the starting angle to the ending angle. Angles are specified in arithmetic degrees from 0 to 360, where 0 is on the positive x-axis (3:00 on a clock), and can be integer or floating point. Negative angles can be used.
    • The radius is identified in cells or map units, measured perpendicular to the x- or y-axis. When the radius is specified in map units, it is converted to a radius in cell units. The resulting radius in cell units produces an area that most closely represents the area calculated using the original radius in map units. Any cell center encompassed by the wedge will be included in the processing of the neighborhood.
    • The default wedge neighborhood is from 0 to 90 degrees, with a radius of three cells.
    • An example illustration of a wedge neighborhood follows:

    Processing cell with wedge neighborhood
    A processing cell with the default wedge neighborhood (radius = 3 cells, start angle = 0 degrees, end angle = 90 degrees) is shown.

  • Irregular
    • This allows you to specify an irregularly shaped neighborhood around the processing cell.
    • The irregular kernel file specifies the cell positions to be included within the neighborhood.
    • The x,y position for the processing cell within the neighborhood, with respect to the upper left corner of the neighborhood, is determined by the following equations:

      x = (width + 1)/2
      y = (height + 1)/2

      If the input number of cells is even, the x- and y-coordinates are computed using truncation.

    • The following apply to a kernel file for an irregular neighborhood:

      • The irregular kernel file is an ASCII text file that defines the values and shape of an irregular neighborhood. The file can be created with any plain text editor. It must have a .txt file extension and no spaces in the file name.
      • The first line specifies the width and height of the neighborhood (the number of cells in the x direction, followed by a space, and the number of cells in the y direction).
      • The subsequent lines define the value to use for each position in the neighborhood they represent. A space between each value is necessary.
      • The values define whether a position in the neighborhood will be included in the calculation. Typically, the value 1 is used to identify the positions to include in the calculations for an irregular neighbourhood, but any positive or negative value other than 0 can be used. Floating point values can also be used.
      • To exclude a location in the neighborhood from the calculation, use a value of 0 (not a blank space) at the corresponding location in the kernel file.

    • The following example shows the contents of an irregular kernel file and the neighborhood it represents:

    Irregular kernel and the associated neighborhood
    An irregular neighborhood kernel is shown with an illustration of the cells that will be included for processing.

Additional resources

See the following for more information:

Weiss, A. (2001) Topographic Position and Landforms Analysis. Poster Presentation, ESRI User Conference, San Diego, 9-13 July 2001.

De Reu, J., Bourgeois, J., Bats, M., Zwertvaegher, A., Gelorini, V., De Smedt, P., Chu, W., Antrop, M., De Maeyer, P., Finke, P., Van Meirvenne, M., Verniers, J., & Crombé, P. (2013). "Application of the topographic position index to heterogeneous landscapes." Geomorphology, 186, 39–49. https://doi.org/10.1016/j.geomorph.2012.12.015

Related topics