[Gdal-dev] Can't get NoDataValue for dataset

Frank Warmerdam warmerdam at pobox.com
Tue Mar 14 09:27:27 EST 2006


Holywhippet wrote:
>  I'm writing a simple program to extract the data values for each location in
> a raster. As part of this though, I don't want to output the No Data Values.
> For some reason though, Gdal won't give me the No Data Value. When I call
> the GetNoDataValue function (in Python) in the Band class it returns None. I
> tried calling the GDALGetRasterNoDataValue function directly and it returns
> -10000000000.0 for the NDV and -941860_int_p for the success fiag. The
> actual NDV is -3.402823E+38.
> 
>  All the datasets I've been working with are Erdas Imagine type.

Holy Whippet,

-10000000000 is the default nodata value returned for drivers that do not
implement the method.  The "-941860_int_p" is the pointer to the successflag.
You would need to dereference it to know whether things succeeded.

But the very fact that you are getting None back is how the Python interface
indicates there was no value found.

As was discussed just recently on this list (with you?) the GDAL Imagine
driver did not support reading or writing nodata values.  Very recently
(a couple days ago) reading nodata values in the form they are produced by
RDO (the ArcGIS raster data objects component?) was added but unless you
upgraded to CVS or a recently nightly snapshot you won't have that.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list