internal AbstractWarpDataset MosaicToFile(string mosaicFilename) { AbstractWarpDataset mosaicFileRaster = null; try { if (File.Exists(mosaicFilename)) { var rDs = Gdal.Open(mosaicFilename, Access.GA_Update); mosaicFileRaster = new WarpDataset(rDs, mosaicFilename); if (mosaicFileRaster.BandCount != fileRaster.BandCount) { mosaicFileRaster.Dispose(); mosaicFileRaster = CreateMosaicFile(mosaicFilename, inArg); } } else { mosaicFileRaster = CreateMosaicFile(mosaicFilename, inArg); } if (mosaicFileRaster == null) { return(null); } RasterMoasicProcesser mo = new RasterMoasicProcesser(); //mo.Moasic(new IRasterDataProvider[] { fileRaster }, mosaicFileRaster, true, new string[] { "0" }, action); mo.MoasicSimple(fileRaster, mosaicFileRaster, true, new string[] { "0" }, action); return(mosaicFileRaster); } finally { } }
internal IRasterDataProvider MosaicToFile(string mosaicFilename) { IRasterDataProvider mosaicFileRaster = null; try { if (File.Exists(mosaicFilename)) { mosaicFileRaster = RasterDataDriver.Open(mosaicFilename, enumDataProviderAccess.Update, null) as IRasterDataProvider; if (mosaicFileRaster.BandCount != fileRaster.BandCount) { mosaicFileRaster.Dispose(); mosaicFileRaster = CreateMosaicFile(mosaicFilename, inArg); } } else { mosaicFileRaster = CreateMosaicFile(mosaicFilename, inArg); } if (mosaicFileRaster == null) { return(null); } RasterMoasicProcesser mo = new RasterMoasicProcesser(); //mo.Moasic(new IRasterDataProvider[] { fileRaster }, mosaicFileRaster, true, new string[] { "0" }, action); mo.MoasicSimple(fileRaster, mosaicFileRaster, true, new string[] { "0" }, action); return(mosaicFileRaster); } finally { } }