Function decodeTerrainRgbElevation

  • Decodes a single Mapbox Terrain-RGB pixel into metres above sea level.

    height = -10000 + ((R * 256 * 256 + G * 256 + B) * 0.1)

    Channel values are clamped to the 0–255 byte range, so callers may pass raw ImageData/Uint8ClampedArray samples directly.

    Parameters

    • red: number
    • green: number
    • blue: number

    Returns number