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 a flat
width × height × 3RGB buffer back to elevations. - decode_
pixel - Decode a single Mapbox Terrain-RGB
(R, G, B)pixel into elevation (metres). - encode
- Encode
elevations(metres) into a flatwidth × height × 3RGB buffer. - encode_
pixel - Encode a single elevation sample (metres) into Mapbox
(R, G, B).