[gdal-dev] RFC 15: Band Masks vs #5621

Even Rouault even.rouault at spatialys.com
Thu Aug 21 05:23:24 PDT 2014


Selon Ivan Lucena <lucena_ivan at hotmail.com>:

> Hi Even,
>
> > From: even.rouault at spatialys.com
> > To: lucena_ivan at hotmail.com
> > Subject: Re: [gdal-dev] RFC 15: Band Masks vs #5621
> > Date: Wed, 20 Aug 2014 20:39:29 +0200
> > CC: gdal-dev at lists.osgeo.org
> >
> > >
> > > I am trying to help a developer how wants to use VRTs as an intermediary
> > > between a GeoRaster and a PNG, in order to produce thumbnails. In that
> > > case, does the VRT needs to describe the mask band so that the PNG's
> > > driver will received the filtered image, with the zeroes regions masked
> > > out?
> >
> > You need to explicitely declare mask bands in the VRT. See the VRT
> > documentation for that. But that will just declare the existence of the
> mask
> > band, and will not do any processing such as zeroing masked regions.
>
> You are right. GDAL can copy the mask from one dataset to another, depending
> on the driver.
>
> But there is no way to indicate that you want the result of the masking, not
> in the API, not on command line tools.
>
> Maybe we should add that to the wish list.

Eh eh seems there is no limit to the wish list ;-)
More seriously, I can imagine this could be done through a new VRT mechanism,
that could be triggered by a new option of gdal_translate

That would be mostly needed for per-band mask, since for per-dataset mask, you
can already trick the mask to be considered as an alpha band (e.g.
gdal_translate -b 1 -b 2 -b 3 -b mask in.tif out.tif will transform a RGB+mask
into a RGBA dataset).
For per-band mask, the value of the pixels that are masked should also be
specified in the VRT syntax.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list