[gdal-dev] RFC 58: Removing Dataset Nodata Value
Even Rouault
even.rouault at spatialys.com
Tue May 19 06:39:13 PDT 2015
Hi Ivan,
>
> Since the SetNoDataValue and GetNodataValue is based on the limitation of
> GeoTiff I would not expect DeleteNoDataValue to be any different. For
> example, there is no way to set/get NoData for individuals bands, there is
> no way to set/get an array of NoData values or NoData value ranges.
More than one nodata value is perhaps better modelled with a nodata mask.
> For
> drivers that support such thinks, the DeleteNoDataValue will probably
> delete all NoData values from the dataset.
Yes, it will for GeoTIFF.
>
> But that is something that can't be resolved by the RFC 58. I think.
That's indeed an orthogonal issue. There's nothing in the absolute that would
prevent from having a per-band nodata value in GeoTIFF. But currently the TIFF
GDAL_NODATA tag is only documented to contain one value. Perhaps a new tag
should be created for per-band nodata values. With the caveat that per-band
nodata isn't always clearly defined: is it really per-band or is the unique
combination (nodata1, nodata2, .... nodataN) the nodata value... ( the later
is the semantics of the special NODATA_VALUES metadata item. See
http://www.gdal.org/gdal_datamodel.html )
>
> Very often, I find unsigned 8 bit images with absurd NoData value, like
> -9999. That is probably a software specific flag value. The problem is
> that in gdal_translate there is no option to prevent that NoData to be
> passed from one format to another. So I am about to implement a value
> range check on the CreateCopy to avoid that.
>
> Would that be feasible to accept the option "-a_nodata NO" on GDAL command
> lines, to indicate that NoData should not pass from the input to the
> output dataset?
Perhaps you're looking for this ;-) ?
<dt> <b>-a_nodata</b> <i>value</i>:</dt><dd>
Assign a specified nodata value to output bands. Starting with GDAL 1.8.0, can
be set to <i>none</i> to avoid setting a nodata value to the output file if
one exists for the source file. Note that, if the input dataset has a
nodata value, this does not cause pixel values that are equal to that nodata
value to be changed to the value specified with this option.</dd>
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list