Ticket #1949 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

gdalwarp ignoring nodata values on source dataset

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone: 1.5.0
Component: Utilities Version: unspecified
Severity: normal Keywords: warper nodata
Cc:

Description

It appears gdalwarp and the underlying warper ignore nodata values set on the source dataset, and require the user to specify the value using -srcnodata. A similar issue may exist for -dstnodata.

Do:

gdalwarp -tr 500 500 in.tif -rb out1.tif
gdalwarp -tr 500 500 in.tif -rb out2.tif -srcnodata -32768

Note that out1.tif has interpolated values around the fringe of the valid data even though -32768 is marked as the nodata value.

Attachments

in.tif Download (20.0 KB) - added by warmerdam 6 years ago.
input geotiff with nodata specified

Change History

Changed 6 years ago by warmerdam

input geotiff with nodata specified

Changed 6 years ago by rouault

Issue about missing -dstnodata is confirmed by #1945

Changed 6 years ago by rouault

Already reported as #1257

Changed 6 years ago by warmerdam

  • status changed from new to closed
  • resolution set to fixed

I have modified gdalwarp.cpp to default to using nodata values from the source image if -srcnodata not specified. I also added support for "-srcnodata None" to ignore nodata values on the source image. Changes are in trunk (r12577). I don't consider this change suitable to take back to 1.4 branch.

Note: See TracTickets for help on using tickets.