Problems getting Tilecache to work with Mapnik

hi,

i’m looking for a working tilecache.cfg or an explanation for using Mapnik as an OpenStreetMaps renderer for tilecache.
My problem is:

  • I have Mapnik installed and rendering OSM data fine with generate_tiles.py and generate_image.py
  • I have tilecache installed and it works fine for caching an external WMS server.
    both are pretty much installed with their stock configuration files ( just adapted to my directory names)
    however, when i try to use tilecache with mapnik in the openlayers demo that comes with tilecache, i get error messages:

An error occurred: can’t find resolution index for 0.703125. Available resolutions are:
[156543.03390000001, 78271.516950000005, 39135.758475000002, 19567.879237500001, 9783.9396187500006, 4891.9698093750003, 2445.9849046875001, 1222.9924523437501, 611.49622617187504, 305.74811308593752, 152.87405654296876, 76.43702827148438, 38.21851413574219, 19.109257067871095, 9.5546285339355475, 4.7773142669677737, 2.3886571334838869, 1.1943285667419434, 0.59716428337097172, 0.29858214168548586]

tried for example with the following image request (left half of the planet), replace hxxp with http:
hxxp://127.0.0.1/tilecache/tilecache.cgi?LAYERS=osm&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-180,-90,0,90&WIDTH=256&HEIGHT=256
the same url works fine with LAYERS=basic which uses an external WMS server instead of LAYERS=osm which uses mapnik

the tilecache.cfg configuration section used for the Mapnik layer named “osm” is, stock from tilecache:
[osm]
type=Mapnik
mapfile=/path/to/my/mapnik/mapfile/that/works/fine/with/the/python/scripts/osm.xml
spherical_mercator=true
tms_type=google

if i add the following resolutions line to that section:
resolutions=0.703125
the error message changes to:

An error occurred: Current x value -180.000000 is too far from tile corner x -268.340000

what am i doing wrong here, what must i do to get tilecache to work with mapnik?

Ask on the dev mailing list. might get a response there…