Open-EO / openeo-spring-driver

openEO driver build on spring using WCPS and ODC storage access
Apache License 2.0
0 stars 0 forks source link

Data indexed in ODC does not apply scale factor #44

Closed clausmichele closed 3 years ago

clausmichele commented 3 years ago

ADO_NDVI_MODIS_231m_3035_ODC gives data scaled between [-1000,1000] but it should be automatically scaled between [-1,1]:

Band 1 Block=4901x1 Type=Int16, ColorInterp=Gray
  Min=-406.000 Max=995.000 
  Minimum=-406.000, Maximum=995.000, Mean=620.757, StdDev=154.456
  NoData Value=-32768
  Offset: 0,   Scale:0.001
  Metadata:
    STATISTICS_MAXIMUM=995
    STATISTICS_MEAN=620.75652914253
    STATISTICS_MINIMUM=-406
    STATISTICS_STDDEV=154.45576968929
    STATISTICS_VALID_PERCENT=4.631

ODC uses rasterio to read the data, this is not yet supported by them: https://github.com/mapbox/rasterio/issues/2219

clausmichele commented 3 years ago

The issue can be solved creating VRTs to apply the scaling.

clausmichele commented 3 years ago

As mentioned here https://github.com/mapbox/rasterio/issues/2219 rasterio does not apply the scale factor automatically and will not change since GDAL also does not do it.