[gdal-dev] gdal_calc.py else not 0

Benjamin_P benjamin.preisig at metgis.com
Thu Sep 18 03:38:35 PDT 2014


I am trying to reassign 0 values in my raster to 1 and leave all the other
values as they are.

gdal_calc.py -A infile.tif --outfile=outfile.tif --calc="A* logical_or(A <
0, A > 0)" --overwrite --NoDataValue=1

The problem I am encountering is, that I cannot reassign the zeros. In my
calculation I search for all values except zero which gives me 1 which I
multiply with the original value. If the statement is false - for zeros -
ELSE evaluates to 0. How can I tell gdal_calc.py to use another value for
else and how can I add this to my calculation? I was trying to achieve this
with --NoDataValue=1 but this does not help.

Cheers
Benjamin 



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-calc-py-else-not-0-tp5162590.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list