从多波段图像中选择一个波段另存为TIF,不成功,原因未知。
换了另一种方式通过。
//作者:AllenRobin http://gisrsman.cnblogs.com
IRaster raster = RasterHandler.OpenRasterFile("输入文件"); IRasterBandCollection rasterbc = (IRasterBandCollection)raster; //错误方式 //IGeoDataset pRasterBand = rasterbc.Item(0) as IGeoDataset; //正确方式 IRasterDataset geopb = rasterbc.Item(0).RasterDataset; ISaveAs saveAs = geopb as ISaveAs; saveAs.SaveAs("输出路径", workspace, "TIFF"); ----------------------------------------------- //IGeoDataset同样也要先转IRasterBandCollection IRasterBandCollection rasterbc = (IRasterBandCollection)geoDataset;