<div dir="ltr">Hi Even.<div>Thanks for the feedback.<br></div><div><br></div><div>Sorry... I'm using GDAL 1.11.3.</div><div>I'm going to double check to make sure I didn't make any mistake.<br></div><div>I'll let you know.</div><div><br></div><div>Cheers,</div><div>Daniele</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 2, 2016 at 2:49 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le lundi 02 mai 2016 14:37:39, Daniele Romagnoli a écrit :<br>
> Hi List,<br>
><br>
> I have a reprojectiion tool which creates GeoTIFFs with NoData = NaN.<br>
> I'm creating couple of GeoTIFFs with partially overlapping areas where<br>
> GeoTIFF1 has NaNs in a region and GeoTIFF2 has proper values in the same<br>
> overlapping region and viceversa (GeoTIFF2 has some NaN area while GeoTIFF1<br>
> has valid pixels for same area).<br>
> I have built a VRT on top of them and then translated into a single<br>
> GeoTIFF. However, the result has NaN in those regions.<br>
> I was hoping that the area containing NaNs would have been ignored instead,<br>
> in favor of proper values from the other file.<br>
> Is there any flag, properties or suggestions to make it working?<br>
><br>
> If I configure the reprojection tool to write NoData = -9999 and then use<br>
> gdalbuildvrt -srcnodata -9999, things are working fine.<br>
> So I'm just wondering if the same can be achieved dealing with NaN instead<br>
> of custom values.<br>
<br>
</span>Daniele,<br>
<br>
You didn't mention which GDAL version you use. It is possible that support for<br>
NaN as a nodata value in gdalbuildvrt & the VRT driver was fixed at some point.<br>
>From a quick test with trunk, it works  (works with 1.11 branch as well):<br>
<br>
$ cat in1.asc<br>
ncols        3<br>
nrows        3<br>
xllcorner    440720.000000000000<br>
yllcorner    3750120.000000000000<br>
cellsize     60.000000000000<br>
NODATA_value    nan<br>
 1.0 1.0 1.0<br>
 1.0 nan 1.0<br>
 1.0 1.0 1.0<br>
<br>
$ cat in2.asc<br>
ncols        3<br>
nrows        3<br>
xllcorner    440720.000000000000<br>
yllcorner    3750120.000000000000<br>
cellsize     60.000000000000<br>
NODATA_value    nan<br>
 nan nan nan<br>
 nan 2.0 nan<br>
 nan nan nan<br>
<br>
$ gdalbuildvrt nan.vrt in1.asc in2.asc<br>
<br>
$ gdal_translate nan.vrt /vsistdout/ -of aaigrid<br>
ncols        3<br>
nrows        3<br>
xllcorner    440720.000000000000<br>
yllcorner    3750120.000000000000<br>
cellsize     60.000000000000<br>
NODATA_value    nan<br>
      1      1      1<br>
      1      2      1<br>
      1      1      1<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Even<br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8px">==</span><br></div><div dir="ltr"><span style="font-size:12.8000001907349px">GeoServer Professional Services from the experts! Visit</span><br style="font-size:12.8000001907349px"><a href="http://goo.gl/it488V" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank">http://goo.gl/it488V</a><span style="font-size:12.8000001907349px"> for more information.</span><br>
==<br>
<br>Ing. Daniele Romagnoli<br>Senior Software Engineer<br><br>GeoSolutions S.A.S.<br><span style="font-size:12.8px">Via di Montramito 3/A</span><br>55054  Massarosa (LU)<br>Italy<br>phone: +39 0584 962313<br>fax:      +39 0584 1660272<br><br><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a><br><a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a><br><br>-------------------------------------------------------<br><p><span lang="IT"><font size="1"><b>AVVERTENZE AI SENSI DEL D.Lgs. 196/2003</b></font></span></p><p><span lang="IT"><font size="1">Le
 informazioni contenute in questo messaggio di posta elettronica e/o 
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il 
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
 per le finalità indicate nel messaggio stesso. Qualora riceviate questo
 messaggio senza esserne il destinatario, Vi preghiamo cortesemente di 
darcene notizia via e-mail e di procedere alla distruzione del messaggio
 stesso, cancellandolo dal Vostro sistema. Conservare il messaggio 
stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, 
copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento
 contrario ai principi dettati dal D.Lgs. 196/2003.</font></span></p><p><span lang="IT"><font size="1"> </font></span></p><p><font size="1">The
 information in this message and/or attachments, is intended solely for 
the attention and use of the named addressee(s) and may be confidential 
or proprietary in nature or covered by the provisions of privacy act 
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection 
Code).Any use not in accord with its purpose, any disclosure, 
reproduction, copying, distribution, or either dissemination, either 
whole or partial, is strictly forbidden except previous formal approval 
of the named addressee(s). If you are not the intended recipient, please
 contact immediately the sender by telephone, fax or e-mail and delete 
the information in this message that has been received in error. The 
sender does not give any warranty or accept liability as the content, 
accuracy or completeness of sent messages and accepts no responsibility 
 for changes made after they were sent or for other risks which arise as
 a result of e-mail transmission, viruses, etc.</font></p><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>