Skip to main content

Module mapbox

Module mapbox 

Source
Expand description

Mapbox “Terrain-RGB” elevation tile encoding.

Formula: elevation = -10000 + (R * 65536 + G * 256 + B) * 0.1 (metres).

Reference: https://docs.mapbox.com/data/tilesets/reference/mapbox-terrain-rgb-v1/

Functions§

decode
Decode RGB bytes into a freshly allocated Vec<f32>.
decode_into
Decode RGB bytes into a caller-owned f32 buffer (no allocation).
decode_pixel
Decode a single Mapbox Terrain-RGB (R, G, B) pixel into elevation (metres).
encode
Encode elevations into a freshly allocated Vec<u8>.
encode_into
Encode elevations into a caller-owned RGB buffer (no allocation).
encode_pixel
Encode a single elevation sample (metres) into Mapbox (R, G, B).
encode_to
Stream-encode elevations to a writer.