All docsTilesetsReferenceMapbox Terrain-RGB v1

Mapbox Terrain-RGB v1

Source id:
mapbox.terrain-rgb

This tileset reference document includes information to help you use the data in the Mapbox Terrain-RGB v1 tileset.

Optimized version available

See the Mapbox Terrain-DEM raster tileset for an updated and optimized version of this tileset.

Overview

Mapbox Terrain-RGB is a Mapbox-provided raster tileset contains global elevation data encoded in raster PNG tiles as color values that can be decoded to raw heights in meters.

You can use Terrain-RGB for a wide variety of applications, both visual and analytical, from styling terrain slope and hillshades to generating 3D terrain meshes for video games.

Data sources and updates

If you notice an area where elevation data needs improvement or updates for any reason, contact our team at imagery@mapbox.com. Elevation data is not improved on a set schedule and is updated when and where it becomes available. To recommend an elevation data source, mention it in your request.

Data updates

As of December 1, 2021, elevation data updates will not be applied to the Mapbox Terrain-RGB tileset. Data updates will be applied to the Mapbox Terrain-DEM tileset, which is an optimized version of Mapbox Terrain-RGB.

Attribution

When using this tileset publicly in a design or application you must provide proper attribution.

Terrain-RGB tiles

The Mapbox Terrain-DEM tileset contains Terrain-RGB tiles. Terrain-RGB tiles include elevation data that is encoded using each color channel as a position in a base-256 numbering system. This approach allows for 16,777,216 unique values which can be mapped to 0.1 meter height increments, enabling vertical precision necessary for cartographic and 3D applications.

To learn how to retrieve a Terrain-RGB tile and decode elevation data from its RGB values, see our Access elevation data guide.

Layer Reference

This tileset contains one layer with raster data.

  • Data up to zoom 15. The data is encoded to the equivalent of zoom 15 at 256 tile resolution (and zoom 14 for 512 tiles). Any higher zoom levels will not increase the resolution of the data loaded by your application.
  • 0.1 meter height increments. Elevation data is mapped to 0.1 meter height increments, which gives it the vertical precision necessary for cartographic and 3D applications.

Elevation data

The Mapbox Terrain-RGB tileset contains elevation data encoded using each color channel as a position in a base-256 numbering system, allowing for 16,777,216 unique values. We’ve mapped these to 0.1 meter height increments, which gives us the vertical precision necessary for cartographic and 3D applications.

You can use this Raster Tiles API endpoint with your Mapbox access token to get Terrain-RGB tiles:

https://api.mapbox.com/v4/mapbox.terrain-rgb/{zoom}/{x}/{y}.pngraw?access_token=YOUR_MAPBOX_ACCESS_TOKEN

Then use this equation to decode pixel values to height values:

height = -10000 + ((R * 256 * 256 + G * 256 + B) * 0.1)

For more detailed instructions, see the Access elevation data guide.

Changelog