def bounds(sceneid):
    """
    Retrieve image bounds.

    Attributes
    ----------
    sceneid : str
        Sentinel-2 sceneid.

    Returns
    -------
    out : dict
        dictionary with image bounds.

    """
    scene_params = _sentinel_parse_scene_id(sceneid)
    sentinel_address = "{}/{}".format(SENTINEL_BUCKET, scene_params["key"])

    with rasterio.open("{}/preview.jp2".format(sentinel_address)) as src:
        wgs_bounds = transform_bounds(
            *[src.crs, "epsg:4326"] + list(src.bounds), densify_pts=21
        )

    info = {"sceneid": sceneid}
    info["bounds"] = list(wgs_bounds)

    return info
def bounds ( sceneid ) : scene_params = _sentinel_parse_scene_id ( sceneid ) sentinel_address = "{}/{}" . format ( SENTINEL_BUCKET , scene_params [ "key" ] ) with rasterio . open ( "{}/preview.jp2" . format ( sentinel_address ) ) as src : wgs_bounds = transform_bounds ( * [ src . crs , "epsg:4326" ] + list ( src . bounds ) , densify_pts = 21 ) info = { "sceneid" : sceneid } info [ "bounds" ] = list ( wgs_bounds ) return info
Retrieve image bounds.

    Attributes
    ----------
    sceneid : str
        Sentinel-2 sceneid.

    Returns
    -------
    out : dict
        dictionary with image bounds.