def execute(self): if self.changed is not None: if self.changed[min(self.changed)]: self.update_guard() else: # Change analysis was done, but nothing was changed return PolygonTileGenCommand.execute(self)
def generation_filter(self, zoom, x, y, width, height): """Filter rendering of the map in a super-tile""" # DEBUG EXAMPLE # self.verbose = ((zoom == 13) and (x <= 4899) and (4899 <= (x+width-1)) and (y <= 3327) and (3327 <= (y+height-1))) if self.changed is None: # Change analysis is not used return PolygonTileGenCommand.generation_filter( self, zoom, x, y, width, height) self._progress_update(zoom, width * height) generate = self.updated(zoom, x, y, width, height) if self.verbose: print " OsmChangeTileGenCommand - Generating {}x{} super-tile: {}/{}/{}: {}".format( width, height, zoom, x, y, generate) return generate
def save_filter(self, tile): """Filter the saving to disk of individual tiles in the super tile""" # DEBUG EXAMPLE # self.verbose = ((tile.zoom == 13) and (tile.tile_x == 4899) and (tile.tile_y == 3327)) if self.changed is None: # Change analysis is not used return PolygonTileGenCommand.save_filter(self, tile) save = self.updated(tile.zoom, tile.tile_x, tile.tile_y, 1, 1) if self.verbose: reason = "Changed" if ( tile.tile_x, tile.tile_y) in self.changed[tile.zoom] else ( "Guard band" if save else "Skipped") # TODO # self.reason[reason] += 1 App.log(" OsmChangeTileGenCommand - Saving tile: {}/{}/{}: {}". format(tile.zoom, tile.tile_x, tile.tile_y, reason)) return save
def execute(self): if self.changed is not None and not self.changed[min(self.changed)]: return PolygonTileGenCommand.execute(self)
def __init__(self, *args): PolygonTileGenCommand.__init__(self) self.changed = None self.guard = None