Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tool lets you easily create or update vector tilesets on Mapbox from your CSV files using command line. It can be especially handy if you need to periodically update some vector tileset (e.g. every day updates). It is alternative for Mapbox Studio where you can do almost same things manually. Under the hood the tool is using Mapbox Python API, ogr2ogr and tippecanoe utilites. Just pass your CSV file with WKT geometries, specify some parameters and you are done. 

...

namemandatoryexampledescription
input_pkey_columnyesinput_pkey_column: idName of the primary key column
input_geom_columnyes
input_geom_column: wkt
name Name of geometry column
tileset_map_idno
tileset_map_id: cleveranalytics.14j1fhp2
Mapbox tilesetmapid. If not specified than random value is generated by Mapbox. Specify in case of updating an existing tileset.
tileset_nameno
tileset_name: countries_wkt-02ssft
Mapbox tilesetname. If not than specified than tilesetname is generated as combination of input file name and random hash. Specify in case of updating an existing tileset or if you need your own tilesetname. 
layer_nameno
layer_name: countries_wkt
Mapbox layername. If not specified than same value as tilesetname is used. Specify in case of updating an existing tileset or if you need your own layername. 
zoom_minno
zoom_min: 5
Minimal zoom of the tileset
zoom_maxno
zoom_max: 10
Maximal zoom of the tileset. Maximum allowed value is 10.
mbtiles_paramsno
mbtiles: ["drop-densest-as-needed", "extend-zooms-if-still-dropping"]
Parameters of MBTiles generation internally used by tippecanoe. Parameters can be found here https://github.com/mapbox/tippecanoe
#mapboxtokenyes
#mapboxtoken: abcdefgah1234
Your Mapbox account token. Token needs to have following priviliges: TILESETS:WRITE, TILESETS:READ, TILESETS:LIST, UPLOADS:READ, UPLOADS:WRITE. Check https://docs.mapbox.com/help/how-mapbox-works/access-tokens/ for more information.

...

Updating an existing vector tileset with optional mbtiles paramaters

Code Block

{
  "input_pkey_column": "id",
  "input_geom_column": "polygon",
  "tileset_name": "restaurants_time_zones-d0c283".
  "tileset_map_id": "cleveranalytics.d0c283",
  "#mapbox_token": "your mapbox token",
  "zoom_min": "4",
  "zoom_max": "10",
  "mbtiles_params": [
    "drop-densest-as-needed",
    "extend-zooms-if-still-dropping"
  ]
}

...