[gdal-dev] mask bands howto
schut at sarvision.nl
Thu Sep 25 07:06:51 EDT 2008
Thanks for the info, both.
Major lesson: after ds creation, first close it, than open it GA_Update,
Another question: it seems (geotiff, external) masks are of dtype byte?
So they are not *bit*masks and will use 8 times more space than strictly
required (when no compression is used)? I thought the tiff spec allowed
for 1-bit datatypes (mainly used for fax data probably)...
And, apart from the wasted space (I use compression anyway), I'd like to
know the mask value conventions. I mean, a pixel in a mask could have
values from 0-255, not? Which one is True (masked), which one is
False(unmasked)? 'Cause if I give it a bool numpy array to write to the
mask (using gdal_array), it complains about incompatible datatypes...
Even Rouault wrote:
> You can also take inspiration from the python autotest suite :
> Le Wednesday 24 September 2008 16:37:27 Vincent Schut, vous avez écrit :
>> is there any up-to-date documentation/tutorial available on the recently
>> added mask bands feature? I found
>> http://trac.osgeo.org/gdal/wiki/rfc15_nodatabitmask, but I was hoping
>> more on something like an api tutorial. The doxygen generated stuff all
>> is empty for mask related functions...
>> Specifically, I'd like to know if it is possible to (using swig python)
>> create a DS (gtiff), and then write boolean data into
>> ds.GetRasterBand(1).GetMaskBand()? Or should I call CreateMaskBand
>> first? This is not entirely clear to me...
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
More information about the gdal-dev