예제 #1
0
def make_zmd_list_geodetic():
    """Make a geodetic zoom level metadata mock object."""
    zmd_list = []
    for zoom in xrange(2, 6):
        zmd = ZoomMetadata()
        zmd.zoom = zoom
        zmd.min_tile_row = 0
        zmd.min_x = 0
        zmd.min_tile_col = 0
        zmd.min_y = 0
        zmd.max_tile_row = (2**zoom) - 1
        zmd.max_x = zmd.max_tile_row
        zmd.max_tile_col = (2**(zoom-1)) - 1
        zmd.max_y = zmd.max_tile_col
        zmd.matrix_width = (4 if zoom == 2 else zmd_list[zoom-3].matrix_width * 2)
        zmd.matrix_height = (2 if zoom == 2 else zmd_list[zoom-3].matrix_height * 2)
        zmd_list.append(zmd)
    return zmd_list
예제 #2
0
def make_zmd():
    zmd = ZoomMetadata()
    zmd.zoom = 1
    zmd.min_tile_col = 1
    zmd.min_tile_row = 1
    zmd.min_x = 1
    zmd.min_y = 1
    zmd.max_tile_col = 2
    zmd.max_tile_row = 2
    zmd.max_x = 2
    zmd.max_y = 2
    zmd.matrix_width = 2
    zmd.matrix_height = 2
    return zmd