Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
March 30, 2019 09:45
September 8, 2016 11:10
March 30, 2019 09:45
November 15, 2010 12:00
February 4, 2013 16:55
April 21, 2010 16:29


a stylish alternative for caching your map tiles

Build Status

TileStache is a Python-based server application that can serve up map tiles based on rendered geographic data. You might be familiar with TileCache, the venerable open source WMS server from MetaCarta. TileStache is similar, but we hope simpler and better-suited to the needs of designers and cartographers.


import TileStache
import ModestMaps

config = {
  "cache": {"name": "Test"},
  "layers": {
    "example": {
        "provider": {"name": "mapnik", "mapfile": "examples/style.xml"},
        "projection": "spherical mercator"

# like
coord = ModestMaps.Core.Coordinate(0, 0, 1)
config = TileStache.Config.buildConfiguration(config)
type, bytes = TileStache.getTile(config.layers['example'], coord, 'png')

open('tile.png', 'w').write(bytes)




Install the pure python modules with pip:

sudo pip install -U pillow modestmaps simplejson werkzeug uuid mapbox-vector-tile

Install pip ( like:

curl -O -L
sudo python

Install Mapnik via instructions at:


TileStache can be run from the download directory as is. For example the scripts:

Can all be run locally like:


To install globally do:

python install
  • Note: you may need to prefix that command with 'sudo' to have permissions to fully install TileStache.


To make sure TileStache is working start the development server:


Then open a modern web browser and you should be able to preview tiles at:


This is a previewer that uses ModestMaps and OpenStreetMap tiles from as defined in the default config file 'tilestache.cfg'


The next step is to learn how build custom layers and serve them.

See the docs for details.


Rendering providers:

  • Mapnik
  • Proxy
  • Vector
  • Templated URLs

Caching backends:

  • Local disk
  • Test
  • Memcache
  • S3

Design Goals

The design of TileStache focuses on approachability at the expense of cleverness or completeness. Our hope is to make it easy for anyone to design a new map of their city, publish a fresh view of their world, or even build the next 8-Bit NYC (

  • Small

The core of TileStache is intended to have a small code footprint. It should be quick and easy to to understand what the library is doing and why, based on common entry points like included CGI scripts. Where possible, dynamic programming "magic" is to be avoided, in favor of basic, procedural and copiously-documented Python.

  • Pluggable

We want to accept plug-ins and extensions from outside TileStache, and offer TileStache itself as an extension for other systems. It must be possible to write and use additional caches or renderers without having to modify the core package itself, extend classes from inside the package, or navigate chains of class dependencies. Duck typing and stable interfaces win.

  • Sensible Defaults

The default action of a configured TileStache instance should permit the most common form of interaction: a worldwide, spherical-mercator upper-left oriented tile layout compatible with those used by OpenStreetMap, Google, Bing Maps, Yahoo! and others. It should be possible to make TileStache do whatever is necessary to support any external system, but we eschew complex, impenetrable standards in favor of pragmatic, fast utility with basic web clients.


BSD, see LICENSE file.