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. 

Installation

MapboxUtils is available as Keboola Connection Component and it is available to registered Keboola users. You have to be logged in your Keboola project (https://connection.keboola.com) to use it. To open SpatialUtils just go to Applications, choose New Application and write "MapboxUtils" into the search bar. Then choose CleverMaps MapboxUtils

Configuration

With the MapboxUtils application opened, choose New Configuration and fill in the form.

Firstly, you need to specify input and output mappings.

  • Table Input Mapping

    • Choose New Table Input and specify a table with your data which you want to process. 

  • Table Output Mapping

    • Choose New Table Output and create a new empty table where the results will be stored.

Secondly you need to pass a configuration JSON into MapboxUtils. Please check availalble parameters and the example below to get the idea how the configuration file should look.

Available parameters

...

name

...

mandatory

...

example

...

description

...

input_pkey_column

...

yes

...

input_pkey_column: id

...

Name of the primary key column

...

input_geom_column

...

yes

...

Code Block
input_geom_column: wkt

...

Name of geometry column

...

tileset_map_id

...

no

...

Code Block
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_name

...

no

...

Code Block
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_name

...

no

...

Code Block
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_min

...

no

...

Code Block
zoom_min: 5

...

Minimal zoom of the tileset

...

zoom_max

...

no

...

Code Block
zoom_max: 10

...

Maximal zoom of the tileset. Maximum allowed value is 10.

...

mbtiles_params

...

no

...

Code Block
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

...

#mapboxtoken

...

yes

...

Code Block
#mapboxtoken: abcdefgah1234

...

Panel
panelIconId1f389
panelIcon:tada:
panelIconText🎉
bgColor#E3FCEF

The content you are trying to reach has been moved here: https://docs.

...

clevermaps.

...

io/

...

docs/

...

Creating a new vector tileset

Code Block
{
  "input_pkey_column": "id",
  "input_geom_column": "polygon",
  "#mapbox_token": "your mapbox token",
  "zoom_min": "4",
  "zoom_max": "10"
}

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" ] }

mapboxutils-keboola

We are proud to announce that we have launched a new documentation.

Please update your saved links and bookmarks to follow a new address docs.clevermaps.io.