dem_tpi — DEM surface op

• Data kinds: depth → image2d

• Call: import fullseye as fs; fs.ledger.dem_tpi(dem, cell_size=1.0) (to call the implementation directly, import demops; demops.dem_tpi(dem, cell_size=1.0); from the registry, opsdem.get("dem_tpi"))

Usage

Topographic position index TPI — the difference between the cell itself and the mean of its 8 neighbors [m]. Positive means ridge, negative means valley.

Formula: tpi = z - mean(z of the 8 neighbours) (Weiss's TPI taken with the minimal 3x3 neighbourhood). Edges are padded by replicating border values. Since the neighbourhood is fixed at 1 cell, the scale is fixed at 1 cell_size; to see broader ridges/valleys, first coarsen dem (this op has no radius argument).

• dem: (H, W) [m], 3x3 or larger, real, no inf. Missing data as nan (rejected if sentinel values <= -9000 are present without nan). nan propagates over 3x3.

• cell_size: does not affect the result (no distance enters the difference), but is accepted to make the caller aware that the unit is [m], and is checked to be positive finite.

• Return value: (H, W) float64 [m]. Near 0 is mid-slope, positive is convex (ridges, peaks), negative is concave (valleys, hollows).

• Failure: ValueError (shape, sentinel values, cell_size).

Combined with dem_roughness (RMS over the same neighbourhood) it gives features for landform classification.

Detailed usage guide

• dem_terrain_analysis family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• dem_terrain_analysis_tour — py -3.11 examples/dem_terrain_analysis_tour.py

Ops the type connects to (they accept image2d as input)

—

Same category (surface)

dem_slope · dem_aspect · dem_curvature · dem_roughness


*Provenance: demops.py — DEM operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.