papyrus_tilecache provides an easy and convenient method for embeding TileCache in Pyramid applications.
The source code of papyrus_tilecache is straightforward, so if papyrus_tilecache doesn't do what you want, open its source code, get inspiration, and write your own code.
papyrus_tilecache can be installed with
$ easy_install papyrus_tilecache
Often you'll want to make papyrus_tilecache a dependency of your Pyramid
application, which is done by adding
papyrus_tilecache to the
install_requires list defined in the Pyramid application's
Embeding TileCache in a Pyramid application is easy.
Edit the application's
development.ini file and, in the main section
tilecache.cfg to the location of the TileCache config
[app:MyApp] use = egg:MyApp ... tilecache.cfg = %(here)s/tilecache.cfg
In this example the TileCache config file is located at the same location as
You can use the following TileCache config as an example:
[cache] type=Disk base=/tmp/tilecache [basic] type=WMS url=http://vmap0.tiles.osgeo.org/wms/vmap0 extension=png
Now, edit the application's main file,
__init__.py, and register
papyrus_tilecache using the
def main(global_config, **settings): config = Configurator(settings=settings) import papyrus_tilecache config.include(papyrus_tilecache)
That's it! The Pyramid application now exposes a TileCache service at