Create new data
Datasets and tilesets are two different formats that you can create when uploading data to your Mapbox account. Datasets are editable and tilesets are styleable.
A dataset is an editable collection of GeoJSON features. Datasets provide access to feature geometries (points, lines, and polygons) and properties (attributes).
Consider using a dataset if you are working with less complex data that needs to be updated often. It is important to note that once your dataset has been created, it will need to be published into a tileset before you can add it to a style in the Mapbox Studio style editor. With datasets, you can continue to make changes to your data as needed, publish each update to the connected tileset, and see those changes reflected in any styles that contain that tileset.
Unlike tilesets, datasets can be edited on a feature-by-feature basis. Datasets cannot be used directly in a Mapbox Studio style, but can be exported as a tileset or rendered with Mapbox GL JS. Any dataset exported to a tileset can be added as a layer in the Mapbox Studio style editor. To see a diagram of that workflow, see the sample workflow section of the Mapbox Studio Manual.
Mapbox stores dataset features as collections of GeoJSON features. Features are individual (or in some cases groups of) points, lines, or polygons. The Mapbox Datasets API does not support GeometryCollections or null geometries. Each feature is defined by its geometry and properties:
- Geometry: This describes the shape and the location of each feature. You can specify Points, LineStrings, Polygons. The location and the exact shape of each feature is determined by the coordinates that are specified.
- Properties: This can contain any JSON object. Some examples of common properties that are applied to Mapbox datasets include
descriptionto include in popups in a web application.
Datasets can be uploaded to Mapbox using the following formats:
|CSV||5 MB transfer limit|
|GeoJSON||5 MB transfer limit|
Mapbox Studio dataset editor
Use the dataset editor to create and manage your data
In this example, you can see a visual representation of a dataset inside the Mapbox Studio dataset editor on the left and the actual contents of the dataset, a GeoJSON FeatureCollection, on the right. The contents of the dataset include geometry and properties for each point that you can see on the left, but does not contain any style information. For more details on how to style the points (for example, specify the symbols, colors, and the font for labels), see the Upload data guide, which covers converting datasets to tilesets.
Once you’ve created a dataset, you can export it to a tileset for use in a Mapbox map (see the How map design works guide for more information), download it as a GeoJSON FeatureCollection, or access it with the Mapbox Datasets API. Datasets can still be edited after export, but you will need to make sure to sync your downloaded version with your new edits if you would like your local copy to reflect any changes you've made.
To learn how to download and export datasets, see the manage datasets section of the Mapbox Studio Manual.
You cannot add datasets directly to styles in the Mapbox Studio style editor. But you can export your dataset as a tileset and add it to your style in the Mapbox Studio style editor or Mapbox GL JS. When you export your dataset to a tileset, it is processed in the same way an upload would be processed.
To learn how to convert a dataset to a tileset using the Mapbox Studio dataset editor, see the dataset editor section of the Mapbox Studio Manual.
Tilesets are lightweight collections of map data that are optimized for rendering and are not editable but can be styled in the Mapbox Studio style editor.
Consider uploading your data as a tileset if your data is large and doesn't need to be updated often.
If you created a vector tileset by uploading geospatial data that contains attributes, the resulting vector tileset will inherit the attributes contained in your raw data source. Here are a few examples of what you can do with the attributes belonging to features in a vector tileset:
- Use Mapbox Studio to customize the color of a state based on its population density.
- Use the Mapbox Maps SDK for iOS to dynamically style trees based on an
- Use Mapbox GL JS to highlight counties share a similar name.
When you upload data as a tileset or export a dataset as a tileset, Mapbox breaks it up into a uniform grid of square tiles at preset zoom levels. It must undergo many processing steps to load quickly and be lightweight.
When you use either the Uploads API or Mapbox Studio (which uses the Uploads API behind the scenes) to turn data into a tileset, two things happen:
- Simplification: The Mapbox Uploads API analyzes your data for complexity and automatically removes unnecessary vertices at variable rates depending on zoom level. This process is called simplification, and it helps make sure your maps load quickly, especially at lower zoom levels where additional complexity would not be visible.
- Determining the zoom extent. The Mapbox Uploads API keeps your tilesets light by examining your data's extent (the geographic area covered by your data) and complexity and only creates vector tiles for zoom levels that are likely to be required — a zoom extent is defined. For datasets with small zoom extents or complex features, this usually means low zoom levels (zoomed out) will be discarded. For large features that are not complex, this usually means higher zoom levels (zoomed in) will be discarded. If you need your tileset to be visible at a different zoom extent, you can adjust this manually, but it is important to note the following:
- Minimum zoom levels can be increased, but not decreased past the assigned minimum zoom level.
- Maximum zoom levels can be decreased and increased, since data can be overzoomed and visualized to zoom 22.
If you use Mapbox Tiling Service to turn data into a tileset, you will set the simplification level and the zoom extent in the tileset recipe.
You can create tilesets by uploading data in any of the following formats:
|CSV||1 GB transfer limit (300 MB if uploaded with Studio)|
|GeoJSON||1 GB transfer limit (300 MB if uploaded with Studio)|
|MBTiles||25 GB transfer limit (300 MB if uploaded with Studio)|
|KML||260 MB with 15 or fewer layers|
|Shapefile||260 MB (combined uncompressed size of .shp and .dbf files). You must upload Shapefiles as a compressed (.zip) file.|
Tilesets can be created with raster or vector data.
If you upload raster data (such as a GeoTIFF), the resulting raster tilesets will only contain raster data, a pixel-based data format that all digital photographs conform to.
If you upload vector data, this will create a vector tileset containing vector data, which consists of mathematically calculated points, lines, and polygons as coordinate pairs. Mapbox GL takes advantage of vector tilesets by calculating and rendering vector data directly in your browser.