(
    zoom: int, extent: Tuple[float, float, float, float], source_crs: str, scheme: str = "xyz"
)
return tile_bounds
* Returns the tile boundaries in XYZ scheme in the form
     [(x_min, y_min), (x_max, y_max)] where both values are tuples
    :param scheme: 
    :param zoom: 
    :param extent: 
    :param source_crs:
    :return:
* Returns the tile boundaries in XYZ scheme in the form
     [(x_min, y_min), (x_max, y_max)] where both values are tuples
    :param scheme: 
    :param zoom: 
    :param extent: 
    :param source_crs:
    :return:
* Returns the tile boundaries in XYZ scheme in the form [ ( x_min y_min ) ( x_max y_max ) ] where both values are tuples : param scheme : : param zoom : : param extent : : param source_crs : : return :
def get_tile_bounds(
    zoom: int, extent: Tuple[float, float, float, float], source_crs: str, scheme: str = "xyz"
) -> Bounds:
    """
     * Returns the tile boundaries in XYZ scheme in the form
     [(x_min, y_min), (x_max, y_max)] where both values are tuples
    :param scheme: 
    :param zoom: 
    :param extent: 
    :param source_crs:
    :return:
    """
    if scheme not in ["xyz", "tms"]:
        raise RuntimeError("Scheme not supported: {}".format(scheme))
    tile_bounds = None
    if extent:
        lng_min = extent[0]
        lat_min = extent[1]
        lng_max = extent[2]
        lat_max = extent[3]

        xy_min = latlon_to_tile(zoom=zoom, lat=lat_min, lng=lng_min, source_crs=source_crs, scheme=scheme)
        xy_max = latlon_to_tile(zoom=zoom, lat=lat_max, lng=lng_max, source_crs=source_crs, scheme=scheme)

        x_min = min(xy_min[0], xy_max[0])
        x_max = max(xy_min[0], xy_max[0])
        y_min = min(xy_min[1], xy_max[1])
        y_max = max(xy_min[1], xy_max[1])

        max_tile = 2 ** zoom - 1
        x_max = clamp(x_max, high=max_tile)
        y_max = clamp(y_max, high=max_tile)

        tile_bounds = create_bounds(zoom, x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max, scheme=scheme)
    return tile_bounds
def get_tile_bounds ( zoom : int , extent : Tuple [ float , float , float , float ] , source_crs : str , scheme : str = "xyz" ) -> Bounds : if scheme not in [ "xyz" , "tms" ] : raise RuntimeError ( "Scheme not supported: {}" . format ( scheme ) ) tile_bounds = None if extent : lng_min = extent [ 0 ] lat_min = extent [ 1 ] lng_max = extent [ 2 ] lat_max = extent [ 3 ] xy_min = latlon_to_tile ( zoom = zoom , lat = lat_min , lng = lng_min , source_crs = source_crs , scheme = scheme ) xy_max = latlon_to_tile ( zoom = zoom , lat = lat_max , lng = lng_max , source_crs = source_crs , scheme = scheme ) x_min = min ( xy_min [ 0 ] , xy_max [ 0 ] ) x_max = max ( xy_min [ 0 ] , xy_max [ 0 ] ) y_min = min ( xy_min [ 1 ] , xy_max [ 1 ] ) y_max = max ( xy_min [ 1 ] , xy_max [ 1 ] ) max_tile = 2 ** zoom - 1 x_max = clamp ( x_max , high = max_tile ) y_max = clamp ( y_max , high = max_tile ) tile_bounds = create_bounds ( zoom , x_min = x_min , x_max = x_max , y_min = y_min , y_max = y_max , scheme = scheme ) return tile_bounds