gdal_merge on a three band .tif - remove the 'no data' value

1.8k views Asked by At

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 '230, 245, 255' becomes '0, 245, 255').

I am trying to get NO PIXEL returned for 230, 245, 255. Is that possible?

I:\TFS_6\trial_merge>gdal_merge.py -o test.tif -n 230 245 255 file1.tif file2.tif

ERROR 4: `245' does not exist in the file system,
and is not recognised as a supported dataset name.

ERROR 4: `255' does not exist in the file system,
and is not recognised as a supported dataset name.

0...10...20...30...40...50...60...70...80...90...100 - done.
1

There are 1 answers

0
user14696 On
gdalbuildvrt -addalpha -hidenodata -srcnodata "230 245 255" merged_tif.vrt *.tif 

This turned the 'NoData' values into '230 245 255'...so I was able to filter BOTH 'NoData' and '230 245 255' accordingly,