[Gdal-dev] GeoTiff and nodata values

Kor de Jong k.dejong at geog.uu.nl
Thu Nov 25 05:53:37 EST 2004


Hi,

I am writing some tests for the PCRaster raster driver and have a question 
about the nodata handling of the GeoTiff driver.

For one test I read several kinds of PCRaster files using the GDAL PCRaster 
driver. Each dataset is written using CreateCopy and read again. This way I 
want to check that a written copy of a PCRaster file equals the original.

When I use the PCRaster driver to create copies of the originals all goes 
well.

Using the GeoTiff driver I noticed that for rasters in UINT1 (UInt8) and INT4 
(Int32) all goes well too, but for data in REAL4 (Float32) the missing value 
of the GeoTiff file is set to 0 instead of 1e-30 which is used by the 
PCRaster driver. The cell values of the original PCRaster file and the 
GeoTiff file do equal eachother, it is just that the nodata value of the 
GeoTiff file is not set to the value used in the PCRaster driver. In the 
other cases (UINT1, INT4), the nodata value is correctly copied into the 
GeoTiff.

Does anyone know why the nodata value is handled differently by the GeoTiff 
driver, depending on the type of the cell values?

Best regards,
Kor





More information about the Gdal-dev mailing list