Terrain-RGB ⛰

Mapbox Terrain-RGB (elevation tiles)

Price before paymentbeta
.zip · application/zip

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.

Beta: Beta -- experimental. The result may be incomplete; please tell us if something looks wrong.

OpenStreetMap data as of 26 October 2026 · 14 days ago

Export Terrain-RGB now ✨ Download after signing in to the site · price shown before payment

Key Features

✓Real heights from a global elevation model (Copernicus DEM 30 m / SRTM)
✓Mapbox Terrain-RGB encoding, 0.1 m step
✓ZIP of z/x/y PNG tiles plus metadata.json
✓Up to 256 tiles per order, zoom fitted to the area
Example Terrain-RGB export (city centre, 1x0.5 km)
Example: city centre, ~1×0.5 km, medium detail

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:

💻MapLibre GL 💻Mapbox GL 💻deck.gl 🌎QGIS

Format specifications

Who Uses Terrain-RGB Maps

🏗
3D terrain and hillshading in MapLibre GL / Mapbox GL
3D relief and hillshading in a MapLibre or Mapbox GL web map style from your own tiles.
💻
A self-hosted offline elevation tile set for a web map
Your own elevation tile server with no third-party API or its limits.
📊
Elevation profiles and terrain in a WebGL app without a third-party API
Elevation profiles and terrain in a WebGL app: the height is read straight from the pixel with the formula.

How to Export Terrain-RGB

1
Select area
Draw a rectangle or polygon on the interactive map at osm2cdr
2
Choose Terrain-RGB
Select Mapbox Terrain-RGB (elevation tiles) from the list of 127 available export formats
3
Export
Click Export and download your finished .zip file
4
Download
Download the ready Terrain-RGB file and open it in MapLibre GL

How to Open After Export

Popular maps in Terrain-RGB

Free

Get Mapbox Terrain-RGB (elevation tiles) map exports

Download professional Terrain-RGB maps from OpenStreetMap. Any area, with the price shown before payment.

A map in the format you choose your own area from the builder — priced per map
Export Terrain-RGB now →

Frequently Asked Questions

How do I use it in MapLibre? ▼
How do I read a height from a pixel? ▼
What about areas without data? ▼
Where do the heights come from? ▼
How do I load the tiles in MapLibre? ▼
What happens over the sea or outside coverage? ▼

Related Formats

Related Articles

Open city maps

All cities

Free city map poster — make a minimalist poster of any city