block by jczaplew d9aed1ecd082ad0eaf79

Rolling tiles with mapnik + tilestache instead of Tilemill

Rolling tiles sans Tilemill

Perhaps you’ve had problems programmatically creating tiles with Tilemill, or are concerned about the future stability of project (or you just like playing with geo software).

Install mapnik and TileStache

brew install mapnik --with-gdal --with-postgresql
sudo pip install -U PIL modestmaps simplejson werkzeug
git clone TileStache
cd TileStache
python install

Export your Tilemill project

  1. Open your project in Tilemill
  2. Select “Export” -> “Mapnik XML”
  3. Save it to /TileStache/your_project.xml

Modify TileStache config

Modify /TileStache/tilestache.cfg to be similar to this:

    "name": "Disk",
    "path": "my_cache",
    "umask": "0000",
    "dirs": "portable"
    "your_layer": {
      "provider" : {
        "name": "mapnik", "mapfile": "your_project.xml"


Run the following:


Then open http://localhost:8080/your_project/preview.html in a web browser. If you see your map, you are good to go!


Example: seed a cache from zoom levels 5-12 of the lower 48

sudo python ./scripts/ -b 24 -128 50 -66 -c tilestache.cfg -l your_project 5 6 7 8 9 10 11 12 also has methods for exports to other formats, such as mbtiles and S3. Check out the documentation for more info.