[gdal-dev] Masks vs nodata?

Sean Gillies sean at mapbox.com
Mon Apr 20 09:50:11 PDT 2015


Hi all,

Not being able to unset nodata values for datasets is tripping up GDAL
users at work. I'm considering measures that require 1-bit internal masks
(we're primarily using GeoTIFF) instead of nodata values because, unlike
nodata, the masks can be "cleared" by setting them uniformly to True using
the GDAL API (GDALFillRaster() specifically).

Background: the GeoTIFF driver's SetNoDataValue() method doesn't let us
remove or set a null or empty nodata value or unset the bNoDataSet flag.
Passing a value outside the range of values in the dataset can be
problematic, especially for 8-bit data. Passing -inf, nan, or 256 to
SetNoDataValue() has the same effect on derived masks as passing 0.

I'm looking for expert advice on consequences of using masks instead of
nodata values. Are there features of GDAL that rely on nodata values and
don't respond to masks? Are there adverse implications for
interoperability? Would it be better to simply accept nodata values as
being part of the structure of datasets, like tiling and interleaving, and
immutable once set?

Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150420/534d35d0/attachment.html>


More information about the gdal-dev mailing list