It appears when using "-unscale" during a gdal_translate conversion, the defined NoData value is used when the offset/scale are applied. Not sure if this is intentional?
Let me set up an example:
note: It is understood that scale/offset are not applied to values during gdalinfo for -mm
> gdalinfo -mm DEM_16bit.tif
...
Computed Min/Max=1.000,1656.000
NoData Value=0
Offset: 5, Scale:5
> gdal_translate -ot Float32 -unscale DEM_16bit.tif DEM_32bit.tif
> gdalinfo -mm DEM_32bit.tif
...
Computed Min/Max=5.000,8285.000
NoData Value=0
So during the "unscale" the value 0 is getting pushed thru the scale/offset hence the Min=5 (0 * Scale + Offset). But then new Min should be Min=10 (1 * Scale + Offset) and NoData pixels still at 0.
Is this a known feature? I would have thought, if a NoData value is set, then gdal_translate should not apply the scale/offset to it.
thanks,
Trent
BTW, to correct this I can run gdalwarp to reset the NoData back to 0.
> gdalwarp -srcnodata 5 -dstnodata 0 DEM_32bit.tif DEM_32bit_fix.tif
> gdalinfo -mm DEM_32bit_fix.tif
...
Computed Min/Max=10.000,8285.000
NoData Value=0
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev