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.
- Slope
Stability Params - Parameters for the infinite-slope stability model.
- Solar
Position - Solar position in the sky.
Enums§
- Curvature
Kind - Curvature type selector.
- Landform
Class - Landform classification based on TPI and slope.
- Ridge
Valley - 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.