Hi @cirotccmbauspesalq2 ,
In your case I would recommend using the Statistical API to automatically obtain zonal histogram.
Below is an example request to get zonal statistics and histogram of all acquisitions available from 2023-07-07 to 2023-08-17. For more details please have a look at the Statistical API documentation and, to get a better idea, go through the webinar on Statistical API which gives a step-by-step guide to the API.
curl -X POST https://services.sentinel-hub.com/api/v1/statistics \
-H 'Authorization: Bearer ' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"input": {
"bounds": {
"bbox": [
4524858.253997,
2088521.994524,
4532692.194797,
2093982.407454
],
"properties": {
"crs": "http://www.opengis.net/def/crs/EPSG/0/3035"
}
},
"data": [
{
"dataFilter": {},
"type": "sentinel-2-l2a"
}
]
},
"aggregation": {
"timeRange": {
"from": "2023-07-17T00:00:00Z",
"to": "2023-08-17T23:59:59Z"
},
"aggregationInterval": {
"of": "P1D"
},
"resx": "10",
"resy": "10",
"evalscript": "//VERSION=3\nfunction setup() {\n return {\n input: [{\n bands: [\n \"SCL\",\n \"dataMask\"\n ]\n }],\n output: [\n {\n id: \"scl\",\n sampleType: \"INT8\",\n bands: 1\n },\n {\n id: \"dataMask\",\n bands: 1,\n sampleType: \"INT8\"\n }]\n };\n}\n\nfunction evaluatePixel(samples) {\n return {\n dataMask: [samples.dataMask],\n scl: [samples.SCL]\n };\n}\n"
},
"calculations": {
"scl": {
"histograms": {
"default": {
"binWidth": "1",
"lowEdge": "0",
"highEdge": "12"
}
}
}
}
}'