Uploading custom data to Mapbox Studio will convert the data file into vector tiles. Vector tiles can be used in any Mapbox Studio style and filtered or styled as is into your map.
There are multiple ways to upload custom data into Mapbox Studio:
As new layer in the Mapbox Studio style editor
From your Data page on Mapbox Studio
Using the Mapbox Uploads API
Upload data as a new layer
In the Mapbox Studio style editor, click New layer on the top left.
Next, click Select a tileset and you will see an Upload data button and a list of the vector and raster tile tilesets in your Mapbox account. Click Upload data and navigate to your tileset on your local machine.
From here, you can continue by setting data filters and adding style rules to the layer.
Upload data from your Tilesets page
On your Tilesets page, click New tileset at the top and navigate to your tileset on your local machine.
Once you Select a tileset and press the Upload button, the process will begin and an uploads pane will appear in the lower left corner of the page. This pane shows the status of your upload, you will see your map ID, with a blue dot as the file is Processing.
Once the file has successfully uploaded, the circle will turn green with the message Succeeded. Click the map ID to view the details of your tileset on a new page.
From this page, you can add the tileset to any style.
For more information about uploading data to your Mapbox account, see the Uploads page.
The Mapbox Uploads API
If you are familiar with using the command line, you can upload your data with the Mapbox Uploads API. It’s the best method if you plan to automate your uploads.
Note that the Mapbox Uploads API requires a secret access token with the uploads:write scope enabled.
The basic format is:
mapbox-upload <tileset> [<filepath> | <url>]
It’s a good idea to save this script as a bash file, .sh which you can run and easily automate for your workflow.
## Install mapbox-upload (if you have ignore)
npm install --global mapbox-upload
# export MapboxAccessToken=<access token with uploads:write scope enabled>export MapboxAccessToken=$TOKEN# uploader CLI format: mapbox-upload username.dataid /path/to/file
mapbox-upload mslee.minorislands minor_islands.mbtiles