Modification of "tilesRepoFS.py" in GMapcacher svn 1193 to support the tiles in
OSM format.
Attachment file with the changes.
## Return the absolute path to a tile in OSM format
# only check path
# tile_coord = (zoom_level, tile_X, tile_Y)
# smaple of the Naming convention:
# \.googlemaps\tiles\2\0\1.png
# We only have 2 levels for one axis
# private
def coord_to_path(self, tile_coord, layer):
return os.path.join(
self.configpath,
MAP_SERVICES[layer]["layerDir"],
str(MAP_MAX_ZOOM_LEVEL - tile_coord[2]),
str(tile_coord[0]),
str(tile_coord[1]) + ".png"
)
## create path if doesn't exists in OSM format
# tile_coord = (zoom_level, tile_X, tile_Y)
# smaple of the Naming convention:
# \.googlemaps\tiles\2\0\1.png
# We only have 2 levels for one axis
# private
def coord_to_path_checkdirs(self, tile_coord, layer):
self.lock.acquire()
path = os.path.join(self.configpath, MAP_SERVICES[layer]["layerDir"],)
path = fileUtils.check_dir(path)
path = fileUtils.check_dir(path, '%d' % (MAP_MAX_ZOOM_LEVEL -tile_coord[2]))
path = fileUtils.check_dir(path, "%d" % (tile_coord[0]))
self.lock.release()
return os.path.join(path, "%d.png" % (tile_coord[1]))
Original issue reported on code.google.com by madelein...@gmail.com on 17 Dec 2011 at 6:41
Original issue reported on code.google.com by
madelein...@gmail.com
on 17 Dec 2011 at 6:41Attachments: