I need to set a 3 band multiband raster (GeoTIff) where band 1 = 0 AND band 2 = 0 AND band 3 = 0 then this is no data (0,0,0 is No Data). Not OR in each band but AND across the 3 bands.
I think it is GDALWARP -dstnodata but am unsure of the syntax.
How do I set the No Data value as 0,0,0 in the header?
Best Answer
The syntax is documented on the manual page https://www.gdal.org/gdalwarp.html as
On Windows it means double quotation marks, on Linux I guess that single quotes work. So in theory you would do it like this
However, the target format must also support different nodata values for each band and GeoTIFF is not such format.
So you can't do what you want with GeoTIFF because the one and only supported nodata value gets just overwritten and finally all bands use the nodata value of the blue band as nodata.
If you use GDAL based software for reading your data then GDAL virtual raster (VRT) might be the best option. As you can see it can handle band specific nodata.