<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
On 15/07/15 14:18, Even Rouault wrote:<br>
<span style="white-space: pre;">> On Wednesday 15 July 2015
10:21:54 Homme Zwaagstra wrote:<br>
>> Hello,<br>
>><br>
>> I've got the following raster exported from GRASS using
`r.out.gdal`:<br>
>><br>
>> gdalinfo ppp-2015.tif<br>
>> Driver: GTiff/GeoTIFF<br>
>> Files: ppp-2015.tif<br>
>> ppp-2015.tif.aux.xml<br>
>> Size is 432017, 216009<br>
>> Coordinate System is:<br>
>> GEOGCS["WGS 84",<br>
>> DATUM["WGS_1984",<br>
>> SPHEROID["WGS 84",6378137,298.257223563,<br>
>> AUTHORITY["EPSG","7030"]],<br>
>> AUTHORITY["EPSG","6326"]],<br>
>> PRIMEM["Greenwich",0],<br>
>> UNIT["degree",0.0174532925199433],<br>
>> AUTHORITY["EPSG","4326"]]<br>
>> Origin = (-180.000000000000000,90.000000000000000)<br>
>> Pixel Size = (0.000833300541414,-0.000833298612558)<br>
>> Metadata:<br>
>> AREA_OR_POINT=Area<br>
>> Image Structure Metadata:<br>
>> COMPRESSION=DEFLATE<br>
>> INTERLEAVE=BAND<br>
>> Corner Coordinates:<br>
>> Upper Left (-180.0000000, 90.0000000) (180d 0' 0.00"W,
90d 0' 0.00"N)<br>
>> Lower Left (-180.0000000, -90.0000000) (180d 0' 0.00"W,
90d 0' 0.00"S)<br>
>> Upper Right ( 180.0000000, 90.0000000) (180d 0' 0.00"E,
90d 0' 0.00"N)<br>
>> Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E,
90d 0' 0.00"S)<br>
>> Center ( 0.0000000, 0.0000000) ( 0d 0' 0.01"E,
0d 0' 0.01"N)<br>
>> Band 1 Block=256x256 Type=Float32, ColorInterp=Gray<br>
>> NoData Value=nan<br>
>> Metadata:<br>
>> COLOR_TABLE_RULES_COUNT=5<br>
>> COLOR_TABLE_RULE_RGB_0=0.000000e+00 1.681282e+03 255
255 0 0 255 0<br>
>> COLOR_TABLE_RULE_RGB_1=1.681282e+03 3.362563e+03 0
255 0 0 255 255<br>
>> COLOR_TABLE_RULE_RGB_2=3.362563e+03 5.043845e+03 0
255 255 0 0 255<br>
>> COLOR_TABLE_RULE_RGB_3=5.043845e+03 6.725127e+03 0 0
255 255 0 255<br>
>> COLOR_TABLE_RULE_RGB_4=6.725127e+03 8.406408e+03 255
0 255 255 0 0<br>
>> Generated_with=GRASS GIS 7.0.0<br>
>><br>
>> As you can see the NoData is set to `nan`. However,
within the data it is<br>
>> actually `-nan`:<br>
>><br>
>> gdallocationinfo ppp-2015.tif -wgs84 42.0776 30.9305<br>
>> Report:<br>
>> Location: (266503P,70886L)<br>
>> Band 1:<br>
>> Value: -nan<br>
>><br>
>> I have tried to force the NoData to `-nan` as follows but
with no joy:<br>
>><br>
>> gdal_translate -a_nodata '-nan' -of VRT ppp-2015.tif
ppp-2015.vrt<br>
>><br>
>> gdalinfo ppp-2015.vrt<br>
>> Driver: VRT/Virtual Raster<br>
>> Files: ppp-2015.vrt<br>
>> /data/data/ppp_v2c_2015/ppp-2015.tif<br>
>> Size is 432017, 216009<br>
>> Coordinate System is:<br>
>> GEOGCS["WGS 84",<br>
>> DATUM["WGS_1984",<br>
>> SPHEROID["WGS 84",6378137,298.257223563,<br>
>> AUTHORITY["EPSG","7030"]],<br>
>> AUTHORITY["EPSG","6326"]],<br>
>> PRIMEM["Greenwich",0],<br>
>> UNIT["degree",0.0174532925199433],<br>
>> AUTHORITY["EPSG","4326"]]<br>
>> Origin = (-180.000000000000000,90.000000000000000)<br>
>> Pixel Size = (0.000833300541414,-0.000833298612558)<br>
>> Metadata:<br>
>> AREA_OR_POINT=Area<br>
>> Image Structure Metadata:<br>
>> INTERLEAVE=BAND<br>
>> Corner Coordinates:<br>
>> Upper Left (-180.0000000, 90.0000000) (180d 0' 0.00"W,
90d 0' 0.00"N)<br>
>> Lower Left (-180.0000000, -90.0000000) (180d 0' 0.00"W,
90d 0' 0.00"S)<br>
>> Upper Right ( 180.0000000, 90.0000000) (180d 0' 0.00"E,
90d 0' 0.00"N)<br>
>> Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E,
90d 0' 0.00"S)<br>
>> Center ( 0.0000000, 0.0000000) ( 0d 0' 0.01"E,
0d 0' 0.01"N)<br>
>> Band 1 Block=128x128 Type=Float32, ColorInterp=Gray<br>
>> NoData Value=nan<br>
>> Metadata:<br>
>> COLOR_TABLE_RULES_COUNT=5<br>
>> COLOR_TABLE_RULE_RGB_0=0.000000e+00 1.681282e+03 255
255 0 0 255 0<br>
>> COLOR_TABLE_RULE_RGB_1=1.681282e+03 3.362563e+03 0
255 0 0 255 255<br>
>> COLOR_TABLE_RULE_RGB_2=3.362563e+03 5.043845e+03 0
255 255 0 0 255<br>
>> COLOR_TABLE_RULE_RGB_3=5.043845e+03 6.725127e+03 0 0
255 255 0 255<br>
>> COLOR_TABLE_RULE_RGB_4=6.725127e+03 8.406408e+03 255
0 255 255 0 0<br>
>> Generated_with=GRASS GIS 7.0.0<br>
>><br>
>> Even editing the VRT to contain
`<NoDataValue>-nan</NoDataValue>` yields a<br>
>> positive nan value in gdalinfo.<br>
>><br>
>> This looks like it might be a GDAL bug to me? Is there a
way I can specify<br>
>> `-nan` as the NODATA value for this dataset without
regenerating it<br>
>> (it's quite<br>
>> large)?<br>
><br>
> Hi Homme,<br>
><br>
> I wasn't aware of this negative not a number variation. Could
you create a <br>
> ticket with a small extract of the dataset so as to inspect
the hexadecimal <br>
> representation of this -nan value ?</span><br>
<br>
Thanks Even,<br>
<br>
I have submitted <a class="moz-txt-link-rfc2396E" href="https://trac.osgeo.org/gdal/ticket/6036"><https://trac.osgeo.org/gdal/ticket/6036></a>
with an attached TIFF<br>
infested with `-nan` values.<br>
<br>
While researching this I cam across this question<br>
<a class="moz-txt-link-rfc2396E" href="http://stackoverflow.com/q/3772835"><http://stackoverflow.com/q/3772835></a> which might contain some
information of<br>
interest.<br>
<br>
Let me know if I can do anything else to help.<br>
<br>
Best regards,<br>
<br>
Homme<br>
<br>
<span style="white-space: pre;">><br>
><br>
> Even<br>
><br>
><br>
>><br>
>> Many thanks,<br>
>><br>
>> Homme<br>
>><br>
>> _______________________________________________<br>
>> gdal-dev mailing list<br>
>> <a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
>> <a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
></span><br>
<br>
<br>
</body>
</html>