[Gdal-dev] gdalwarp nodata

Frank Warmerdam warmerdam at pobox.com
Sat Nov 13 13:29:13 EST 2004


Richard Greenwood wrote:
> I am using gdalwarp to merge some images. The images are rgb tiffs.
> No-data pixels in the source image are r=255 g=255 b=255. I am using:
>   -srcnodata  "255 255 255"
> This masking seems to operate on a band by band basis, rather than a
> pixel by pixel basis. Which is leading to some rather bizarre output
> colors. Is my -srcnodata definition correct, or is there some other
> way to deal with this?

Rich,

I'm afraid you are right that it operates on a band by band basis rather
than decided if a pixel as a whole is nodata or not.  There is no approach
to accomplish what you want directly with gdalwarp, though you could
preprocess your imagery to have an alpha band, and set the transparency
in it based on your nodata criteria.

If you would like, I could prepare a sample python script that accomplishes
this as a demonstration.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list