TileStache.Goodies.Providers.Monkeycache | index |
Monkeycache is a tile provider that reads data from an existing cache.
Normally, TileStache creates new tiles at request-time and saves them to a
cache for later visitors. Monkeycache supports a different workflow, where
a cache is seeded ahead of time, and then only existing tiles are served
from this cache.
For example, you might have a TileStache configuration with a Mapnik
provider, which requires PostGIS and other software to be installed on your
system. Monkeycache would allow you to seed that cache into a directory of
files or an MBTiles file on a system with a fast processor and I/O, and then
serve the contents of the cache from another system with a faster network
connection but no Mapnik or PostGIS.
Two sample configurations:
{
"cache": {"name": "Disk", "path": "/var/cache"},
"layers":
{
"expensive-layer":
{
"provider": {"name": "Mapnik", "mapfile": "style.xml"}
}
}
}
{
"cache": {"name": "Test"},
"layers":
{
"cheap-layer":
{
"provider":
{
"class": "TileStache.Goodies.Providers.Monkeycache:Provider",
"kwargs":
{
"layer_name": "expensive-layer",
"cache_config": {"name": "Disk", "path": "/var/cache"},
"format": "PNG"
}
}
}
}
}
Classes | ||||||||||||||||||
|