> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/data/tilesets/llms.txt)

# Mapbox Terrain-RGB v1

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

> **Note (warning): Optimized version available**
> 
> See the [Mapbox Terrain-DEM](https://docs.mapbox.com/data/tilesets/reference/mapbox-terrain-dem-v1/) 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.

### Access this Tileset

Use this **Tileset URL** to add this tileset to your map style as a `raster` source:

```text
mapbox://mapbox.terrain-rgb
```

Access this tileset's [TileJSON](https://docs.mapbox.com/help/glossary/tilejson/):

```text
https://api.mapbox.com/v4/mapbox.terrain-rgb.json?access_token=YOUR_MAPBOX_ACCESS_TOKEN
```

Access tiles from this tileset via the [Raster Tiles API](https://docs.mapbox.com/api/maps/raster-tiles/) using the following template:

```text
https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.{format}?access_token=YOUR_MAPBOX_ACCESS_TOKEN
```

Query this tileset at a specific location using the [Tilequery API](https://docs.mapbox.com/api/maps/tilequery/):

```text
https://api.mapbox.com/v4/mapbox.terrain-rgb/tilequery/{longitude},{latitude}.json?access_token=YOUR_MAPBOX_ACCESS_TOKEN
```

### Data sources and updates

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

> **Note (warning): 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](https://docs.mapbox.com/data/tilesets/reference/mapbox-terrain-dem-v1/) 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](https://docs.mapbox.com/help/dive-deeper/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](https://docs.mapbox.com/data/tilesets/guides/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`](https://en.wikipedia.org/wiki/North_American_Vertical_Datum_of_1988), [`EGM 96`](https://en.wikipedia.org/wiki/Earth_Gravitational_Model#EGM96), and [`Ordnance Datum Newlyn`](https://en.wikipedia.org/wiki/Ordnance_datum#Ordnance_Datum_Newlyn_and_its_antecedents).

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](https://docs.mapbox.com/api/maps/raster-tiles/) with your Mapbox [access token](https://docs.mapbox.com/help/glossary/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](https://docs.mapbox.com/data/tilesets/guides/access-elevation-data/) guide.

## Changelog

-   Oct 27, 2016 - Published the tileset.