[gdal-dev] gdal_calc.py and NoData issues

Andreas Neumann a.neumann at carto.net
Wed Nov 19 04:49:48 PST 2014


Hi,

I have an issue with gdal_calc.py and nodata values.

My input data contains a lot of white pixels. After running gdal_calc.py 
with the following parameters

gdal_calc.py -A test.tif --outfile=testcalc.tif 
--calc="(A==249)*255+(A<>249)*A"

it turns out that all pixel values with 255 are now nodata values ;-( Is 
there an option so that my 255 values are not turned into nodata? I 
tested with the --NoDataValue option (e.g. 99 - which I don't use in the 
image), but it seems to be ignored. For me it is important that black 
and white pixels are preserved.

Thanks for any hints,
Andreas


More information about the gdal-dev mailing list