cogeotiff / rio-tiler

User friendly Rasterio plugin to read raster datasets.
https://cogeotiff.github.io/rio-tiler/
BSD 3-Clause "New" or "Revised" License
502 stars 106 forks source link

Update unscaling to use the per-band scale/offset values #707

Closed jddeal closed 3 months ago

jddeal commented 3 months ago

Hey there!

This is a small change to extend unscale=True to lean on the per-band values instead of assuming the first scale/offset applies to all bands.

(Sponsored by Vaisala Xweather)

vincentsarago commented 3 months ago

@jddeal I'm not quite sure why we need this. In GDAL/Rasterio I thought the metadata model was to have only one scale/offset value 🤷‍♂️

jddeal commented 3 months ago

I suspect we might have a rather uncommon use case, but we haven't run into any limitations through gdal or rasterio that would imply only one scale/offset should be set per file.

Some example docs:

four43 commented 3 months ago

@jddeal I'm not quite sure why we need this. In GDAL/Rasterio I thought the metadata model was to have only one scale/offset value 🤷‍♂️

I will be forever sad that the nodata value is applied per file, not per band anymore. That's such a shame for heterogeneous data :(

vincentsarago commented 3 months ago

@jddeal I don't seems to have push right on the fork so I cannot edit this PR

vincentsarago commented 3 months ago

edited in https://github.com/cogeotiff/rio-tiler/pull/708