Terrain-RGB is the Mapbox/MapLibre elevation tile format: each pixel's colour encodes the real height in metres as height = -10000 + (R·256² + G·256 + B)·0.1. Heights come from a global elevation model (Copernicus DEM 30 m, SRTM where it is missing). You get a ZIP of z/x/y PNG tiles plus metadata.json; up to 256 tiles per order, the zoom is picked to fit your area. Load it in MapLibre GL as a raster-dem source with encoding: "mapbox" for 3D terrain and hillshading. Where there is no elevation data (open sea) a pixel is 0 m. Accuracy is that of the source model: visualisation and pre-design, not surveying.
OpenStreetMap data as of 26 October 2026 · 14 days ago
Key Features

About Terrain-RGB Format
Terrain-RGB is a way to pack elevation into an ordinary PNG: Mapbox encodes meters into the R, G and B channels with the formula height = -10000 + ((R × 256² + G × 256 + B) × 0.1). MapLibre and Mapbox GL read such tiles and build relief and three-dimensional terrain from them right in the browser.
On osm2cdr the heights do not come from OpenStreetMap — OSM has none — but from the global Copernicus DEM elevation model at 30 m (SRTM where it is missing). The service clips the model to your area, reprojects it to Web Mercator and encodes every pixel's height separately in 0.1 m steps. If the whole area has no heights, such as open sea, the order is refused honestly instead of shipping flat tiles.
You get a ZIP: PNG tiles in z/x/y folders plus a metadata.json with the zoom, area, formula and the source model name. One order holds up to 256 tiles and the zoom is fitted to the area. Pixels outside the model's coverage encode 0 m. Accuracy is that of the source model: visualisation and pre-design, not surveying.
What Program Opens Terrain-RGB Files
The following programs and applications can open, edit, and work with Mapbox Terrain-RGB (elevation tiles) (.zip) files exported from OSM2CDR:
Format specifications
- Open standard
- 3D coordinates supported
- Lossless (no quality loss)
- No attributes
- Output: 256 files in archive
- Mapbox Terrain-RGB tile set. Elevation encoded in RGB pixels: height = -10000 + ((R*256² + G*256 + B) * 0.1).
Who Uses Terrain-RGB Maps
How to Export Terrain-RGB
How to Open After Export
- MapLibre GL — unpack the archive on your server, add it as a raster-dem source with encoding: "mapbox" and call map.setTerrain — the relief appears in the style.
- Mapbox GL and deck.gl — the same set works as a terrain source or a TerrainLayer with the same decoding formula.
- rio-mbtiles or mb-util — pack the z/x/y folder into a single MBTiles if your tile server prefers one file.
- QGIS — open a single tile as a raster and decode the height with the raster calculator: -10000 + (R·65536 + G·256 + B)·0.1.
Popular maps in Terrain-RGB
Get Mapbox Terrain-RGB (elevation tiles) map exports
Download professional Terrain-RGB maps from OpenStreetMap. Any area, with the price shown before payment.