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.

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

  • i went through the project.mml file , and i did not find any attribute corresponding to shapefile/layers/data. so how can i change the data? – user27341 Sep 23 '14 at 9:28
  • In the project.mml, search for 'Datasource'. You should find the shapefile's path there. – Devdatta Tengshe Sep 23 '14 at 9:30
  • yep that should do it, i was going through empty project file my bad.Thanks man – user27341 Sep 23 '14 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.