[gdal-dev] gdal_translate truncates nodata_value < -4.21358e-09

Siebe Bosch siebe at hydroconsult.nl
Fri Apr 10 13:17:21 PDT 2015


Thanks Even,

I started with the implementation of GDAL in MapWinGIS, but I also tried 
it with my stand-alone installation of GDAL
I'm using the precompiled windows-version, 32bit from 18 jan 2015 bit by 
Tamas: release-1800-gdal-1-11-1-mapserver-6-4-1 
<http://www.gisinternals.com/query.html?content=filelist&file=release-1800-gdal-1-11-1-mapserver-6-4-1.zip>
However still I get an ascii grid with xxxE9 in nodata-cells.

If I look in my GDAL\bin directory I see a gdal111.dll there, so it must 
be the correct version I'm using.

for the record: this is my batchfile's contents:
setx PATH "C:\GDAL\bin"
"c:\GDAL\bin\gdal\apps\gdal_translate.exe" -of AAIGrid -b 13 
C:\Temp\H11_V7_NED_SINGLE_LEVEL_2011013018_000_GB c:\temp\tempgrid.asc

So version is ok, path is ok.
Is it possible that all DLL's have been updated in this package, but 
that the stand-alone tools are outdated?

Thanks,
Siebe









-------- Forwarded Message --------
Subject: 	Re: [gdal-dev] gdal_translate truncates nodata_value < 
-4.21358e-09
Date: 	Fri, 10 Apr 2015 18:28:04 +0200
From: 	Even Rouault <even.rouault at spatialys.com>
To: 	gdal-dev at lists.osgeo.org
CC: 	Siebe Bosch <siebe at hydroconsult.nl>



Le vendredi 10 avril 2015 17:18:04, Siebe Bosch a écrit :
> 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!

Are you using GDAL 1.11 or above ? It should output values with "%.20g"
formatting by default. See end of http://trac.osgeo.org/gdal/ticket/3732

>
> 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

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150410/f41a14fe/attachment.html>


More information about the gdal-dev mailing list