wasm-spatial-core
    Preparing search index...

    Function hillshade

    • Compute hillshade illumination for a terrain grid.

      Implements the standard hillshade algorithm used in GIS:

      1. Compute terrain gradient (dz/dx, dz/dy)
      2. Calculate illumination angle from azimuth + altitude
      3. Shade = max((cos(zenith) * cos(slope) + sin(zenith) * sin(slope) * cos(azimuth - aspect)), 0)

      Arguments

      • heights: Float32Array elevation grid (row-major)
      • width: Grid width (columns)
      • height: Grid height (rows)
      • azimuth_deg: Light azimuth in degrees (0 = North, 90 = East)
      • altitude_deg: Light altitude/elevation in degrees (90 = directly above)

      Returns

      Uint8Array of illumination values (0 = shadow, 255 = full light).

      Parameters

      • heights: Float32Array
      • width: number
      • height: number
      • azimuth_deg: number
      • altitude_deg: number

      Returns Uint8Array