[Gdal-dev] gdalwarp nodata

Richard Greenwood richard.greenwood at gmail.com
Sat Nov 13 13:38:18 EST 2004


On Sat, 13 Nov 2004 13:29:13 -0500, Frank Warmerdam <warmerdam at pobox.com> wrote:
> 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
> 

So would gdalwarp recognize an alpha channel, or would I specify
additional options? I am not too familiar with the use of alpha
channels is it  0->255 corresponding to transparent->opaque?

Yes, an example script would be wonderful, but I don't mean to impose on you.

Thanks,
Rich

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the Gdal-dev mailing list