[Tilecache] Getting multiple tiles jumbled up for mapnik layer

Sanjiv Singh singhsanjivk at gmail.com
Wed Jul 23 15:53:46 EDT 2008


Hi all,

I am trying to serve OpenStreetMap data using mapnik and tilecache. I
am using tilecache in a TurboGears2 controller as follows:

from tiler.lib.base import BaseController
from tg import expose, flash
import pylons
from pylons.i18n import ugettext as _
from TileCache.Service import Service, wsgiHandler
from TileCache.Caches.Disk import Disk
from TileCache.Layers import Mapnik as Mapnik

myService = Service(
  Disk("/home/sanjiv/wms-c/cache"),
  {
    "osm": Mapnik.Mapnik("osm",
           mapfile="/home/sanjiv/mapnik/osm.xml",
           spherical_mercator="true", extension="png")
  }
)

class RootController(BaseController):

    @expose()
    def tiles(self, *args, **kw):
        return wsgiHandler(pylons.request.environ,
                        self.start_response, myService)

But I am getting jumbled tiles when loading it as
OpenLayers.Layer.TileCache layer in openlayers. Actually I am getting
a distorted tile which is repeated several times to give a jumbled
look. I have python2.5 on Ubunty Hardy. My mapnik generate_tiles.py
works correctly and I can see the tiles properly as a TMS layer.

Regards
Sanjiv



More information about the Tilecache mailing list