[gdal-dev] gdal_translate truncates nodata_value < -4.21358e-09
Siebe Bosch
siebe at hydroconsult.nl
Fri Apr 10 08:18:04 PDT 2015
Dear list,
I am trying to convert one band from a GRIB2-file into an ASCII raster,
using gdal_translate.
Upon inspection (opening the original raster using the MapWinGis
ActiveX-component) and requesting the nodata_value, I get this:
? mygrid.Header.NodataValue
-3.40282346638529E+38 {Double}
Double: -3.40282346638529E+38 {Double}
So far, so good. Now l tried to convert to ASCII using gdal_translate,
with the arguments "-of AAIGrid -b 13" (to ASC, band #13)
Much to my surprise the nodata-value (inside the grid) has changed in
-4.2135788191899337e-009. A NODATA_value in the header has not been set
at all!
So I tried converting to an ERDAS IMG file. Arguments: "-of HFA -b 13"
Inspecting the results in QGIS I see in the metadata that the
"nodata-value has not been set". The grid itself however contains data
of the Float type, and the cells that should have nodata-values have now
values of -4.21358e-09
My conclusion:
GDAL_Translate does not support numbers smaller than -4.21358e-09. Am I
right?
The problem however is that I do need the nodata-cells to be recognized
correctly. Is there any tool that can help me to correct this? E.g. can
I change the nodata-value of the original (multi-band) grid on forehand?
Or are there additional arguments for gdal_translate that allow values
up to the original nodata_value?
Many thanks,
Siebe
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150410/085b6cd4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature_60pct.gif
Type: image/gif
Size: 30165 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150410/085b6cd4/attachment-0001.gif>
More information about the gdal-dev
mailing list