Skip to main content

Module terrain_processing

Module terrain_processing 

Source
Expand description

Terrain processing and analysis algorithms.

This module provides a comprehensive suite of Digital Elevation Model (DEM) analysis tools, including:

  • Slope and aspect computation (Horn’s method)
  • Curvature analysis: profile, planform, and tangential curvature
  • Flow direction algorithms: D8 and D-infinity (Tarboton 1997)
  • Flow accumulation and watershed delineation
  • Stream network extraction
  • Terrain Roughness Index (TRI — Riley et al. 1999)
  • Terrain Position Index (TPI — Weiss 2001)
  • Topographic Wetness Index (TWI — Beven & Kirkby 1979)
  • Viewshed analysis (line-of-sight)
  • Slope stability index (infinite slope model)
  • Solar irradiance on terrain (incidence angle, terrain shading)

Structs§

Contour
A single contour polyline at a given elevation.
Dem
A regular-grid Digital Elevation Model.
Observer
Observer specification for viewshed analysis.
SlopeStabilityParams
Parameters for the infinite-slope stability model.
SolarPosition
Solar position in the sky.

Enums§

CurvatureKind
Curvature type selector.
LandformClass
Landform classification based on TPI and slope.
RidgeValley
Classify each cell as ridge, valley, or neither.

Constants§

D8_OFFSETS
Neighbour offsets and D8 codes for the eight cardinal/diagonal directions.

Functions§

classify_landform
Classify landform type using a dual-scale TPI approach (Weiss 2001).
compute_aspect
Terrain aspect in radians at every grid cell.
compute_curvature
Compute terrain curvature (units: 1/m) for every grid cell.
compute_slope
Terrain slope in radians at every grid cell.
compute_viewshed
Compute binary viewshed for a single observer.
cos_incidence
Compute the cosine of incidence angle between the sun and the terrain surface.
cumulative_viewshed
Cumulative viewshed: number of observers that can see each cell.
delineate_watershed
Delineate the watershed (contributing area) upstream of an outlet cell.
extract_contours
Extract contour lines at the specified elevation levels.
extract_streams
Extract stream network by thresholding flow accumulation.
fill_sinks
Fill sinks in a DEM using a simple iterative raising algorithm.
flow_accumulation_d8
Compute D8 flow accumulation (number of upstream cells draining into each cell).
flow_direction_d8
Compute D8 flow direction for every grid cell.
flow_direction_dinf
D-infinity flow direction (Tarboton 1997).
hypsometric_curve
Compute the hypsometric curve for a DEM.
hypsometric_integral
Hypsometric integral — area under the hypsometric curve.
normalise_raster
Normalise a raster to the range [0, 1].
raster_stats
Compute basic statistics of a raster field.
resample_dem
Resample a DEM to a coarser grid using bilinear interpolation.
ridge_valley_lines
Simple ridge and valley detection based on profile curvature sign.
slope_stability_index
Compute the Factor of Safety (FS) for every grid cell.
strahler_order
Strahler stream order for every stream cell.
terrain_position_index
Terrain Position Index (Weiss 2001).
terrain_roughness_index
Terrain Roughness Index (Riley et al. 1999).
terrain_solar_irradiance
Compute global horizontal irradiance (GHI) on every terrain cell.
topographic_wetness_index
Topographic Wetness Index (Beven & Kirkby 1979).

Type Aliases§

D8Code
D8 flow direction codes.