Tilesets
Tiles by tileset ID, plus the raster-array and vector-tile lookup that keys
off one: raster from the Raster Tiles API, vector from the Vector Tiles
API, MRT tiles from a raster-array job, and query from the Tilequery
API. The three tile commands answer with bytes, so --output doesn't
apply on them — redirect to a file; query returns GeoJSON. Not to be
confused with mapbox tilesets-cli, which
forwards to a separately installed program. Every command also takes the
common flags — --username/-u, --token/-t, --profile, --id —
described in Shared parameters.
mapbox tilesets get-tile
One raster tile at standard resolution, 256×256.
Parameters:
| Parameter | Description |
|---|---|
<tilesets> | Tileset ID(s) in the format username.id, such as mapbox.satellite. Up to 15, comma-separated, composite into one tile: the first is the bottom layer, each one after it layers on top. Raster and vector tilesets both work. |
<z> | Zoom level (0-22) |
<x> | Tile column (x coordinate) |
<y> | Tile row (y coordinate) |
<format> | Image format for the tile. Values: png, pngraw, jpg, jpeg, webp. |
<quality> | Compression quality. png takes 32, 64, 128, 256 or raw; jpg, jpeg and webp take 70, 80 or 90. Pass "" for the format's default. |
<quality> isn't a separate URL segment — it's appended directly onto
<format>, so jpg 70 requests .jpg70 from the API. Save the response
under a real image extension regardless of what the request path spells.
Examples:
mapbox tilesets get-tile mapbox.satellite 2 1 1 png "" > tile.png
mapbox tilesets get-tile mapbox.satellite 12 2048 1361 jpg 70 > tile.jpg
mapbox tilesets get-mvt
One vector tile from one or more Mapbox-hosted tilesets.
Parameters:
| Parameter | Description |
|---|---|
<tileset-id> | Tileset ID(s) in the format username.id, such as mapbox.mapbox-streets-v8. Up to 15, comma-separated, merge their layers into a single tile. |
<zoom> | Zoom level per the Slippy Map Tilenames specification. Valid range is 0–30, though tile availability depends on the tileset's configured zoom range. |
<x> | Tile column (x coordinate) per the Slippy Map Tilenames specification. |
<y> | Tile row (y coordinate) per the Slippy Map Tilenames specification. |
<format> | Vector tile format. The two names hold the same bytes, a Mapbox Vector Tile. Values: mvt, vector.pbf. |
--style | Style ID and timestamp for a style-optimized tile, in the format <style_id>@<timestamp> — for example mapbox://styles/mapbox/streets-v12@00. |
Examples:
mapbox tilesets get-mvt mapbox.mapbox-streets-v8 12 2048 1361 mvt > tile.mvt
mapbox tilesets get-mvt mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2 \
12 2048 1361 mvt > composite.mvt
mapbox tilesets get-mrt
One MRT tile from a raster-array job.
Parameters:
| Parameter | Description |
|---|---|
<tilesets-id> | The map id (tileset) to get tiles from - username.id format |
<z> | The z value of the tile request |
<x> | The x value of the tile request |
<y> | The y value of the tile request |
--jobid | Required. The identifier of the raster-array job that produced the tiles. |
Examples:
mapbox tilesets get-mrt --jobid <jobid> <tileset-id> 12 2048 1361 > tile.mrt
mapbox tilesets query
What features a vector tileset has at or near a point.
Parameters:
| Parameter | Description |
|---|---|
<tilesets> | Comma-separated tileset ids in the form {owner}.{tileset}. |
<lon> | Longitude in degrees (range -180 to 180). |
<lat> | Latitude in degrees (range -85.0511 to 85.0511). |
--radius | Search radius in meters. Must be a positive number. |
--limit | Max number of vector features to return (1-50). Ignored for rasterarray tilesets. |
--geometry | Limit results to features of this geometry type. Values: polygon, linestring, point. |
--layers | Comma-separated list of layer names to include. Required for rasterarray queries to return data; if omitted, rasterarray responses are empty. |
--bands | Comma-separated list of rasterarray band names to include. |
--dedupe | Drop duplicate features, matched by layer and geometry (vector only). |
--language | Language tag (BCP-47, vector only), as in geocoding. Comma-separated list accepted. |
--worldview | ISO 3166-1 alpha-2 worldview (vector only). Comma-separated list accepted. |
Examples:
mapbox tilesets query \
mapbox.mapbox-streets-v8 24.94 60.16 --limit 2