#2626 closed defect (wontfix)
gdal_translate fails to update nodata tag on convert 32bit to 16bit
Reported by: | maphew | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Utilities | Version: | unspecified |
Severity: | normal | Keywords: | nodata gdal_translate |
Cc: |
Description
When converting an image from 32bit float to 16bit signed integer the nodata tag from the source image is retained. The nodata values within the raster are converted from -3.40282346638529e+38 to -32768. but not in the header. Example:
gdal_translate -ot int16 my32bit.tif my16bit.tif gdalinfo -mm my16bit.tif ...snip... Band 1 Block=1800x2 Type=Int16, ColorInterp=Gray Computed Min/Max=-32768.000,5973.000 NoData Value=-3.40282346638529e+38
Attachments (1)
Change History (6)
by , 16 years ago
Attachment: | gdal-32to16-nodata-bug.zip added |
---|
comment:1 by , 16 years ago
Component: | default → Utilities |
---|
This is using GDAL 1.4.4.0, released 2007/11/23, on ubuntu 8.04
comment:2 by , 16 years ago
Version: | unspecified → 1.4.4 |
---|
comment:3 by , 16 years ago
As a workaround, you can add "-a_nodata -32768" to your gdal_translate command line
comment:4 by , 16 years ago
Keywords: | nodata gdal_translate added |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Matthew,
This is the intended behavior. I agree it can be surprising and confusing but the automatic alternatives get very complicated and I'm not prepared to pursue them at this time. Possibly someone else might feel differently.
comment:5 by , 15 years ago
Version: | 1.4.4 → unspecified |
---|
I appreciate an automatic approach can quickly get too complicated for an issue relatively minor compared to the rest of gdal development. Perhaps a warning could be issued?
Personally, now that I've tripped over it and know it's there I'll know to step around in future. A warning might save someone else the trouble of trying to figure out what happened.
source and output images