sentinel-hub/sentinelhub-js

Fix return type for getStats() when StatAPI is used

zcernigoj opened this issue · 0 comments

Return type for getStats() if StatAPI is used is set to StatisticalApiResponse.
But the actual response of getStats() is not of that type, it's actually:

Statistical API response type is

{
  data: StatisticalApiResponse;
  status: string;
}

example from documentation: Statistics for one single-band output on a given day

{'data': [{'interval': {'from': '2020-07-04T00:00:00Z',
    'to': '2020-07-05T00:00:00Z'},
   'outputs': {'output_B04': {'bands': {'B0': {'stats': {'min': 0.07970000058412552,
        'max': 0.30959999561309814,
        'mean': 0.11471141986778864,
        'stDev': 0.034298170449733226,
        'sampleCount': 3240,
        'noDataCount': 0}}}}}}],
 'status': 'OK'}