<div dir="ltr"><div><div>Interesting...ok, so (knowing nothing about .vrt&#39;s and having a bunch of .tiff&#39;s) I ran this:<br><br></div>&gt;&gt;gdalbuildvrt -srcnodata &quot;230 245 255&quot; tif_index.vrt *.tif<br>0...10...20...30...40...50...60...70...80...90...100 - done.<br><br></div>then<br><div><br></div><div>&gt;&gt; gdal_merge -o merged_result.tif *.vrt<br><br></div><div>and got<br><br>ERROR 4: `*.vrt&#39; does not exist in the file system,<br>and is not recognised as a supported dataset name.<br><br></div><div>I&#39;m on OSGEO4W too..<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 9, 2015 at 1:24 PM,  <span dir="ltr">&lt;<a href="mailto:Matt.Wilkie@gov.yk.ca" target="_blank">Matt.Wilkie@gov.yk.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The error is because you need to quote the argument values to keep them from being interpreted as filenames:<br>
<br>
        gdal_merge -n “230 245 255” ...<br>
<br>
However gdal_merge can&#39;t use different nodata values for each band. You need to pre-process the files before merging. This worked for me here:<br>
<br>
Create  VRT (virtual raster) file for the input file(s):<br>
<br>
        gdalbuildvrt -srcnodata &quot;230 245 255”&quot;  infile1.vrt  infile1.tif<br>
<br>
Then feed the .vrt&#39;s to gdal_merge:<br>
<br>
        gdal_merge -of merged_result.tif infile1.vrt infile2.vrt ...<br>
<br>
<br>
You may need to switch from fwtools to Osgeo4w (if on Windows) to get gdalbuildvrt.<br>
<br>
Cheers,<br>
<br>
--<br>
matt wilkie<br>
--------------------------------------------<br>
Geomatics Analyst<br>
Information Management and Technology<br>
Yukon Department of Environment<br>
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9<br>
867-667-8133 Tel * 867-393-7003 Fax<br>
<a href="http://environmentyukon.gov.yk.ca/geomatics/" target="_blank">http://environmentyukon.gov.yk.ca/geomatics/</a><br>
--------------------------------------------<br>
<br>
<br>
<br>
-----------------------------<br>
<br>
From: <a href="mailto:fwtools-bounces@lists.maptools.org">fwtools-bounces@lists.maptools.org</a> [mailto:<a href="mailto:fwtools-bounces@lists.maptools.org">fwtools-bounces@lists.maptools.org</a>] On Behalf Of Ari Simmons<br>
Sent: Tuesday, June 09, 2015 12:43 PM<br>
To: <a href="mailto:fwtools@lists.maptools.org">fwtools@lists.maptools.org</a><br>
Subject: [FWTools] gdal_merge with a specific pixel value clipped/removed<br>
<br>
I have a large set of .tif files and I need to merge/mosaic them all into one .tif with the no-data value removed (i.e. value 230, 245, 255). However, when I put this in...pixel &#39;230, 245, 255&#39; becomes &#39;0, 245, 255&#39;).<br>
I am trying to get NO PIXEL returned for 230, 245, 255. Is that possible?<br>
I:\TFS_6\trial_merge&gt;gdal_merge.py -o test.tif -n 230 245 255 file1.tif file2.tif<br>
<br>
ERROR 4: `245&#39; does not exist in the file system,<br>
and is not recognised as a supported dataset name.<br>
<br>
ERROR 4: `255&#39; does not exist in the file system,<br>
and is not recognised as a supported dataset name.<br>
<br>
0...10...20...30...40...50...60...70...80...90...100 - done.<br>
</blockquote></div><br></div>