Hi Sentinel Hub team,
I’ve been working with using both the stats api and processing api in the same workflow.
One major challenge is that the evalscripts need to be different for each (e.g. when using processing api via eo-learn), which is inconvenient.
However, an additional challenge is that the stats api doesn’t preserve the order of the bands as requested, while the processing api does.
Take evalscripts which return the following:
bands: [“B02”, “B03”, “B04”, “B05”, “B06”, “B07”, “B08”, “B8A”, “B11” ,“B12”, “CLP”]
The processing API, via eo-learn, will return a numpy array with the bands in this order.
However, the stats api will return json objects where the bands are in this order:
[“B11”, “B12”, “B02”, “B03”, “B04”, “CLP”, “B05”, “B06”, “B07”, “B08”, “B8A”]
(I’m not sure of the order - its not alphabetical…)
Just to clarify, this is the case in the raw response.content, not just the decoded json (returns a dict), therefore the reordering is happening on the Sentinel Hub side.
It would make sense if the band order in stats api requests was preserved from the evalscript for consistency.
Kind regards
Sam