gdal_merge在一个三频段.tif - 删除没有数据'值

时间:2015-06-09 19:22:40

标签: gis raster gdal

我有一大组.tif文件,我需要将它们合并/拼接成一个.tif,删除无数据值(即值230,245,255)。 但是,当我把它放入...像素230,245,255和#39;变成了',245,255')。

我试图让没有PIXEL返回230,245,255。这可能吗?

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 个答案:

答案 0 :(得分:0)

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

这将'NoData'值变为'230 245 255'...所以我能够相应地过滤'NoData'和'230 245 255',