[gdal-dev] why do I get a floating point nodata value from a byte raster?

Richard Sharp richsharp at stanford.edu
Thu Aug 28 14:32:38 PDT 2014


I have a byte GTiff dataset that has a nodata value of 0 according to QGIS.
 However, when I load it using the gdal python API, I get this:

>>> ds= gdal.Open('cdl10lu83.tif')
>>> band=ds.GetRasterBand(1)
>>> band.GetNoDataValue()
-3.4028230607370965e+38

Also when I run `gdalinfo` I see the same nodata value:

Band 1 Block=128x128 Type=Byte, ColorInterp=Gray
  Min=0.000 Max=26.000
  Minimum=0.000, Maximum=26.000, Mean=10.115, StdDev=5.072
  NoData Value=-3.4028230607370965e+038

I'm running GDAL 1.11.0, although I've also experienced the same behavior
on gdalinfo with 1.9.0. I'm using QGIS 2.4 which is built against GDAL 1.9.

Any ideas what's going on and how to handle it?

--
Richard P. Sharp Jr.
Lead Software Architect
Natural Capital Project
Stanford University, U Minnesota, TNC, WWF
371 Serra Mall
Stanford, CA 94305
http://www.stanford.edu/~rpsharp/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140828/a8ecf86d/attachment.html>


More information about the gdal-dev mailing list