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

Ivan Lucena lucena_ivan at hotmail.com
Wed Aug 20 10:45:27 PDT 2014


Even,
> Date: Wed, 20 Aug 2014 10:28:14 +0200
> From: even.rouault at spatialys.com
> To: lucena_ivan at hotmail.com
> CC: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] RFC 15: Band Masks vs #5621
> 
> Ivan,
> 
> You can declare a mask flag to 0 to indicate that this is a per-band mask band.
> This is perfectly legal.

OK. That should works.

Back in 1.6 when I developed that code I think the idea was a little bit different. We tried to support just what GeoTiff would support. I will try that approach. 

> You might decide either to set NBITS=1 as metadata to that mask band, or promote
> it to full 8 bit (0->0, 1->255).
> As far as which format natively supports that, I can't think to any. However the
> generic handling in an external .msk file should be able to deal with that, so
> hopefully CreateCopy() will generate a .msk file. FYI, as far as internal mask
> is concerned, the TIFF specification only allows per-dataset masks (we support
> in reading an extension to per-band masks, but we don't generate that)
> The generic overview computation code should also be able to generate overviews
> of mask band.
> You can also play with VRT that should support per-dataset or per-band mask
> band.

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?

Well, I guess that is something to be tested.

Thanks,

Ivan

> And you can have a look at autotest/gcore/mask.py to have a sense of what is
> supported.

I will check that.

> 
> Even
> 
> > That question is probably for Even, Frank or some the developer of drivers
> > that support mask band.
> >
> > I am working on ticket #5621 and trying to adapt it to the RFC 15 but I am
> > not quite sure that I am getting it right.
> >
> > In GeoRaster, I can have a bitmap mask band that can be applied to all bands,
> > similar to the concept of GMF_PER_DATASET, I guess. I can also have one
> > bitmap mask band per raster band, but that does not correspond to the others
> > mask flags (GMF_ALL_VALID, GMF_ALHA, GMF_NO_DATA). The data type of my bitmap
> > mask is 1 bit, and there is no implicit connection with Alpha Channel or No
> > Data in a binary bitmap mask, of course.
> >
> > So if I have a dataset with just one bitmap mask shared between all the
> > bands, I think I can return the flag GMF_PER_DATASET and promote the values
> > to GDT_BYTE. But if I have bitmap masks for each raster bands, then I don't
> > know what flag to return. I might just lie and say "GMF_PER_DATASET" and when
> > the mask is requested I will take care of returning the correct one.
> >
> > Would that works for others drivers participating on
> > gdal_translate/CreateCopy()?
> >
> > Of course, if the output driver support just one mask per dataset, there is
> > nothing much we can do.
> >
> > By the way, are there any driver that support overviews of mask band?
> >
> > Regards,
> >
> > Ivan
> >
> 
> 
> -- 
> Spatialys - Geospatial professional services
> http://www.spatialys.com
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140820/aaa5bc25/attachment.html>


More information about the gdal-dev mailing list