2

I need to generate hundreds of MBTiles from different shapefiles and same styles, so I created a xml from tilemill with a single shapefile and styling, using python landez library to generate MBTiles from this xml (keep changing datasource for each shapefile). Problem is landez is taking too long to create while tilemill is faster in exporting MBTiles, also through landez, few tiles are missing at different zoom levels (blank tile, so default color).

I was just wondering if this can be done using tilemill, (tilemill seems to export only projects).

PS: I want to do this process through terminal.

user30184
  • 65,331
  • 4
  • 65
  • 118
user27341
  • 47
  • 7
  • It is possible to run tilemill from the command line. Have a look at this: http://gis.stackexchange.com/questions/52401/how-to-automate-export-in-tilemill – Devdatta Tengshe Sep 11 '14 at 12:37

1 Answers1

1

What you can do is to automate the export of the mbtiles file from tilemill itself.

The mbtiles project folder basically consists of the style.mss file, and a project.mml file which is a JSON file. You can edit the later file to refer to your data, and extent, projection etc.

After that, you can Export from the command line, by giving a command like:

./index.js export geography-class ~/Documents/MapBox/export/geography-class.png --format=png --width=600 --height=400 --bbox="-131.4844,20.3034,-62.5781,51.3992" where you have given the path of the project folder, and project name.

Have a look at this document, which explains all the command line options: Exports from the command line

Devdatta Tengshe
  • 41,311
  • 35
  • 139
  • 263