Mapbox Terrain v2
This tileset reference document includes information to help you use the data in the Mapbox Terrain v2 tileset.
Overview
Mapbox Terrain is a Mapbox-provided vector tileset that includes features like hillshades, topographical elevation contours, and landcover data, all in vector format.
Some specifics about Mapbox Terrain:
-
10 meter height increments. Data is mapped to 10 meter height increments.
-
Index field can be used to highlight index contour lines or control the density of contours on the map.
Data sources
Mapbox Terrain is comprised of a wide variety of data sources from government-provided datasets as well as third-party commercial data. To learn more about the datasets in the Mapbox Terrain tileset, visit our mapping platform page.
Attribution
When using the Mapbox Terrain layer publicly in a design or application you must provide proper attribution.
Layer reference
A geometry in the vector tile can be one of 3 types:
#landcover
The landcover layer provides a generalized backdrop of vegetation, agriculture, and permanent ice & snow. It is intended for stylistic use and not appropriate for science or other analysis. Empty space in the landcover layer is either water or bare earth, rock, sand, and built-up areas.
Classes
The class
field is used for styling different types of landcover. The classes are designed to look good when there is a smooth color gradient across from wood → scrub → grass → crop → map background → snow. Thin strips of "grass" or "crop" along the edge of a wooded area might not necessarily represent actual grass or cropland, but are there to smooth the transition from wood to bare land.
Value | Description |
---|---|
'wood' | The area is mostly wooded or forest-like. |
'scrub' | The area is either mostly bushy or a mix of wooded and grassy |
'grass' | The area is mostly grassy. |
'crop' | The area is mostly agricultural, or thin/patchy grass |
'snow' | The area is mostly permanent ice, glacier or snow |
#hillshade
The hillshade layer contains polygons that when styled appropriately display shaded relief of hills. The lighting direction is not realistic, but from the north-west (as is traditional in shaded relief).
At zoom levels above 14 you may want to blur, fade, or completely hide the hillshade layer as the resolution of the data is not enough to hold up at the largest scales.
Classes
The class
field is for styling of the different levels of light and shadow. With low polygon-opacity
or certain polygon-comp-op
settings, you can style all 6 brightness levels with 2 filters.
Value | Description |
---|---|
'shadow' | These should be styled darker than the background color. |
'highlight' | These should be styled lighter than the background color. |
Levels
The level
field allows for more granular styling of the different levels of light and shadow. The numbers represent the brightness threshold percentages that were used to generate the hillshading polygons.
Value | Description |
---|---|
94 | The brightest highlights |
90 | Medium highlights |
89 | Areas of faint shadow |
78 | Areas of medium shadow |
67 | Areas of dark shadow |
56 | Areas of extreme shadow |
#contour
Contour lines show vertical dimension on a region by joining points of equal elevation. Full contour line coverage begins at zoom 12, while index lines are available at zoom 9 + in values specified below.
Elevation
The ele
field stores the elevation of each contour line in meters and can be used for labeling or filtering. Ideally the values range from -410
near the shore of the Dead Sea to 8840
near the peak of Mt Everest, but due to bugs and inconsistencies values outside this range may exist.
Zoom level | Contour Interval |
---|---|
9 | 500 meters |
10 | 200 meters |
11 | 100 meters |
12 | 50 meters |
13 | 20 meters |
14+ | 10 meters |
Index lines
The index
field can be used to emphasize index contours, but it can also be used to reduce the contour density if you wish. The highest value that applies to a contour will be the index
value, so if you want to highlight every fifth line, you need to select both index=5
and index=10
. If you want to highlight every other line, you need to select both index=2
and index=10
(or both index=1
and index=5
).
Value | Description |
---|---|
-1 | Sea level coastline |
1 | Every first line |
2 | Every second line |
5 | Every fifth line |
10 | Every 10th line |
Changelog
A summary of the changes from v1:
- Various elevation data improvements and updates (notably over most of Europe and Africa)
class
field in the #hillshade layer simplified to 2 classes:highlight
,shadow
level
field added to the #hillshade layer for more granular styling- Coastlines have an
index
value of-1
in the #contour layer