Ticket #3797 (closed defect: fixed)
netCDF driver ignores the "scale_factor"
| Reported by: | jluis | Owned by: | etourigny |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | GDAL_Raster | Version: | svn-trunk |
| Severity: | normal | Keywords: | netcdf |
| Cc: | pds, kyle |
Description
The scale factor in netcdf files is ignored. I'll use a GMT generated file to show this.
- Generate one dumb file grdmath -R-10/10/-10/10 -I1 X Y MUL = lixo.grd
- Change the scale_factor from its default value of 1 to 0.01 grdedit lixo.grd -D=/=/=/0.01/=/=/=/=
- Convert to tiff gdal_translate lixo.grd lixo.tiff
Ask GMT & GDAL about data min/max
grdinfo lixo.grd <...> lixo.grd: x_min: -10 x_max: 10 x_inc: 1 name: x nx: 21 lixo.grd: y_min: -10 y_max: 10 y_inc: 1 name: y ny: 21 lixo.grd: z_min: -1 z_max: 1 name: z lixo.grd: scale_factor: 0.01 add_offset: 0
gdalinfo lixo.tiff -mm <...> Band 1 Block=21x21 Type=Float32, ColorInterp?=Gray
Computed Min/Max?=-100.000,100.000
NoData? Value=nan
What happens is that while converting the scale_factor was not applied.

