[gdal-dev] NODATA value in rasters
Carl Godkin
cgodkin at gmail.com
Fri Apr 13 15:50:08 EDT 2012
On Fri, Apr 13, 2012 at 12:07 PM, David Strip <gdal at stripfamily.net> wrote:
> What data formats besides geotiff support a NODATA value? Is there a
> uniform GDAL approach to determining the NODATA value or otherwise
> determining if a pixel is a NODATA pixel? I know that this value is stored
> in a geotiff tag, but that won't work for other formats.
>
>
>
>
I think a lot of formats support the concept of NODATA. The GDAL API has
functions for checking for this in the GDALRasterBand class, for instance,
as
double GDALRasterBand::GetNoDataValue() in the C++ or in the C API
as GDALGetRasterNoDataValue().
I've found that this sometimes works, but not always. What I do is to read
the raster data and change everything outside the minimum to maximum range
(returned by two other API functions) to my own software's NODATA value.
Hope that helps,
carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120413/b67b8cc1/attachment.html
More information about the gdal-dev
mailing list