<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 19, 2016 at 3:34 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">Le mardi 19 juillet 2016 15:27:05, Daniele Romagnoli a écrit :<br>
> Hi Even,<br>
> thanks for the feedback.<br>
><br>
> I was using it as a -co "GDAL_TIFF_INTERNAL_MASK=YES" to the latest command<br>
> and I was getting<br>
><br>
</span>> *Warning 6: driver GTiff does not support creation option<br>
> GDAL_TIFF_INTERNAL_MASK*<br>
<span class="">> Appending the line you provided me to that command worked!<br>
<br>
</span>Yes, there is some confusion around configuration options vs creation options,<br>
and you must be careful about the terminology used in the documentation.<br>
<br>
"Configuration options" are specified either with "--config name value" or as<br>
environmenet variables or with CPLSetConfigOption(name,value) in C<br>
<br>
"Creation options" are specified with gdal_translate -co name=value or as<br>
"name=value" strings in the papszOptions argument of Create()/CreateCopy()<br>
methods in C/C++<br>
<br></blockquote><div>Right, when seeing that option on some previous commands in my shell history, I have confused it as a Create option instead of a Configuration one.<br>Thanks for the clarification. Very helpful.<br></div><br><div>Cheers,<br></div>Daniele<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_TIFF_INTERNAL_MASK is a configuration option since it can be used on an<br>
existing TIFF opened in update mode, to which you add a mask. Thus a creation<br>
option couldn't be used in that case (since a creation option is for when the<br>
target file does not exist yet).<br></blockquote><div><br><br><br><br><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">
<div class=""><div class="h5"><br>
> Thanks.<br>
> Daniele<br>
><br>
><br>
> On Tue, Jul 19, 2016 at 3:12 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>><br>
><br>
> wrote:<br>
> > Hi Daniele,<br>
> ><br>
> > > I have 2 issues with that:<br>
> > > 1) This solution is really not optimal. Wondering if there is a single<br>
> > > command to attach an external tif as a mask band of an existing raster<br>
> > > (provided it has same CRS, resolution, bbox, ecc)<br>
> ><br>
> > None that I can think of. Your workflow is probably close to optimum if<br>
> > you don't want to create the VRT at hand<br>
> ><br>
> > I think we would welcome a contribution of a Python script that would<br>
> > allow things like :<br>
> > - gdal_add_band.py -mask in.tif mask.tif out.vrt<br>
> > - gdal_add_band.py -alpha in.tif alpha.tif out.vrt<br>
> > - gdal_add_band.py in.tif extra_band.tif out.vrt<br>
> ><br>
> > > 2) What I get is that the mask has been set as an external file<br>
> > > final.tif.msk.<br>
> > > Is there any config option or opening option to open the final.tif in<br>
> > > update mode so that the band mask can be added as internal geotiff<br>
> > > mask?<br>
> ><br>
> > Yes, "--config GDAL_TIFF_INTERNAL_MASK YES". See "Internal nodata masks"<br>
> > paragraph of <a href="http://gdal.org/frmt_gtiff.html" rel="noreferrer" target="_blank">http://gdal.org/frmt_gtiff.html</a><br>
> ><br>
> > Even<br>
> ><br>
> > --<br>
> > Spatialys - Geospatial professional services<br>
> > <a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8px">==</span><br></div><div dir="ltr"><span style="font-size:12.8px">GeoServer Professional Services from the experts! Visit</span><br style="font-size:12.8px"><a href="http://goo.gl/it488V" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">http://goo.gl/it488V</a><span style="font-size:12.8px"> for more information.</span><br>
==<br>
<br>Ing. Daniele Romagnoli<br>Senior Software Engineer<br><br>GeoSolutions S.A.S.<br><span style="font-size:12.8px">Via di Montramito 3/A</span><br>55054  Massarosa (LU)<br>Italy<br>phone: +39 0584 962313<br>fax:      +39 0584 1660272<br><br><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a><br><a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a><br><br>-------------------------------------------------------<br><p><span lang="IT"><font size="1"><b>AVVERTENZE AI SENSI DEL D.Lgs. 196/2003</b></font></span></p><p><span lang="IT"><font size="1">Le
 informazioni contenute in questo messaggio di posta elettronica e/o 
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il 
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
 per le finalità indicate nel messaggio stesso. Qualora riceviate questo
 messaggio senza esserne il destinatario, Vi preghiamo cortesemente di 
darcene notizia via e-mail e di procedere alla distruzione del messaggio
 stesso, cancellandolo dal Vostro sistema. Conservare il messaggio 
stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, 
copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento
 contrario ai principi dettati dal D.Lgs. 196/2003.</font></span></p><p><span lang="IT"><font size="1"> </font></span></p><p><font size="1">The
 information in this message and/or attachments, is intended solely for 
the attention and use of the named addressee(s) and may be confidential 
or proprietary in nature or covered by the provisions of privacy act 
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection 
Code).Any use not in accord with its purpose, any disclosure, 
reproduction, copying, distribution, or either dissemination, either 
whole or partial, is strictly forbidden except previous formal approval 
of the named addressee(s). If you are not the intended recipient, please
 contact immediately the sender by telephone, fax or e-mail and delete 
the information in this message that has been received in error. The 
sender does not give any warranty or accept liability as the content, 
accuracy or completeness of sent messages and accepts no responsibility 
 for changes made after they were sent or for other risks which arise as
 a result of e-mail transmission, viruses, etc.</font></p><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>