Unable to download sentinel-2 L2A data of original resolution of a bounding box

I have a sample bounding box with the following parameters:

> sample_coords_wgs84 = [14.130497,47.638267,14.653169,47.876458]
> resolution = 10
> sample_bbox = BBox(bbox=sample_coords_wgs84, crs=CRS.WGS84)
> sample_size = bbox_to_dimensions(sample_bbox, resolution=resolution)
> 
> print(f"Image shape at {resolution} m resolution: {sample_size} pixels")

Output : Image shape at 10 m resolution: (3938, 2616) pixels

The evalscript I use:

evalscript_select_bands = """
    //VERSION=3

    function setup() {
        return {
            input: [{
                bands: ["B02", "B03", "B04","B08"]
            }],
            output: {
                bands: 3
            }
        };
    }

    function evaluatePixel(sample) {
        return [sample.B04, sample.B03, sample.B02];
    }
"""

request_true_color = SentinelHubRequest(
    evalscript=evalscript_select_bands,
    input_data=[
        SentinelHubRequest.input_data(
            data_collection=DataCollection.SENTINEL2_L2A,
            time_interval=("2020-06-12", "2020-06-13"),
        )
    ],
    responses=[SentinelHubRequest.output_response("default", MimeType.TIFF)],
    bbox=sample_bbox,
    resolution=(10,10),
    data_folder=results_dir,
    config=config,
)```

When I run the following command to get the data.

new_request = request_true_color.get_data(save_data=True)

I get the following. Not sure how to download the original resolution sentinel-2 image of any bbox.

DownloadFailedException: Failed to download from:
https://services.sentinel-hub.com/api/v1/process
with HTTPError:
400 Client Error: Bad Request for url: https://services.sentinel-hub.com/api/v1/process
Server response: "{"error":{"status":400,"reason":"Bad Request","message":"Your request of 3908.24 meters per pixel exceeds the limit 1500.00 meters per pixel of the collection S2L2A. Please revise the resolution (or corresponding width/height) to make sure it is in supported range.","code":"RENDERER_EXCEPTION"}}"

Hi @aswinbio ,

The error message actually explained why your request was failed: Your request of 3908.24 meters per pixel exceeds the limit 1500.00 meters per pixel of the collection S2L2A. Please revise the resolution (or corresponding width/height) to make sure it is in supported range.

Looking at your script the resolution was set to (10, 10), meaning that the request was asking for a 10 degrees resolution. The unit of resolution is defined by the CRS given by the input bounding box, which is WGS84 in this case. For more information, pleas refer to our API reference.

Another point is that the image shape at 10 m resolution is (3938, 2616), which exceeds the size limit of (2500, 2500). You might want to reduce the resolution or the area of bounding box to make the size of output image smaller. If you must process a large area with high resolution, please take a look at our Batch Processing API, which is designed for large scale requests.

1 Like

Thanks for the quick response. That makes sense, but I can download much bigger area using the request builder actually. One more question,

Is normalization already done for bands/NDVI when I specify in the request builder or I should include it manually.