[OSM-dev] tilecache & mapnik

Christopher Schmidt crschmidt at metacarta.com
Thu Dec 7 00:18:35 GMT 2006

On Wed, Dec 06, 2006 at 09:57:29PM +0000, Jon Burgess wrote:
> I'm trying to get tilecache working with mapnik for OSM data. I've got
> tilecache working fine with the vmap0 layer. Unfortunately the mapnik
> layer consists entirely of tiles in the background cream colour. 
> Mapnik too works fine on its own rendering tiles via generate_tiles.py
> etc. 
> It looks like it the tilecache with mapnik is so close to working, but
> only produces these cream tiles. Any clue about what i'm missing? 
> Attached are the html & cfg files that i'm using.

The default projection for TileCache is 'unprojected', with bounds from
-180,-90 to 180,90.

The OSM mapnik xml file uses a Mercator projection.

Which one do you want? :)

If the former (Which your OpenLayers map seems to indicate), then you
want to change the first line of your osm.xml file to:

<Map bgcolor="#f2efe9" srs="+proj=longlat +datum=WGS84 +no_defs">

if the latter, you will want a TileCache Layer like:


and then set your OpenLayers Map up like:

            map = new OpenLayers.Map( $('map'), {
			  maxResolution: 156543/4, 
			  maxExtent: new
			  numZoomLevels: 17,
			  projection: 'epsg:41001',

One of these two solutions should get you started -- changing the first
line of your osm.xml file is probably easier to get right while you're
getting started.

Christopher Schmidt

More information about the dev mailing list