Skip to content

Documentation / @interstellar-tools/maps / curvatureAt

Function: curvatureAt() ​

ts
function curvatureAt(
  grid: GridInterface,
  row: number,
  column: number
): TerrainCurvatureInterface;

Defined in: terrain/curvature.ts:86

Compute the profile and planform curvature of an elevation grid at a cell: how the terrain bends along the steepest slope and across it.

kprofile=−p2r+2pqs+q2t(p2+q2)(1+p2+q2)3/2,kplanform=−q2r−2pqs+p2t(p2+q2)(1+p2+q2)1/2

with the derivatives from the 3 × 3 neighbourhood, after Zevenbergen & Thorne (1987):

p=z23−z212Δx,q=z12−z322Δy,r=z21−2z22+z23Δx2,t=z12−2z22+z32Δy2,s=z13+z31−z11−z334ΔxΔy

Where:

  • p=∂z/∂x and q=∂z/∂y are the rise per metre east and north (m/m)
  • r=∂2z/∂x2, t=∂2z/∂y2 and s=∂2z/∂x∂y are the second derivatives (1/m)
  • zrc is the height in row r and column c of the neighbourhood, from the north-west: z22 is the cell itself (m)
  • Δx and Δy are the cell size east–west and north–south (m)

Units

  • Input: heights and the cell size in m.
  • Output: profile and planform in 1/m: one over the radius of the bend. 0 is straight.

Notes

  • Profile curvature follows the steepest slope downhill. Positive is convex, like the shoulder of a hill, where the ground gets steeper and flowing material speeds up; negative is concave, like the foot of a slope, where it slows down.
  • Planform curvature is across the slope. Positive is convex, like a ridge or a spur, where flow spreads out; negative is concave, like a hollow or a gully, where it converges.
  • So a dome is positive both ways and a bowl negative both ways: on a sphere of radius R both are ±1/R. Sign conventions differ between GIS tools: check before comparing values.
  • Both are true curvatures of the surface, from the formulas in Florinsky (2016), where planform is his horizontal curvature. Zevenbergen & Thorne's own formulas leave out the (1+p2+q2) terms, which only matters on steep ground. Planform is not the curvature of the contour line, which is larger by 1/sin⁡(slope) and grows without bound on gentle slopes.
  • The fitted surface passes through the cell and its four direct neighbours, so the gradient here is a plain central difference, not gradientAt's smoothed one.
  • Level ground has no downslope direction, so both are NaN, unless the neighbourhood is flat too and both are 0. Also NaN on the grid's edge and next to a missing cell.

Parameters ​

ParameterTypeDescription
gridGridInterfaceElevation grid, heights in m.
rownumberRow index, 0 at the north edge (an integer in [0, rows)).
columnnumberColumn index, 0 at the west edge (an integer in [0, columns)).

Returns ​

TerrainCurvatureInterface

The curvature { profile, planform } in 1/m, NaN where it can't be computed.

Throws ​

If row or column is not an integer inside the grid.

Example ​

ts
// A ridge running north–south, falling 1 m every 10 m to the north
const grid = createGrid({
  rows: 3,
  columns: 3,
  values: [98.5, 99, 98.5, 99.5, 100, 99.5, 100.5, 101, 100.5],
  cellSize: { x: 10, y: 10 }
});

curvatureAt(grid, 1, 1); // { profile: 0, planform: ≈ 0.00995 }: a 100 m radius across

See ​