[gdal-dev] Create dummy internal mask

Denis Rykov rykovd at gmail.com
Sun Sep 2 07:43:51 PDT 2018


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180902/d5d5fd31/attachment.html>


More information about the gdal-dev mailing list