def __init__(self, max_extent=None, tile_size=None, max_zoom=None, flip_y=False): TileGrid.__init__(self, max_extent=max_extent, tile_size=tile_size, flip_y=flip_y) self.max_zoom = max_zoom
def __init__(self, resolutions, max_extent=None, tile_size=None, scale=1, flip_y=False): TileGrid.__init__(self, max_extent=max_extent, tile_size=tile_size, flip_y=flip_y) assert list(resolutions) == sorted(resolutions, reverse=True) assert all(isinstance(r, int) or isinstance(r, long) for r in resolutions) self.resolutions = resolutions self.scale = 1 if scale is 1 else float(scale) self.parent_zs = [] self.child_zs = [] for i, resolution in enumerate(self.resolutions): for parent in xrange(i - 1, -1, -1): if self.resolutions[parent] % resolution == 0: self.parent_zs.append(parent) self.child_zs[parent].append(i) break else: self.parent_zs.append(None) self.child_zs.append([])
def setUp(self): self.tg = TileGrid()