(quadkey)
return [(tile_x, tile_y), level]
Transform quadkey to tile coordinates
Transform quadkey to tile coordinates
Transform quadkey to tile coordinates
def quadkey_to_tile(quadkey):
        """Transform quadkey to tile coordinates"""
        tile_x, tile_y = (0, 0)
        level = len(quadkey)
        for i in xrange(level):
            bit = level - i
            mask = 1 << (bit - 1)
            if quadkey[level - bit] == '1':
                tile_x |= mask
            if quadkey[level - bit] == '2':
                tile_y |= mask
            if quadkey[level - bit] == '3':
                tile_x |= mask
                tile_y |= mask
        return [(tile_x, tile_y), level]
def quadkey_to_tile ( quadkey ) : tile_x , tile_y = ( 0 , 0 ) level = len ( quadkey ) for i in xrange ( level ) : bit = level - i mask = 1 << ( bit - 1 ) if quadkey [ level - bit ] == '1' : tile_x |= mask if quadkey [ level - bit ] == '2' : tile_y |= mask if quadkey [ level - bit ] == '3' : tile_x |= mask tile_y |= mask return [ ( tile_x , tile_y ) , level ]