sentinelhub-js icon indicating copy to clipboard operation
sentinelhub-js copied to clipboard

Check if getStats() really needs instance id and layer id when StatAPI is used

Open zcernigoj opened this issue 2 years ago • 0 comments

Even when StatAPI is used for getting statistics, instanceId and layerId are still needed. in layer.getStats(), there is getStatisticsProvider() for getting statistics provider and when StatAPI is used, StatisticalApi.getStats() calls layer.updateLayerFromServiceIfNeeded(), where instanceId and layerId are needed.

Is this really necessary? Can it be done to work just with evalscript and dataProduct like getMap()?

Related code lines:

https://github.com/sentinel-hub/sentinelhub-js/blob/75517437601697974b7fef8ca631cd8f71669cd3/src/statistics/StatisticalApi.ts#L26

zcernigoj avatar Feb 13 '23 15:02 zcernigoj