Exemplo n.º 1
0
        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
            {
            }
        }
Exemplo n.º 2
0
        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
            {
            }
        }
Exemplo n.º 3
0
        private IExtractResult CYCAAlgorithm()
        {
            string[] files = GetStringArray("SelectedPrimaryFiles");
            if (files == null)
            {
                files = GetFiles();
            }
            if (files == null || files.Length == 0)
            {
                return(null);
            }
            IRasterDataProvider[] prds   = null;
            IRasterDataProvider   dstPrd = null;
            string dstFilename           = null;

            try
            {
                prds = GetProviderFromFiles(files);
                if (prds == null || prds.Length == 0)
                {
                    return(null);
                }
                RasterMoasicProcesser process = new RasterMoasicProcesser();
                dstFilename = @"d:\VGT_CYCA_" + DateTime.Now.ToString("yyyy-MM-dd") + ".ldf";
                if (_argumentProvider.GetArg("CYCAIdentify") == null) //max or avg
                {
                    return(null);
                }
                string identify = _argumentProvider.GetArg("CYCAIdentify").ToString();
                if (identify.ToLower() == "cycamax")
                {
                    dstPrd = process.Moasic <float>(prds, "LDF", dstFilename, false, null, "MAX", null, (srcValue, dstValue) => { return(srcValue > dstValue ? srcValue : dstValue); });
                }
                else if (identify.ToLower() == "cycaavg")
                {
                    dstPrd = process.Moasic <float>(prds, "LDF", dstFilename, false, null, "AVG", null, (srcValue, dstValue) => { return((srcValue + dstValue) / 2f); });
                }
            }
            catch
            {
                throw new ArgumentException("请选择正确的NDVI数据进行周期合成。");
            }
            finally
            {
                foreach (IRasterDataProvider item in prds)
                {
                    item.Dispose();
                }
                if (dstPrd != null)
                {
                    dstPrd.Dispose();
                    dstPrd = null;
                }
            }
            return(new FileExtractResult("CYCA", dstFilename));
        }
Exemplo n.º 4
0
 private string MoasicFiles(string[] srcFiles, bool processInvaild, string[] invaildValues, string outDir, CoordEnvelope outCoordEnvelope, int[] selectedBands, IProgressMonitor progress)
 {
     try
     {
         if (File.Exists(outDir))
         {
             GetFilename(outDir);
         }
         int count = srcFiles.Length;
         IRasterDataProvider[] srcRaster = new IRasterDataProvider[count];
         for (int i = 0; i < count; i++)
         {
             IRasterDataProvider src = GeoDataDriver.Open(srcFiles[i]) as IRasterDataProvider;
             srcRaster[i] = src;
         }
         if (progress != null)
         {
             progress.Reset("", 100);
             progress.Start(false);
         }
         RasterMoasicProcesser processer = new RasterMoasicProcesser();
         IRasterDataProvider   dstRaster = processer.Moasic(srcRaster, selectedBands, "LDF", outDir, outCoordEnvelope, srcRaster[0].ResolutionX, srcRaster[0].ResolutionY, processInvaild, invaildValues,
                                                            new Action <int, string>((int progerss, string text) =>
         {
             if (progress != null)
             {
                 progress.Boost(progerss, text);
             }
         }));
         string dstFileName = dstRaster.fileName;
         for (int i = 0; i < count; i++)
         {
             if (srcRaster[i] != null)
             {
                 srcRaster[i].Dispose();
             }
         }
         dstRaster.Dispose();
         return(dstFileName);
     }
     finally
     {
         if (progress != null)
         {
             progress.Finish();
         }
     }
 }
Exemplo n.º 5
0
 private string MoasicFiles(List <string> srcFiles, bool processInvaild, string[] invaildValues, string outDir, IProgressMonitor progress)
 {
     try
     {
         int count = srcFiles.Count;
         IRasterDataProvider[] srcRaster = new IRasterDataProvider[count];
         for (int i = 0; i < count; i++)
         {
             IRasterDataProvider src = GeoDataDriver.Open(srcFiles[i]) as IRasterDataProvider;
             srcRaster[i] = src;
         }
         if (progress != null)
         {
             progress.Reset("", 100);
             progress.Start(false);
         }
         RasterMoasicProcesser processer = new RasterMoasicProcesser();
         IRasterDataProvider   dstRaster = processer.Moasic(srcRaster, "LDF", outDir, processInvaild, invaildValues,
                                                            new Action <int, string>((int progerss, string text) =>
         {
             if (progress != null)
             {
                 progress.Boost(progerss, text);
             }
         }));
         string dstFileName = dstRaster.fileName;
         for (int i = 0; i < count; i++)
         {
             srcRaster[i].Dispose();
         }
         dstRaster.Dispose();
         return(dstFileName);
     }
     finally
     {
         if (progress != null)
         {
             progress.Finish();
         }
     }
 }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            //string fname1 = "E:\\Mas一期光盘数据\\第2张盘(监测产品培训数据)\\06_积雪\\s04_11b160515.ldf";
            //string fname2 = "E:\\Mas一期光盘数据\\第2张盘(监测产品培训数据)\\06_积雪\\s04_11b170455.ldf";
            //string fname1 = "E:\\FY3A_VIRRX_GBAL_L1_20110322_0520_1000M_MS_PRJ.ldf";
            //string fname2 = "E:\\FY3A_VIRRX_GBAL_L1_20110322_0525_1000M_MS_PRJ.ldf";
            //string fname1 = "E:\\拼接测试数据\\这三个拼接时候出现索引超界错误\\FY3A_VIRRX_GBAL_L1_20090107_0220_1000M_MS_PRJ.ldf";
            //string fname2 = "E:\\拼接测试数据\\这三个拼接时候出现索引超界错误\\FY3A_VIRRX_GBAL_L1_20100624_1139_1000M_MS_PRJ.ldf";
            //string fname1 = "E:\\拼接测试文件\\FY3A_VIRRX_GBAL_L1_20090107_0220_1000M_MS_PRJ_DXX.ldf";
            //string fname2 = "E:\\拼接测试文件\\FY3A_VIRRX_GBAL_L1_20100624_1139_1000M_MS_PRJ_DXX.ldf";
            //string fname3 = "E:\\拼接测试文件\\FY3A_VIRRX_GBAL_L1_20110322_0520_1000M_MS_PRJ_DXX.ldf";
            //string fname4 = "E:\\拼接测试文件\\FY3A_VIRRX_GBAL_L1_20110322_0525_1000M_MS_PRJ_DXX.ldf";
            //string fname5 = "E:\\拼接测试文件\\FY3A_VIRRX_GBAL_L1_20120423_0325_1000M_MS_PRJ_DXX.ldf";
            //string fname6 = "E:\\拼接测试文件\\HM0022014.ldf";
            //string fname1 = @"C:\Documents and Settings\Administrator\桌面\OrbitData\FY3A_VIRRX_3080_L1_20110110_0420_1000M_MS_PRJ_S04.LDF";
            //string fname2 = @"C:\Documents and Settings\Administrator\桌面\OrbitData\FY3A_VIRRX_3090_L1_20110110_0420_1000M_MS_PRJ_S04.LDF";
            //string fname3 = @"C:\Documents and Settings\Administrator\桌面\OrbitData\FY3A_VIRRX_4080_L1_20110110_0420_1000M_MS_PRJ_S04.LDF";
            //string fname4 = @"C:\Documents and Settings\Administrator\桌面\OrbitData\FY3A_VIRRX_4090_L1_20110110_0420_1000M_MS_PRJ_S04.LDF";
            //IRasterDataProvider prd1 = GeoDataDriver.Open(fname1) as IRasterDataProvider;
            //IRasterDataProvider prd2 = GeoDataDriver.Open(fname2) as IRasterDataProvider;
            //IRasterDataProvider prd3 = GeoDataDriver.Open(fname3) as IRasterDataProvider;
            //IRasterDataProvider prd4 = GeoDataDriver.Open(fname4) as IRasterDataProvider;
            //IRasterDataProvider prd5 = GeoDataDriver.Open(fname5) as IRasterDataProvider;
            //IRasterDataProvider prd6 = GeoDataDriver.Open(fname6) as IRasterDataProvider;
            //IRasterDataProvider prd3 = GeoDataDriver.Open(fname3) as IRasterDataProvider;
            //IRasterDataProvider prd4 = GeoDataDriver.Open(fname4) as IRasterDataProvider;
            string dir = @"E:\气象局项目\MAS二期\【控制】代码工程0716\【控制】UI框架(新整理)\SMART\bin\Release\Workspace\VGT\2012-08-22\栅格产品";

            if (!Directory.Exists(dir))
            {
                return;
            }
            string[] files                        = Directory.GetFiles(dir, "*.dat", SearchOption.TopDirectoryOnly);
            IRasterDataProvider[] prds            = GetProviderFromFiles(files);
            RasterMoasicProcesser processer       = new RasterMoasicProcesser();
            IRasterDataProvider   drcDataProvider = processer.Moasic <float>(prds, "LDF", "E:\\1.ldf", new CoordEnvelope(70, 140, 10, 60), 0.01f, 0.01f, true, new string[] { "0", "9999", "9998" }, "AVG", null, (srcValue, dstValue) => { return(srcValue > dstValue ? srcValue : dstValue); });
        }
Exemplo n.º 7
0
        public IRasterDataProvider[] DoProject(PrjOutArg prjArgs, MosaicType mosaicType, Action <int, string> progressCallback, out string msg)
        {
            ProjectionFactory proj = new ProjectionFactory();

            msg = "";
            TryCreateOutDir(prjArgs.OutDirOrFile);
            StringBuilder   str            = new StringBuilder();
            List <string[]> projectedFiles = new List <string[]>();

            for (int fileIndex = 0; fileIndex < _fileItems.Count; fileIndex++)
            {
                string            errMessage;
                MosaicProjectItem item = _fileItems[fileIndex];
                if (item == null || item.MainFile == null)
                {
                    continue;
                }
                string file        = item.MainFile.fileName;
                string outfilename = "";
                if (mosaicType != MosaicType.NoMosaic &&
                    !IsDir(prjArgs.OutDirOrFile) && _fileItems.Count > 1)
                {
                    outfilename          = prjArgs.OutDirOrFile;
                    prjArgs.OutDirOrFile = Path.GetDirectoryName(outfilename) + "\\" + Guid.NewGuid().ToString() + Path.GetExtension(outfilename);
                }
                string[] files = proj.Project(file, prjArgs, progressCallback, out errMessage);
                if (!string.IsNullOrWhiteSpace(outfilename))
                {
                    prjArgs.OutDirOrFile = outfilename;
                }
                if (!string.IsNullOrWhiteSpace(errMessage))
                {
                    str.AppendLine(Path.GetFileName(file) + errMessage);
                }
                if (files == null || files.Length == 0)
                {
                    continue;
                }
                if (files.Length == 1 && files[0] == null)
                {
                    continue;
                }
                projectedFiles.Add(files);
            }
            msg = str.ToString();
            if (projectedFiles.Count == 0)
            {
                return(null);
            }
            if (projectedFiles.Count == 1 && projectedFiles[0] == null)
            {
                return(null);
            }
            int envCount = prjArgs.Envelopes == null ? 1 : prjArgs.Envelopes.Length;

            IRasterDataProvider[]      retEnvFiles         = new IRasterDataProvider[envCount];
            List <IRasterDataProvider> retEnvFilesNoMosaic = new List <IRasterDataProvider>();

            for (int i = 0; i < envCount; i++)
            {
                List <string> envFiles = new List <string>();
                for (int j = 0; j < _fileItems.Count; j++)
                {
                    if (j >= projectedFiles.Count)
                    {
                        break;
                    }
                    if (projectedFiles[j] != null && projectedFiles[j].Length > i)
                    {
                        if (projectedFiles[j] == null || projectedFiles[j].Length == 0 || string.IsNullOrWhiteSpace(projectedFiles[j][i]))
                        {
                            continue;
                        }
                        envFiles.Add(projectedFiles[j][i]);
                    }
                }
                //by chennan 批量分幅投影
                if (mosaicType != MosaicType.NoMosaic)
                {
                    if (envFiles.Count > 1)
                    {
                        List <IRasterDataProvider> mosaicFiles = new List <IRasterDataProvider>();
                        try
                        {
                            foreach (string envfile in envFiles)
                            {
                                IRasterDataProvider file = FileHelper.Open(envfile);
                                mosaicFiles.Add(file);
                            }
                            string mosaicFile = null;
                            if (prjArgs == null || string.IsNullOrWhiteSpace(prjArgs.OutDirOrFile))
                            {
                                string outDir = Path.GetDirectoryName(mosaicFiles[0].fileName);
                                mosaicFile = Path.Combine(outDir, Path.GetFileNameWithoutExtension(mosaicFiles[0].fileName) + "_MOSAIC.ldf");
                            }
                            else
                            {
                                if (IsDir(prjArgs.OutDirOrFile))
                                {
                                    mosaicFile = Path.Combine(prjArgs.OutDirOrFile, Path.GetFileNameWithoutExtension(mosaicFiles[0].fileName) + "_MOSAIC.ldf");
                                }
                                else
                                {
                                    mosaicFile = prjArgs.OutDirOrFile;
                                }
                            }
                            RasterMoasicProcesser processer       = new RasterMoasicProcesser();
                            IRasterDataProvider   drcDataProvider = processer.Moasic(mosaicFiles.ToArray(), "LDF", mosaicFile, true, new string[] { "0" }, progressCallback);
                            //拼接角度文件
                            if (prjArgs.Args != null && prjArgs.Args.Length > 0)
                            {
                                foreach (object arg in prjArgs.Args)
                                {
                                    if (arg is string)
                                    {
                                        bool     isMoasic  = true;
                                        string[] extentStr = null;
                                        List <IRasterDataProvider> mosaicExtFile = new List <IRasterDataProvider>();
                                        List <string> extFileList = new List <string>();
                                        try
                                        {
                                            string extFileName;
                                            string extension;
                                            string argStr = arg as string;
                                            if (argStr.Contains("="))
                                            {
                                                argStr = argStr.Split('=')[1];
                                                if (argStr.Contains(";"))
                                                {
                                                    extentStr = argStr.Split(';');
                                                }
                                            }
                                            if (extentStr != null)
                                            {
                                                for (int extentIndex = 0; extentIndex < extentStr.Length; extentIndex++)
                                                {
                                                    argStr    = extentStr[extentIndex];
                                                    extension = "." + argStr + ".ldf";
                                                    for (int j = 0; j < envFiles.Count; j++)
                                                    {
                                                        extFileName = Path.ChangeExtension(envFiles[j], extension);
                                                        if (!File.Exists(extFileName))
                                                        {
                                                            isMoasic = false;
                                                            break;
                                                        }
                                                        else
                                                        {
                                                            isMoasic = true;
                                                        }
                                                        IRasterDataProvider file = FileHelper.Open(extFileName);
                                                        mosaicExtFile.Add(file);
                                                        extFileList.Add(extFileName);
                                                    }
                                                    if (isMoasic)
                                                    {
                                                        string outFileName = Path.ChangeExtension(mosaicFile, extension);
                                                        IRasterDataProvider drcExtDataProvider = processer.Moasic(mosaicExtFile.ToArray(), "LDF", outFileName, true, new string[] { "0" }, progressCallback);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                extension = "." + argStr + ".ldf";
                                                for (int j = 0; j < envFiles.Count; j++)
                                                {
                                                    extFileName = Path.ChangeExtension(envFiles[j], extension);
                                                    if (!File.Exists(extFileName))
                                                    {
                                                        isMoasic = false;
                                                        break;
                                                    }
                                                    IRasterDataProvider file = FileHelper.Open(extFileName);
                                                    mosaicExtFile.Add(file);
                                                    extFileList.Add(extFileName);
                                                }
                                                if (isMoasic)
                                                {
                                                    string outFileName = Path.ChangeExtension(mosaicFile, extension);
                                                    IRasterDataProvider drcExtDataProvider = processer.Moasic(mosaicExtFile.ToArray(), "LDF", outFileName, true, new string[] { "0" }, progressCallback);
                                                }
                                            }
                                        }
                                        finally
                                        {
                                            if (mosaicExtFile.Count > 0)
                                            {
                                                foreach (IRasterDataProvider file in mosaicExtFile)
                                                {
                                                    if (file != null)
                                                    {
                                                        file.Dispose();
                                                    }
                                                }
                                                mosaicExtFile.Clear();
                                            }
                                            if (extFileList.Count > 0)
                                            {
                                                foreach (string envfile in extFileList)
                                                {
                                                    TryDeleteRasterFile(envfile);
                                                }
                                                extFileList.Clear();
                                            }
                                        }
                                    }
                                }
                            }
                            retEnvFiles[i] = drcDataProvider;
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        finally
                        {
                            foreach (IRasterDataProvider envfile in mosaicFiles)
                            {
                                if (envfile != null)
                                {
                                    envfile.Dispose();
                                }
                            }
                            mosaicFiles.Clear();
                            foreach (string envfile in envFiles)
                            {
                                TryDeleteRasterFile(envfile);
                            }
                        }
                    }
                    else if (envFiles.Count == 1)
                    {
                        if (!IsDir(prjArgs.OutDirOrFile) && !string.IsNullOrWhiteSpace(prjArgs.OutDirOrFile) && envFiles[0] != prjArgs.OutDirOrFile)
                        {
                            if (!Directory.Exists(Path.GetDirectoryName(prjArgs.OutDirOrFile)))
                            {
                                Directory.CreateDirectory(Path.GetDirectoryName(prjArgs.OutDirOrFile));
                            }
                            File.Copy(envFiles[0], prjArgs.OutDirOrFile);
                            TryDeleteRasterFile(envFiles[0]);
                            retEnvFiles[i] = FileHelper.Open(prjArgs.OutDirOrFile);
                        }
                        else
                        {
                            retEnvFiles[i] = FileHelper.Open(envFiles[0]);
                        }
                    }
                    else
                    {
                        retEnvFiles[i] = null;
                    }
                    //
                }
                else if (envFiles.Count != 0)
                {
                    List <IRasterDataProvider> mosaicFiles = new List <IRasterDataProvider>();
                    foreach (string envfile in envFiles)
                    {
                        IRasterDataProvider file = FileHelper.Open(envfile);
                        mosaicFiles.Add(file);
                    }
                    retEnvFilesNoMosaic.AddRange(mosaicFiles);
                }
            }
            //
            return(retEnvFilesNoMosaic.Count == 0 ? retEnvFiles : retEnvFilesNoMosaic.ToArray());
        }
Exemplo n.º 8
0
        ///将inputRaster拼接到tFilename。
        private OutFileArg SpliceToExistFile(IRasterDataProvider inputRaster, string tFilename)
        {
            OutFileArg fileArg     = new OutFileArg();
            string     tmpDir      = Path.GetDirectoryName(tFilename);
            string     tmpFilename = CreateTempFilename(tmpDir);

            try
            {
                using (IRasterDataProvider tRaster = RasterDataDriver.Open(tFilename) as IRasterDataProvider)
                {
                    if (inputRaster.BandCount != tRaster.BandCount)
                    {
                        throw new ExceptionExt(2, "待拼接文件和目标文件的波段数不同,无法完成文件拼接[" + inputRaster.fileName + "]" + "[" + tFilename + "]");
                    }
                    CoordEnvelope tEnv      = inputRaster.CoordEnvelope.Union(tRaster.CoordEnvelope);
                    PrjEnvelope   tEnvelope = CoordToEnvelope(tEnv);
                    using (IRasterDataProvider tmpFileRaster = CreateMosaicFile(inputRaster, tEnvelope, tmpFilename))
                    {
                        RasterMoasicProcesser mo = new RasterMoasicProcesser();
                        mo.Moasic(new IRasterDataProvider[] { inputRaster, tRaster }, tmpFileRaster, true, new string[] { "0" }, action);
                        fileArg.Envelope    = new PrjEnvelopeItem("", tEnvelope);
                        fileArg.ResolutionX = tmpFileRaster.ResolutionX.ToString();
                        fileArg.ResolutionY = tmpFileRaster.ResolutionY.ToString();
                    }
                }
                if (File.Exists(tmpFilename))
                {
                    try
                    {
                        string tmpHdrFilename      = FilenameIdentify.HdrFileName(tmpFilename);
                        string tmpOverviewFilename = FilenameIdentify.OverviewFileName(tmpFilename);
                        string tHdrFilename        = FilenameIdentify.HdrFileName(tFilename);
                        string tOverviewFilename   = FilenameIdentify.OverviewFileName(tFilename);
                        File.Delete(tFilename);//删除原文件
                        if (File.Exists(tHdrFilename))
                        {
                            File.Delete(tHdrFilename);
                        }
                        if (File.Exists(tOverviewFilename))
                        {
                            File.Delete(tOverviewFilename);
                        }
                        //拼接后的文件重命名为目标文件
                        File.Move(tmpFilename, tFilename);
                        fileArg.OutputFilename = Path.GetFileName(tFilename);
                        fileArg.Length         = new FileInfo(tFilename).Length;
                        if (File.Exists(tmpHdrFilename))
                        {
                            File.Move(tmpHdrFilename, tHdrFilename);
                            fileArg.ExtendFiles = Path.GetFileName(tHdrFilename);
                        }
                        if (File.Exists(tmpOverviewFilename))
                        {
                            File.Move(tmpOverviewFilename, tOverviewFilename);
                            fileArg.Thumbnail = Path.GetFileName(tOverviewFilename);
                        }
                        else if (File.Exists(tFilename))
                        {
                            OnProgress(0, "生成缩略图");
                            tOverviewFilename = OverViewHelper.OverView(tFilename, _mosaicSize);
                            OnProgress(100, "完成缩略图");
                            fileArg.Thumbnail = Path.GetFileName(tOverviewFilename);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("拼接完成后,重命名新拼接文件失败。" + ex.Message, ex);
                    }
                }
                return(fileArg);
            }
            finally
            {
                TryDeleteLdfs(tmpFilename);
            }
        }
Exemplo n.º 9
0
        public override IExtractResult Make(Action <int, string> progressTracker)
        {
            if (!CheckArguments())
            {
                return(null);
            }
            Dictionary <DateTime, List <string> > orderedFiles = GroupByOrbitDate();

            if (orderedFiles.Count == 0)
            {
                return(null);
            }
            object obj = _argumentProvider.GetArg("ThemeGraphyGenerator");

            if (obj == null)
            {
                return(null);
            }
            IThemeGraphGenerator tgg     = obj as IThemeGraphGenerator;
            List <string>        rdpList = new List <string>();//按照日期生成的多个日最大合成数据

            //每天生成一个最大日合成图

            foreach (DateTime time in orderedFiles.Keys)
            {
                RasterMoasicProcesser      processer = new RasterMoasicProcesser();
                List <IRasterDataProvider> srcdata   = new List <IRasterDataProvider>();
                try
                {
                    foreach (string item in orderedFiles[time])
                    {
                        IRasterDataProvider rdp = GeoDataDriver.Open(item) as IRasterDataProvider;
                        if (rdp != null)
                        {
                            srcdata.Add(rdp);
                        }
                    }
                    string             fileName  = null;
                    IFileNameGenerator generator = GetFileNameGenerator();
                    if (generator == null)
                    {
                        fileName = string.Empty;
                    }
                    else
                    {
                        fileName = generator.NewFileName(CreatRasterIndetifyId(orderedFiles[time].ToArray(), "SNW", "MAXI", GetDataIdentify(), ".LDF", null));
                    }
                    using (IRasterDataProvider dstPrd = processer.Moasic <Int16>(srcdata.ToArray(), "LDF", fileName, false, null, "MAX", null, (srcValue, dstValue) => { return(srcValue > dstValue ? srcValue : dstValue); }))
                    {
                        if (dstPrd != null)
                        {
                            rdpList.Add(dstPrd.fileName);
                        }
                    }
                }
                finally
                {
                    foreach (IRasterDataProvider rdp in srcdata)
                    {
                        rdp.Dispose();
                    }
                    srcdata.Clear();
                }
            }
            string templatName              = GetStringArgument("ThemeGraphTemplateName");
            string colorTabelName           = GetColorTableName("colortablename");
            IExtractResultArray resultArray = new ExtractResultArray("MAXI");

            foreach (string file in rdpList)
            {
                tgg.Generate(file, templatName, null, null, "MAXI", colorTabelName);
                string resultFilename = tgg.Save();
                if (string.IsNullOrEmpty(resultFilename))
                {
                    continue;
                }
                resultArray.Add(new FileExtractResult("MAXI", resultFilename));
            }
            if (resultArray != null)
            {
                return(resultArray);
            }
            return(null);
        }