Skip to main content

Mapbox Terrain-RGB v1

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

Elevation data is not improved on a set schedule and is updated when and where it becomes available.

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

Mapbox Terrain-RGB uses multiple data sources depending on the zoom level and location. Different sources often use different vertical datum references, including but not limited to NAVD 88, EGM 96, and Ordnance Datum Newlyn.

Different sources often use different vertical datum references; thus, attempting to normalize Mapbox elevation data to a particular geoid or vertical datum may lead to inaccuracies in data.

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

  • Oct 27, 2016 - Published the tileset.
Was this page helpful?