[gdal-dev] NODATA value in rasters

David Strip gdal at stripfamily.net
Fri Apr 13 18:56:23 EDT 2012


On 4/13/2012 1:50 PM, Carl Godkin wrote:
> 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

Yes, that helps a lot. I'm not sure how I missed 
GDALRasterBand::GetNoDataValue() in my searches, but at least now I know 
how to address the problem I was dealing with.
Thanks.



More information about the gdal-dev mailing list