02 February 2010

Tilecache TMS fixes

Error message when working with tilecache TMS:

An error occurred: The requested layer (1.0.0) does not exist. Available layers are:

To fix it, only add one line as below:

helmi@gandalf:~/Packages/tilecache-2.10/TileCache/Services$ diff -C3 TMS.py TMS_fix.py 
*** TMS.py      2010-02-02 16:12:32.000000000 +0800
--- TMS_fix.py  2010-02-02 16:13:06.000000000 +0800
***************
*** 13,18 ****
--- 13,19 ----
          elif len(parts) < 2:
              return self.serviceCapabilities(host, self.service.layers)
          else:
+             parts = parts[-5:]
              layer = self.getLayer(parts[1])
              if len(parts) < 3:
                  return self.layerCapabilities(host, layer)
http://twitter.com/helmi03/status/8534440936