DownloadFailedException: Failed to download from:
https://services.sentinel-hub.com/api/v1/statistics
with HTTPError:
400 Client Error: Bad Request for url: https://services.sentinel-hub.com/api/v1/statistics
Server response: "{"status": 400, "reason": "Bad Request", "message": "Your request of 1666.52 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": "COMMON_EXCEPTION"}"
The above error is a result of the following script. not sure why this happens, it was usually 2500 meters (the max resolution for downloading). Also the Image shape at 10 m resolution: (166, 95) pixels
aggregation = SentinelHubStatistical.aggregation(
evalscript=ndvi_new_evalscript,
time_interval=yearly_time_interval,
aggregation_interval="P1D",
resolution=(10, 10),
)
# Define histogram calculations
histogram_calculations = {
"ndvi": {
"histograms": {"default": {"nBins": 20, "lowEdge": -1.0, "highEdge": 1.0}}
}
}
# Initialize empty list for feature requests
features_requests = []
# Loop over each geometry value in the AOI polygon
for geo_shape in AOI_polygon.geometry.values:
request = SentinelHubStatistical(
aggregation=aggregation,
input_data=[
SentinelHubStatistical.input_data(
DataCollection.SENTINEL2_L2A,
other_args={"dataFilter": {"mosaickingOrder": "leastCC"}},
)
],
geometry=Geometry(geo_shape, crs=CRS(AOI_polygon.crs)),
calculations=histogram_calculations,
config=config,
)
# Append the request to the list of feature requests
features_requests.append(request)