Rasterarray Recipe
Current version: 1
A rasterarray recipe is a JSON document containing configuration options that tell Raster MTS how to turn raster source data into Mapbox Raster Tiles (MRT).
Recipes must be constructed according to the rules in this recipe reference.
Recipe top-level fields
A recipe is a JSON object that must contain the following top-level fields:
Required fields | Description | Data type |
---|---|---|
version | The version of the Mapbox Tiling Service recipe reference that the recipe uses. | Integer |
type | Key to show this as a Raster MTS recipe | "rasterarray" |
sources | List of input source files | List<SourceObject> |
layers | The names of the layers and their configuration options. | Object<String, LayerObject> |
Optional fields | Description | Data type |
---|---|---|
minzoom | The lowest zoom level for the tileset. For more information about this option, see the Zoom Levels section. | Integer |
maxzoom | The highest zoom level for the tileset. For more information about this option, see the Zoom Levels section. | Integer |
{
"version": 1,
"type":"rasterarray",
"sources":[{"uri":"mapbox://tileset-source/{ACCOUNT}/{SOURCE_NAME}"}],
"minzoom":0,
"maxzoom":6,
"layers": { layername: LayerObject, ... }
}
Recipe version
The recipe version
indicates the version of the Raster MTS recipe reference that the recipe uses. The current version is 1
. Using any version
other than the current version or a previous version will result in an error.
Sources
The recipe sources
object is a list of sources used to generate a tileset. This list must contain at least a single source.
Source configuration
Required fields | Description | Data type |
---|---|---|
uri | The URI of the source uploaded into Mapbox. Sources are always prefixed with the mapbox:// protocol. | String |
Optional source configuration
Optional fields | Description | Data type |
---|---|---|
crs | The EPSG coordinate system code of the source file. This is an optional field and only necessary if the source file is missing a CRS. This will override the source file's CRS if passed in and the source file already contains a CRS. | String |
Zoom Levels
The minzoom
and maxzoom
fields are optional and define the zoom levels at which the tileset is available. The minzoom
field is the lowest zoom level at which the tileset is available, and the maxzoom
field is the highest zoom level at which the tileset is available. maxzoom
must be greater than or equal to minzoom
.
Optional behavior
If minzoom
and maxzoom
are not provided, appropriate zoom levels will be calculated based on the tilesize
and pixel resolution of the source data.
Layers
The recipe layers
object contains key-value pairs associating the names of tile layers with their configuration. For each key-value pair, the key is the name of the layer, and the value is a LayerObject
containing the configuration and options for the layer.
Each layer must have a name (for example "temperature"
, "precipitation"
, or "cloud"
in the example below). This is the unique identifier for the layer of data in your final tileset. In any tileset, each layer name must be unique. The layer name must be a string with only underscores (_
) and alphanumeric characters.
The corresponding LayerObject
for each layer name describes how that MRTs should be created.