xrspatial.terrain_metrics.landforms#

xrspatial.terrain_metrics.landforms(agg: DataArray, inner_radius: int = 3, outer_radius: int = 15, slope_threshold: float = 5.0, name: str | None = 'landforms') DataArray[source]#

Classify terrain into landform types using the Weiss (2001) scheme.

Computes TPI at two neighborhood scales, standardizes to z-scores, and classifies each cell into one of 10 landform categories based on its relative position at both scales and its slope.

Parameters:
  • agg (xarray.DataArray or xr.Dataset) – 2D NumPy, CuPy, NumPy-backed Dask, or CuPy-backed Dask xarray DataArray of elevation values. If a Dataset is passed, the operation is applied to each data variable independently.

  • inner_radius (int, default=3) – Radius in cells for the small-scale TPI neighborhood.

  • outer_radius (int, default=15) – Radius in cells for the large-scale TPI neighborhood.

  • slope_threshold (float, default=5.0) – Slope in degrees separating plains (class 5) from open slopes (class 6).

  • name (str, default='landforms') – Name of the output DataArray.

Returns:

Integer-coded raster of landform classes:

1

Canyon / deeply incised stream

2

Midslope drainage / shallow valley

3

Upland drainage / headwater

4

U-shaped valley

5

Plain

6

Open slope

7

Upper slope / mesa

8

Local ridge / hill in valley

9

Midslope ridge / small hill

10

Mountain top / high ridge

Return type:

xarray.DataArray or xr.Dataset

Raises:

MemoryError – If inner_radius or outer_radius would require a kernel larger than half of the available memory.

References

Weiss, A. (2001). Topographic Position and Landforms Analysis. Poster presentation, ESRI International User Conference, San Diego, CA.