[gdal-dev] remap pixel values using gdalwarp

Martin Chapman chapmanm at pixia.com
Sat Jan 19 18:11:08 PST 2013


I am trying to remap all "0" value pixels in the source images to the
value "1" in the output image using gdalwarp like so:

 

warpOptions->padfSrcNoDataReal[bandIndex] = 0;

warpOptions->padfSrcNoDataImag[bandIndex] = NULL;

warpOptions->padfDstNoDataReal[bandIndex] = 1;

warpOptions->padfDstNoDataImag[bandIndex] = NULL;

 

1. I am setting INIT_DEST=0.

2. not setting UNIFIED_SRC_NODATA.

3. the source images have no defined nodata value.

4. the output image has no defined nodata value.

 

with no luck.  My question is:  Is gdalwarp supposed to do this?  When I
look at the pixel value of the output image the black pixels are still "0"
and not "1".

 

My input and output are both 8-bit 3 band images.  I am using gdal 1.9.2.

 

Best regards,

Martin

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130119/4e4e16a4/attachment.html>


More information about the gdal-dev mailing list