Opened 7 years ago

Closed 7 years ago

#7076 closed defect (fixed)

gdal_translate doesn't take into account nodata values neither from VRT nor from PAM.

Reported by: AlexNI Owned by: warmerdam
Priority: high Milestone:
Component: Utilities Version: 2.1.3
Severity: major Keywords: gdal_translate nodata VRT PAM
Cc:

Description

gdal_translate when scaling data doesn't take into account nodata value neither from VRT file (created for a raster) specified as

<NODATA>9999</NODATA>

nor from PAM file specified as

<NoDataValue>9999</NoDataValue>

Although gdalinfo reads and shows these values properly. The problem arises in VRTComplexSource::RasterIOInternal, where m_bNoDataSet stays undefined for the cases. As a result nodata values scaled as well as simple values.

Attachments (4)

dummy.vrt (976 bytes ) - added by AlexNI 7 years ago.
dummy.tif (18.9 KB ) - added by AlexNI 7 years ago.
dummy4pam.tif (19.4 KB ) - added by AlexNI 7 years ago.
dummy4pam.tif.aux.xml (109 bytes ) - added by AlexNI 7 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Even Rouault, 7 years ago

Please share your VRT file and the command you try.

by AlexNI, 7 years ago

Attachment: dummy.vrt added

by AlexNI, 7 years ago

Attachment: dummy.tif added

by AlexNI, 7 years ago

Attachment: dummy4pam.tif added

by AlexNI, 7 years ago

Attachment: dummy4pam.tif.aux.xml added

comment:2 by AlexNI, 7 years ago

Sorry, checked it in GDAL version 2.2.2 and it works fine for either cases!

comment:3 by AlexNI, 7 years ago

gdal_translate -scale 1 65535 101 65635 "dummy.vrt" "dummy_out.tif"

comment:4 by AlexNI, 7 years ago

gdal_translate -scale 1 65535 101 65635 "dummy4pam.tif" "dummy4pam_out.tif"

comment:5 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.