<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Even,<br>> Date: Wed, 20 Aug 2014 10:28:14 +0200<br><div>> From: even.rouault@spatialys.com<br>> To: lucena_ivan@hotmail.com<br>> CC: gdal-dev@lists.osgeo.org<br>> Subject: Re: [gdal-dev] RFC 15: Band Masks vs #5621<br>> <br>> Ivan,<br>> <br>> You can declare a mask flag to 0 to indicate that this is a per-band mask band.<br>> This is perfectly legal.<br><br>OK. That should works.<br><br>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. <br><br>> You might decide either to set NBITS=1 as metadata to that mask band, or promote<br>> it to full 8 bit (0->0, 1->255).<br>> As far as which format natively supports that, I can't think to any. However the<br>> generic handling in an external .msk file should be able to deal with that, so<br>> hopefully CreateCopy() will generate a .msk file. FYI, as far as internal mask<br>> is concerned, the TIFF specification only allows per-dataset masks (we support<br>> in reading an extension to per-band masks, but we don't generate that)<br>> The generic overview computation code should also be able to generate overviews<br>> of mask band.<br>> You can also play with VRT that should support per-dataset or per-band mask<br>> band.<br><br>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?<br><br>Well, I guess that is something to be tested.<br><br>Thanks,<br><br>Ivan<br><br>> And you can have a look at autotest/gcore/mask.py to have a sense of what is<br>> supported.<br><br>I will check that.<br><br>> <br>> Even<br>> <br>> > That question is probably for Even, Frank or some the developer of drivers<br>> > that support mask band.<br>> ><br>> > I am working on ticket #5621 and trying to adapt it to the RFC 15 but I am<br>> > not quite sure that I am getting it right.<br>> ><br>> > In GeoRaster, I can have a bitmap mask band that can be applied to all bands,<br>> > similar to the concept of GMF_PER_DATASET, I guess. I can also have one<br>> > bitmap mask band per raster band, but that does not correspond to the others<br>> > mask flags (GMF_ALL_VALID, GMF_ALHA, GMF_NO_DATA). The data type of my bitmap<br>> > mask is 1 bit, and there is no implicit connection with Alpha Channel or No<br>> > Data in a binary bitmap mask, of course.<br>> ><br>> > So if I have a dataset with just one bitmap mask shared between all the<br>> > bands, I think I can return the flag GMF_PER_DATASET and promote the values<br>> > to GDT_BYTE. But if I have bitmap masks for each raster bands, then I don't<br>> > know what flag to return. I might just lie and say "GMF_PER_DATASET" and when<br>> > the mask is requested I will take care of returning the correct one.<br>> ><br>> > Would that works for others drivers participating on<br>> > gdal_translate/CreateCopy()?<br>> ><br>> > Of course, if the output driver support just one mask per dataset, there is<br>> > nothing much we can do.<br>> ><br>> > By the way, are there any driver that support overviews of mask band?<br>> ><br>> > Regards,<br>> ><br>> > Ivan<br>> ><br>> <br>> <br>> -- <br>> Spatialys - Geospatial professional services<br>> http://www.spatialys.com<br></div> </div></body>
</html>