[gdal-dev] How to add an external mask as internal mask to a GeoTIFF?
Daniele Romagnoli
daniele.romagnoli at geo-solutions.it
Tue Jul 19 06:52:36 PDT 2016
On Tue, Jul 19, 2016 at 3:34 PM, Even Rouault <even.rouault at spatialys.com>
wrote:
> Le mardi 19 juillet 2016 15:27:05, Daniele Romagnoli a écrit :
> > Hi Even,
> > thanks for the feedback.
> >
> > I was using it as a -co "GDAL_TIFF_INTERNAL_MASK=YES" to the latest
> command
> > and I was getting
> >
> > *Warning 6: driver GTiff does not support creation option
> > GDAL_TIFF_INTERNAL_MASK*
> > Appending the line you provided me to that command worked!
>
> Yes, there is some confusion around configuration options vs creation
> options,
> and you must be careful about the terminology used in the documentation.
>
> "Configuration options" are specified either with "--config name value" or
> as
> environmenet variables or with CPLSetConfigOption(name,value) in C
>
> "Creation options" are specified with gdal_translate -co name=value or as
> "name=value" strings in the papszOptions argument of Create()/CreateCopy()
> methods in C/C++
>
> 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.
Thanks for the clarification. Very helpful.
Cheers,
Daniele
> GDAL_TIFF_INTERNAL_MASK is a configuration option since it can be used on
> an
> existing TIFF opened in update mode, to which you add a mask. Thus a
> creation
> option couldn't be used in that case (since a creation option is for when
> the
> target file does not exist yet).
>
>
> > Thanks.
> > Daniele
> >
> >
> > On Tue, Jul 19, 2016 at 3:12 PM, Even Rouault <
> even.rouault at spatialys.com>
> >
> > wrote:
> > > Hi Daniele,
> > >
> > > > I have 2 issues with that:
> > > > 1) This solution is really not optimal. Wondering if there is a
> single
> > > > command to attach an external tif as a mask band of an existing
> raster
> > > > (provided it has same CRS, resolution, bbox, ecc)
> > >
> > > None that I can think of. Your workflow is probably close to optimum if
> > > you don't want to create the VRT at hand
> > >
> > > I think we would welcome a contribution of a Python script that would
> > > allow things like :
> > > - gdal_add_band.py -mask in.tif mask.tif out.vrt
> > > - gdal_add_band.py -alpha in.tif alpha.tif out.vrt
> > > - gdal_add_band.py in.tif extra_band.tif out.vrt
> > >
> > > > 2) What I get is that the mask has been set as an external file
> > > > final.tif.msk.
> > > > Is there any config option or opening option to open the final.tif in
> > > > update mode so that the band mask can be added as internal geotiff
> > > > mask?
> > >
> > > Yes, "--config GDAL_TIFF_INTERNAL_MASK YES". See "Internal nodata
> masks"
> > > paragraph of http://gdal.org/frmt_gtiff.html
> > >
> > > Even
> > >
> > > --
> > > Spatialys - Geospatial professional services
> > > http://www.spatialys.com
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Daniele Romagnoli
Senior Software Engineer
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160719/edac44c6/attachment-0001.html>
More information about the gdal-dev
mailing list