[gdal-dev] gdalwarp and transparent colors

Oliver Eichler oliver.eichler at gmx.de
Wed Oct 12 06:11:57 EDT 2011


Hi,

if I use gdalwarp to convert a geotiff with nodata set into another one I get a bad result. The nodata value is not taken over and gdalwarp replaces these pixel with whatever colorindex it is. Example files can be found here: 

www.qlandkarte.org/files.tar.gz

f1.tif is the source and f2.tif the target. On the command line I did:

gdalwarp -t_srs EPSG:4326 -ts 983 1008 -co tiled=yes -co compress=LZW f1.tif f2.tif

Sure I know there -dstnodata. And if this would be a single job on the console I would simply use it. But the command line is executed from within an application and the application does not really know about if there is any nodata value in the source. 

I wonder why it's not simply copied with the color table? Do I miss the obvious? Don't tell me to call gdalinfo and to parse it's output. Or to use the GDAL API to open the dataset just to get this information. I would like to avoid that kind of overhead if possible.

Thanks for help

Oliver


More information about the gdal-dev mailing list