Ejemplo n.º 1
0
def lonlat_to_quadkey(lonlat, level):
    pix = tsm.geo_to_pixel(lonlat, level)
    pix = np.column_stack((pix[0], pix[1]))
    tile = tsm.pixel_to_tile(pix)
    tile = np.column_stack((tile[0], tile[1]))
    qk = tsm.tile_to_quadkey(tile, level)
    qk = qk.reshape(-1, 1)
    qk = pd.Series(qk[:, 0]).astype(str)

    return qk.values
Ejemplo n.º 2
0
def from_geo(geo, level):
    """
    Constucts a quadkey representation from geo and level
    geo => (lat, lon)
    If lat or lon are outside of bounds, they will be clipped
    If level is outside of bounds, an AssertionError is raised

    """
    pixel = TileSystem.geo_to_pixel(geo, level)
    tile = TileSystem.pixel_to_tile(pixel)
    key = TileSystem.tile_to_quadkey(tile, level)
    return QuadKey(key)
Ejemplo n.º 3
0
def from_geo(geo, level):
    """
    Constucts a quadkey representation from geo and level
    geo => (lat, lon)
    If lat or lon are outside of bounds, they will be clipped
    If level is outside of bounds, an AssertionError is raised

    """
    pixel = TileSystem.geo_to_pixel(geo, level)
    tile = TileSystem.pixel_to_tile(pixel)
    key = TileSystem.tile_to_quadkey(tile, level)
    return QuadKey(key)