def render_on_demand_as_loop(self, tile_uri, zoom, zentral_tile): rendered_tiles = [] tileBunch = new_object.getTileBunch(zentral_tile) for tile in tileBunch: if not os.path.isdir(tile_uri + '/' + str(tile[0])): os.mkdir(tile_uri + '/' + str(tile[0])) uri = tile_uri + '/' + str(tile[0]) + '/' + str(tile[1]) + '.png' arg = (tile_dir, mapnik.save_map_to_string(self.mapnik_map), maxZoom, uri,tile[0], tile[1], zoom) scale = rendering.pure_tile_rendering(arg) rendered_tiles.append(uri) return rendered_tiles, scale
def render_on_demand_as_loop(self, tile_uri, zoom, central_tile): rendered_tiles = [] tileBunch = self.TileCalcs.getTileBunch(central_tile) for tile in tileBunch: if not os.path.isdir(tile_uri + '/' + str(tile[0])): os.mkdir(tile_uri + '/' + str(tile[0])) uri = tile_uri + '/' + str(tile[0]) + '/' + str(tile[1]) + '.png' arg = (self.params.getTilesHome(), mapnik.save_map_to_string(self.tileParams.getMapnikMap()), self.tileParams.getMaxZoom(), uri, tile[0], tile[1], zoom) scale = rendering.pure_tile_rendering(arg) rendered_tiles.append(uri) return rendered_tiles, scale
def render_on_demand_as_loop(self, tile_uri, zoom, central_tile): rendered_tiles = [] tileBunch = self.TileCalcs.getTileBunch(central_tile) for tile in tileBunch: if not os.path.isdir(tile_uri + "/" + str(tile[0])): os.mkdir(tile_uri + "/" + str(tile[0])) uri = tile_uri + "/" + str(tile[0]) + "/" + str(tile[1]) + ".png" arg = ( self.params.getTilesHome(), mapnik.save_map_to_string(self.tileParams.getMapnikMap()), self.tileParams.getMaxZoom(), uri, tile[0], tile[1], zoom, ) scale = rendering.pure_tile_rendering(arg) rendered_tiles.append(uri) return rendered_tiles, scale