<div dir="ltr"><div><div><div>Hi Siebe,<br>gdal_translate has the argument -a_nodata but according to the help it won't convert nodata values, only defines them in the new file. <br><a href="http://www.gdal.org/gdal_translate.html" target="_blank">http://www.gdal.org/gdal_translate.html</a><br></div>I think you can use gdalwarp to assign the nodata pixels a distinct value (e.g. -99) in the new file though.<br><a href="http://www.gdal.org/gdalwarp.html" target="_blank">http://www.gdal.org/gdalwarp.html</a><br><br></div>Someone else might know otherwise though.<br></div>ds<br><br><br><div><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 10, 2015 at 9:18 AM, Siebe Bosch <span dir="ltr"><<a href="mailto:siebe@hydroconsult.nl" target="_blank">siebe@hydroconsult.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Dear list,<br>
<br>
I am trying to convert one band from a GRIB2-file into an ASCII
raster, using gdal_translate.<br>
Upon inspection (opening the original raster using the MapWinGis
ActiveX-component) and requesting the nodata_value, I get this:<br>
<br>
? mygrid.Header.NodataValue<br>
-3.40282346638529E+38 {Double}<br>
Double: -3.40282346638529E+38 {Double}<br>
<br>
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)<br>
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!<br>
<br>
So I tried converting to an ERDAS IMG file. Arguments: "-of HFA -b
13"<br>
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<br>
<br>
My conclusion:<br>
<br>
GDAL_Translate does not support numbers smaller than -4.21358e-09.
Am I right? <br>
<br>
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?<br>
<br>
Many thanks,<br>
Siebe<span><font color="#888888"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div>-- <br>
<img src="cid:part1.03010203.09050105@hydroconsult.nl" border="0"></div>
</font></span></div>
<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br></div></div></div>