I am trying to process some bioclimatic raster files, such as can be downloaded from http://www.worldclim.org/current (bioclim set). They seem to have nodata values set to -3.4e+38
according to QGIS (looking at the output of gdalinfo, it's -3.39999999999999996e+38
).
It seems that gdal tools aren't able to deal with this nodata value, and qgis doesn't seem to be able to recognise it either. In the layer styling, there's an entry for -3.4e+38 set to 100% transparent, but it still displays such values, even though the "Identify features" picker shows them as having value -3.4e+38.
I have tried creating a vrt to convert the nodata values to -9999 instead, but that hasn't worked either.
How can I process such files to have usable nodata values?
Answer
GDAL can handle these values. In fact GDAL's default NoData value is pretty much the same as yours. I think the problem is a floating point error in QGIS though. I have the same problem with floating point NoData values.
If you want to change the NoData value using GDAL you could use gdalwarp or perhaps gdal_translate and set the nodata value to an integer from there (-dstnodata and -a_nodata respectively). For inastance, I have had success setting my NoData Value to -999 in a 64bit float raster in the past. However, given that we've established there is a floating point issue in this regard, I wouldn't like to guarantee this will work in all cases though.
No comments:
Post a Comment