Example #1
0
        public string GetFileName(string[] files, string productIdentify, string outputIdentify, string fomart, string extinfo)
        {
            IFileNameGenerator fng = GetFileNameGenerator();

            if (fng == null)
            {
                return(string.Empty);
            }
            DataIdentify di = GetDataIdentify();

            return(fng.NewFileName(CreatRasterIndetifyId(files, productIdentify, outputIdentify, di, fomart, extinfo)));
        }
        private string CreatOutputFileName(string fname, bool isCustom)
        {
            IFileNameGenerator fng            = GetFileNameGenerator();
            DataIdentify       di             = GetDataIdentify();
            string             outputIdentify = _argumentProvider.GetArg("OutFileIdentify").ToString();

            if (string.IsNullOrEmpty(outputIdentify))
            {
                outputIdentify = GetOutputIdentifyByFilename(fname, isCustom);
            }
            RasterIdentify rid = CreatRasterIndetifyId(new string[] { fname }, "VGT", outputIdentify, di, ".xlsx", null);

            return((fng == null) ? string.Empty : fng.NewFileName(rid));
        }
Example #3
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);
        }