Ticket #1660 (closed enhancement: duplicate)
add support for scale and offset in netCDF driver.
| Reported by: | hulst | Owned by: | dnadeau |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.8.0 |
| Component: | GDAL_Raster | Version: | svn-trunk |
| Severity: | normal | Keywords: | netcdf, scale offset, add_offset, scale_factor |
| Cc: | hulst@…, kyle |
Description
Hello,
I've modified the netcdf driver so that it supports scale and offset attributes.
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.0/cf-conventions.html#attribute-appendix
One can argue from the description above that the netcdf driver is not responsible for applying offset and scale, but the calling application. I find the driver a convenient location.
Attached you find the updated driver. For now I can think of one situation where the driver gives problems:
--- In order to apply scale and offset the data is read in the native netCDF type (f.i. UInt16), but stored as a float in memory. I maintain the original _FillValue of the originating dataset (e.g., -32768). When the dataset contains this value after the application of scale and offset the data is wrongfully accused of being garbage. A small chance, but still. ---
Regards, Sander

