abidinamdar / gmapcatcher

Automatically exported from code.google.com/p/gmapcatcher
1 stars 0 forks source link

tilesRepoFS.py in OSM format #298

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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

Attachments:

GoogleCodeExporter commented 8 years ago
the Idea is to create a new tileRepo not modify the existing one...

Original comment by heldersepu on 19 Dec 2011 at 12:28

GoogleCodeExporter commented 8 years ago

Original comment by heldersepu on 20 Dec 2011 at 3:29