I have installed Tilemill to export my map as mbtiles,and I used mbutil to export as PNG images & UTFGrid.So forth,I have a Tilemill project with MSS(Carto) files.Now the data source is going to change weekly and I wish to automate this action.

So does Tilemill support command-line scripting or something else to export my project with given properties ??

Current System : Windows 7 x64

EDIT in response to @Sunil:

TileMill doesn't have any features for automatically manipulating your Carto stylesheets, but you could use a bash script to manipulate the Carto files directly. TileMill also has an export command that can be called from bash.

On Mac OS X, you could run a command like this in the Terminal for more details about using the export command:

/Applications/TileMill.app/Contents/Resources/node /Applications/TileMill.app/Contents/Resources/index.js export --help

The exact command depends on how you installed TileMill

Unfortunately,same command for Mac OS X does not work on my current system.What does the last sentence mean,is there different installations of Tilemill ?


2 Answers 2


I found it at last.Tilemill commands should run via node that included in the same directory with index.js file.I was trying to run directly index.js as index.js export .. which is not working.

@Sunil's redirection to support page allowed me to install ubuntu and see code was working then i realized that it was all working with nodejs functionality.After opening Tilemill GUI,it also works in http://localhost:20009/ as well.Then I got that commands should be working with node.

Therefore we must type on Windows 7 (x64)

node index.js export (..options..)

on Ubuntu

./index.js export (..options..)

Also I found all available commands


--format=[format] Export format (png|pdf|svg|mbtiles|upload|sync). (Default: undefined)
--bbox=[xmin,ymin,xmax,ymax] Comma separated coordinates of bounding box to export. (Default: undefined)
--minzoom=[zoom] MBTiles: minimum zoom level to export. (Default: undefined)
--maxzoom=[zoom] MBTiles: maximum zoom level to export. (Default: undefined)
--width=[width] Image: image width in pixels. (Default: 400)
--height=[height] Image: image height in pixels. (Default: 400)
--url=[url] URL to PUT updates to. (Default: undefined)
--log Write crash logs to destination directory. (Default: undefined)
--quiet Suppresses progress output. (Default: undefined)
--scheme=[scanline|pyramid|file] Enumeration scheme that defines the order in which tiles will be rendered. (Default: "scanline")
--job=[file] Store state in this file. If it exists, that job will be resumed. (Default: false)
--list=[file] Provide a list file for filescheme render. (Default: false)
--metatile=[num] Metatile size. (Default: undefined)
--scale=[num] Scale factor (Default: undefined)
--concurrency=[num] Number of exports that can be run concurrently. (Default: 4)
--files=[path] Path to files directory. (Default: "C:\Users\USERNAME/Documents/MapBox" on Windows) (Default: "/home/USERNAME/Documents/MapBox" on Ubuntu)
--syncAPI=[URL] MapBox API URL. (Default: "http://api.tiles.mapbox.com")
--syncURL=[URL] MapBox sync URL. (Default: "https://tiles.mapbox.com")
--syncAccount=[account] MapBox account name. (Default: "")
--syncAccessToken=[token] MapBox access token. (Default: "")
--verbose=on|off verbose logging (Default: "on")
--config=[path] Path to JSON configuration file

Best Regards


Export command line options are officially documented at https://www.mapbox.com/tilemill/docs/manual/exporting/.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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