Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.