Hi guys,
I am trying to use Statistical API to get a time series of index values for a single polygon. I need to get values for all available dates since 2018/01/01 till the most recent.
Sometimes it works, but usually no data are returned and the request timeouts after 5 mins.
When trying the same for a shorter period (one month), data are usually returned.
I am using sentinelhub sdk, but face the same behavior at the request builder page.
Is Statistical API suitable for such a “long” time-series?
Or is there a workaround to get the long time-series (all days over several years)?
Many thanks for any advice!
Vit
Here is a sample request from the request builder:
curl -X POST https://services.sentinel-hub.com/api/v1/statistics
-H 'Content-Type: application/json'
-H 'Authorization: Bearer <token>'
-d '{
"input": {
"bounds": {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
12.976141,
42.203122
],
[
12.976484,
42.201087
],
[
12.978758,
42.199975
],
[
12.980474,
42.200992
],
[
12.978715,
42.202804
],
[
12.978844,
42.203535
],
[
12.976141,
42.203122
]
]
]
}
},
"data": [
{
"dataFilter": {},
"type": "sentinel-2-l2a"
}
]
},
"aggregation": {
"timeRange": {
"from": "2018-01-01T00:00:00Z",
"to": "2022-03-08T23:59:59Z"
},
"aggregationInterval": {
"of": "P1D"
},
"width": 10,
"height": 11.091,
"evalscript": "//VERSION=3\nfunction setup() {\n return {\n input: [{\n bands: [\n \"B04\",\n \"B08\",\n \"SCL\",\n \"dataMask\"\n ]\n }],\n output: [\n {\n id: \"data\",\n bands: 3\n },\n {\n id: \"scl\",\n sampleType: \"INT8\",\n bands: 1\n },\n {\n id: \"dataMask\",\n bands: 1\n }]\n };\n}\n\nfunction evaluatePixel(samples) {\n let index = (samples.B08 - samples.B04) / (samples.B08+samples.B04);\n return {\n data: [index, samples.B08, samples.B04],\n dataMask: [samples.dataMask],\n scl: [samples.SCL]\n };\n}\n"
},
"calculations": {
"default": {}
}
}'