[GRASS-user] Re: [GRASS-dev] gdal import an nodata cells
Frank Warmerdam
warmerdam at pobox.com
Fri Jul 20 15:02:32 EDT 2007
Michael Perdue wrote:
> Ops... Looks like Geotiff does allow for storing no-data values. But HFA
> (not too sure which format IMA is) and others don't appear too.
Michael,
Note that GeoTIFF does not *generally* support nodata values, but there is
a GDAL specific tag used by GDAL and GDAL based software to keep track of
nodata values.
> Question?
>
> is float(nan) equal to double(nan)?
They are not the same as the binary level of course. I don't know if
they compare as equal in C or not. Hopefully they do.
However, GDAL does *not* generally recognise NaN as a nodata value.
> If not, does gdal_translate
> understand this when it converts a file stored as float64 to float32?
> gdal_translate allows one to define what the no-data value is, but how
> do I tell it to change the input no-data value to a different output
> no-data value? IE, the no-data value in my surfer file is a double
> precision nan, but I want the no-data value in my output GeoTiff
> (float32) to be -32767. -a_nodata changes the header no-data definition
> but does not change the values of the pixels that represent no-data.
I'm not aware of a practical way of doing this. Sorry.
You are likely best off fixing this up in GRASS which is more
flexible.
(BTW, GDAL does support double precision geotiff files)
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 OSGeo, http://osgeo.org
More information about the grass-user
mailing list