/usr/share/pyshared/TileCache/Services/TileService.py is in tilecache 2.11-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # BSD Licensed, Copyright (c) 2006-2010 TileCache Contributors
from TileCache.Service import Request, Capabilities
import TileCache.Layer as Layer
class TileService (Request):
def parse (self, fields, path, host):
param = {}
for key in ['interface', 'version', 'dataset', 'level', 'x', 'y', 'request']:
if fields.has_key(key.upper()):
param[key] = fields[key.upper()]
elif fields.has_key(key):
param[key] = fields[key]
else:
param[key] = ""
return self.getMap(param)
def getMap (self, param):
layer = self.getLayer(param["dataset"])
level = int(param["level"])
y = float(param["y"])
x = float(param["x"])
tile = Layer.Tile(layer, x, y, level)
return tile
|