Hi,

I need to add dummy internal mask to 1-band GeoTIFF for further processing.
The drawback of the following approach is that it mask legitimate 0 pixels:

gdal_translate --config GDAL_TIFF_INTERNAL_MASK YES -mask 1 nomask.tif
> mask.tif


The workaround to come over this issue looks like:

gdal_calc.py -A nomask.tif --calc="1" --outfile=calc_mask.tif
> gdalbuildvrt -separate result.vrt nomask.tif calc_mask.tif
> gdal_translate --config GDAL_TIFF_INTERNAL_MASK YES -b 1 -mask 2
> result.vrt mask.tif


Is there an easier way to do the same?
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to