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
f32buffer (no allocation). - decode_
pixel - Decode a single Mapbox Terrain-RGB
(R, G, B)pixel into elevation (metres). - encode
- Encode
elevationsinto a freshly allocatedVec<u8>. - encode_
into - Encode
elevationsinto a caller-owned RGB buffer (no allocation). - encode_
pixel - Encode a single elevation sample (metres) into Mapbox
(R, G, B). - encode_
to - Stream-encode
elevationsto a writer.