<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>I need to add dummy internal mask to 1-band GeoTIFF for further processing.</div><div>The drawback of the following approach is that it mask legitimate 0 pixels:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">gdal_translate --config GDAL_TIFF_INTERNAL_MASK YES -mask 1 nomask.tif mask.tif</blockquote><div><br></div><div>The workaround to come over this issue looks like:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">gdal_calc.py -A nomask.tif --calc="1" --outfile=calc_mask.tif<br>gdalbuildvrt -separate result.vrt nomask.tif calc_mask.tif<br>gdal_translate --config GDAL_TIFF_INTERNAL_MASK YES -b 1 -mask 2 result.vrt mask.tif</blockquote><div><br></div><div>Is there an easier way to do the same?</div></div></div></div></div></div>