<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Gdal,<br>
<br>
I am having some issues with gdal_merge.py.  <br>
<br>
When I merge two tifs together, the original nodata value is converted to 0, no matter what that original no data was.  Here is my test case:<br>
<br>
Data:<br>
<br>
https://data.linz.govt.nz/x/9iitN4 DEM_BA32_3501_2013<br>
<br>
https://data.linz.govt.nz/x/WLurgo DEM_BA31_3550_2013<br>
<br>
Running gdalinfo on both files reveals a 'nodata' value of -9999.  When I view the data as individual files in QGIS, the 'nodata'  regions are confirmed as 'nodata' or '-9999' and are rendered transparent.<br>
<br>
Next I run gdal_merge.py:<br>
<br>
gdal_merge.py -o test_merge.tif *.tif<br>
<br>
I also try:<br>
<br>
gdal_merge.py -n -9999 -a_nodata -9999 -o test_merge_wnodata.tif *.tif<br>
<br>
No matter which variation of merge I run, those regions that once contained 'nodata' or '-9999' are converted to '0' and the nodata value is not retained after the merge.  When I load the test_merge_wnodata.tif into QGIS, those regions once containing 'nodata',
 are now filled with 0 and rendered as such.<br>
<br>
Maybe this is a bug or am I using gdal_merge.py improperly.<br>
<br>
Cheers,<br>
<br>
Ian<br>
<br>
<br>
</div>
<br>
<hr>
<font face="Verdana" color="Black" size="2"><br>
This message contains information, which may be in confidence and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please
 notify us immediately (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.<br>
</font>
</body>
</html>