Example #1
0
        private IExtractResult HistoryDataLayoutAlgorithm(Action <int, string> progressTracker)
        {
            //1.获取到数据
            List <string> list = ExportManager.GetInstance().List;  //这个针对查询出来的数据出专题图

            string[] inputfiles = list.ToArray();
            //再加一上基于 同期统计数据的专题图,如果是冬季的,还要再计算一次
            StatisticResultManager manager = StatisticResultManager.GetInstance();
            List <string>          list2   = manager.GetFilePathFromList(); //得到的是基于数据查询的数据又做的统计数据

            if (list2.Count != 0)
            {
                inputfiles = list2.ToArray();
                period     = "yes";
                Match m = DataReg2.Match(inputfiles[0]);
                if (m.Success)
                {
                    Iswinter = "yes";
                }
            }
            //处理后的数据存储路径
            string savePath = _argumentProvider.GetArg("HistoryDataSave") as string;

            regioNames = _argumentProvider.GetArg("regionNames") as string;
            string orbitType = _argumentProvider.GetArg("OrbitType") as string;
            string Str       = null;

            if (orbitType == "Ascend")
            {
                Str = "_A_";
            }
            if (orbitType == "Descend")
            {
                Str = "_D_";
            }
            //同期统计计算传出来的文件没有分升降轨,这里进行区分
            List <string> fnamelist = new List <string>();

            foreach (string file in inputfiles)
            {
                if (Path.GetFileName(file).Contains(Str))
                {
                    fnamelist.Add(file);
                }
            }
            inputfiles = fnamelist.ToArray();
            //处理后的数据,用它来出专题图
            List <string> afterProcessfiles = new List <string>();

            //(插一步,通过这个原始选择的文件名时间信息把专题图名称确定)
            //2.确定选择区域,没有选或者中国区域不要用裁,如果是其地区首先裁切,并且放到指定文件夹下
            aoiContainer = new GeoDo.RSS.Core.VectorDrawing.AOIContainerLayer();
            MulRegionsClip muticlip    = new MulRegionsClip(); //裁切
            MWSSmoothHelp  smooth      = new MWSSmoothHelp();  //平滑
            string         regionsname = "";

            #region 获得目标区域
            aoiContainer = new GeoDo.RSS.Core.VectorDrawing.AOIContainerLayer();
            string        fieldName;
            string        shapeFilename;
            int           fieldIndex  = -1;
            List <string> fieldValues = new List <string>();
            using (frmStatSubRegionTemplates frm = new frmStatSubRegionTemplates())
            {
                frm.listView1.MultiSelect = true;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    Feature[] fets = frm.GetSelectedFeatures();
                    fets = frm.GetStatFeatures(out fieldName, out shapeFilename, out fieldIndex);
                    if (fets == null)
                    {
                        aoiContainer = null;
                        regionsname  = "全国";
                    }
                    else
                    {
                        string chinafieldValue = fets[0].GetFieldValue(fieldIndex);
                        if (chinafieldValue == "中国")
                        {
                            aoiContainer = null;
                            regionsname  = "全国";
                        }
                        else
                        {
                            foreach (Feature fet in fets)
                            {
                                fieldValues.Add(fet.GetFieldValue(fieldIndex)); //获得选择区域名称
                                aoiContainer.AddAOI(fet);
                            }
                            foreach (string region in fieldValues)
                            {
                                regionsname += region;
                            }
                            if (regionsname.Contains("西藏") && regionsname.Contains("青海"))
                            {
                                regionsname = "青藏地区";
                            }
                            if (!string.IsNullOrEmpty(regioNames))
                            {
                                regionsname = regioNames.Trim();
                            }
                        }
                    }
                }
                else //没有点击确定,返回空
                {
                    return(null);
                }
            }
            #endregion
            if (aoiContainer == null)
            {
                //不用裁切,只做中值滤波的平滑处理。
                regionsname = "全国";
                foreach (string infile in inputfiles)
                {
                    //创建专题图路径
                    gxdsave = savePath + "\\" + regionsname + "\\" + "专题图";
                    if (!System.IO.Directory.Exists(gxdsave))//如果不存在这个路径
                    {
                        System.IO.Directory.CreateDirectory(gxdsave);
                    }
                    //创建平滑路径
                    string smoothsave = savePath + "\\" + regionsname + "\\" + "平滑";
                    if (!System.IO.Directory.Exists(smoothsave))
                    {
                        System.IO.Directory.CreateDirectory(smoothsave);
                    }
                    //创建平滑\\中值
                    string filtersave = smoothsave + "\\" + "中值";
                    if (!System.IO.Directory.Exists(filtersave))
                    {
                        System.IO.Directory.CreateDirectory(filtersave);
                    }
                    string filterfile = smooth.ComputerMid(infile, 5, filtersave);
                    string hdrfile    = Path.GetDirectoryName(filterfile) + "\\" + Path.GetFileNameWithoutExtension(filterfile) + ".hdr";
                    afterProcessfiles.Add(filterfile);
                }
            }
            else
            {
                //创建裁切路径
                string clipsave = savePath + "\\" + regionsname + "\\" + "裁切";
                if (!System.IO.Directory.Exists(clipsave))//如果不存在这个路径
                {
                    System.IO.Directory.CreateDirectory(clipsave);
                }
                //创建专题图路径
                gxdsave = savePath + "\\" + regionsname + "\\" + "专题图";
                if (!System.IO.Directory.Exists(gxdsave))//如果不存在这个路径
                {
                    System.IO.Directory.CreateDirectory(gxdsave);
                }
                //创建平滑路径
                string smoothsave = savePath + "\\" + regionsname + "\\" + "平滑";
                if (!System.IO.Directory.Exists(smoothsave))
                {
                    System.IO.Directory.CreateDirectory(smoothsave);
                }
                //创建平滑\\中值
                string filtersave = smoothsave + "\\" + "中值";
                if (!System.IO.Directory.Exists(filtersave))
                {
                    System.IO.Directory.CreateDirectory(filtersave);
                }
                //创建平滑\\插值
                string bilisave = smoothsave + "\\" + "插值";
                if (!System.IO.Directory.Exists(bilisave))
                {
                    System.IO.Directory.CreateDirectory(bilisave);
                }
                foreach (string infile in inputfiles)
                {
                    //加一个条件判断要处理的数据是否已经存在,如果存就不用再做
                    string newclipfile = Path.Combine(clipsave, Path.GetFileName(infile).Replace("China", regionsname));
                    if (!File.Exists(newclipfile))
                    {
                        string clipfile = muticlip.MutiRegionsClip(infile, aoiContainer, clipsave);
                        string hdrfile  = Path.GetDirectoryName(clipfile) + "\\" + Path.GetFileNameWithoutExtension(clipfile) + ".hdr";
                        //重命名
                        string   newhdrfile = Path.Combine(Path.GetDirectoryName(clipfile), Path.GetFileNameWithoutExtension(infile).Replace("China", regionsname) + ".hdr");
                        FileInfo fi         = new FileInfo(clipfile);
                        fi.MoveTo(newclipfile);
                        FileInfo fihdr = new FileInfo(hdrfile);
                        fihdr.MoveTo(newhdrfile);
                    }
                    //裁切后要对数据中值、插值
                    string filterfile = smooth.ComputerMid(newclipfile, 5, filtersave);
                    string bilifile   = smooth.Bilinear(filterfile, 10, bilisave);
                    afterProcessfiles.Add(bilifile);
                }
            }
            //把处理后的afterProcessfiles.ToArray()数组文件名标识变为“HFSD”或“HFWE”。
            foreach (string file in afterProcessfiles.ToArray())
            {
                string hdrfile = Path.GetDirectoryName(file) + "\\" + Path.GetFileNameWithoutExtension(file) + ".hdr";
                string newfile = "";
                string newhdr  = "";
                if (file.Contains("MWSD"))
                {
                    newfile = file.Replace("MWSD", "HFSD");
                    newhdr  = hdrfile.Replace("MWSD", "HFSD");
                }
                if (file.Contains("MSWE"))
                {
                    newfile = file.Replace("MSWE", "HFWE");
                    newhdr  = hdrfile.Replace("MSWE", "HFWE");
                }
                FileInfo fi = new FileInfo(file);
                if (!File.Exists(newfile))
                {
                    fi.MoveTo(newfile);
                }
                FileInfo fihdr = new FileInfo(hdrfile);
                if (!File.Exists(newhdr))
                {
                    fihdr.MoveTo(newhdr);
                }
                imgfiles.Add(newfile);
            }
            IExtractResultArray results = new ExtractResultArray("");
            foreach (string arguments in imgfiles.ToArray())
            {
                string product = "";
                if (arguments.Contains("HFSD"))
                {
                    _argumentProvider.SetArg("OutFileIdentify", "HSDI");
                    product = "雪深";
                }
                if (arguments.Contains("HFWE"))
                {
                    _argumentProvider.SetArg("OutFileIdentify", "HSWI");
                    product = "雪水当量";
                }
                //解析文件名确定专题图名称
                string filename = Path.GetFileNameWithoutExtension(arguments);
                if (period == "yes")        //同期统计的
                {
                    if (Iswinter == "yes")
                    {
                        Match  m    = DataReg2.Match(filename);
                        string year = "";
                        if (m.Success)
                        {
                            year = m.Value;
                        }
                        imgname = year.Substring(0, 4) + "年" + "冬季" + regionsname + product + "分布图";
                    }
                    else
                    {
                        Regex  DataReg1 = new Regex(@"(?<year>\d{4})_(?<year>\d{4})", RegexOptions.Compiled);
                        Match  m        = DataReg1.Match(filename);
                        string year     = "";
                        if (m.Success)
                        {
                            year = m.Value;
                        }
                        //提取年至avg之间的字符
                        string   filetime = filename.Substring(filename.IndexOf(year), filename.Length - 3 - filename.IndexOf(year));
                        string[] mxchars  = filetime.Split(new char[] { '_' });
                        string   mx       = "";//月+旬
                        if (filename.Contains("Xun"))
                        {
                            if (mxchars[3] == "1")
                            {
                                mx = mxchars[2] + "月" + "上旬";
                            }
                            if (mxchars[3] == "2")
                            {
                                mx = mxchars[2] + "月" + "中旬";
                            }
                            if (mxchars[3] == "3")
                            {
                                mx = mxchars[2] + "月" + "下旬";
                            }
                        }
                        if (filename.Contains("Month"))
                        {
                            mx = mxchars[2] + "月";
                        }
                        imgname = year + "年" + mx + regionsname + product + "分布图";
                    }
                }
                else
                {
                    Regex  DataReg = new Regex(@"(?<year>\d{4})", RegexOptions.Compiled);
                    Match  m       = DataReg.Match(filename);
                    string year    = "";
                    if (m.Success)
                    {
                        year = m.Value;
                    }
                    //提取年至avg之间的字符
                    string   filetime = filename.Substring(filename.IndexOf(year), filename.Length - 3 - filename.IndexOf(year));
                    string[] mxchars  = filetime.Split(new char[] { '_' });
                    string   mx       = "";//月+旬
                    if (filename.Contains("Xun"))
                    {
                        if (mxchars[2] == "1")
                        {
                            mx = mxchars[1] + "月" + "上旬";
                        }
                        if (mxchars[2] == "2")
                        {
                            mx = mxchars[1] + "月" + "中旬";
                        }
                        if (mxchars[2] == "3")
                        {
                            mx = mxchars[1] + "月" + "下旬";
                        }
                    }
                    if (filename.Contains("Month"))
                    {
                        mx = mxchars[1] + "月";
                    }
                    if (filetime.Contains("Season"))
                    {
                        mx = mxchars[1] + "季度";
                    }
                    imgname = year + "年" + mx + regionsname + product + "分布图";
                }
                _argumentProvider.SetArg("SelectedPrimaryFiles", arguments);
                _argumentProvider.SetArg("fileOpenArgs", arguments);
                FileExtractResult result = ThemeGraphyResult(null) as FileExtractResult;
                //增加矢量
                string autopath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"SystemData\ProductArgs\MWS\shppath.txt");
                string shpFile  = "";
                if (File.Exists(autopath))
                {
                    FileStream   fauto = new FileStream(autopath, FileMode.Open, FileAccess.Read);
                    StreamReader rauto = new StreamReader(fauto, Encoding.GetEncoding("gb2312"));
                    shpFile = rauto.ReadLine();
                    rauto.Close();
                    fauto.Close();
                }
                else
                {
                    shpFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"数据引用\基础矢量\行政区划\线\中国边界_线.shp");
                }
                CreateMcd(shpFile);
                _shpFile = shpFile;
                _gxdFile = (result as FileExtractResult).FileName;
                AddShpToGxd();
                FileInfo fi            = new FileInfo(result.FileName);
                string   newresultfile = Path.Combine(gxdsave, Path.GetFileNameWithoutExtension(arguments) + ".gxd");
                if (!File.Exists(newresultfile))
                {
                    fi.MoveTo(newresultfile);
                }
                else
                {
                    FileInfo fi1 = new FileInfo(newresultfile);
                    fi1.Delete();
                }
                IFileExtractResult res = new FileExtractResult(_subProductDef.Identify, newresultfile, false);
                results.Add(res);
            }
            return(results);
        }
Example #2
0
        private IExtractResult JuPingAnalysisAlgorithm(Action <int, string> progressTracker)
        {
            string[]               inputCurrentFiles = null;                             //= ExportManager.GetInstance().List.ToArray();//GetStringArray("RasterCurrentFile"); 由查询那里获得
            string[]               inputHistoryFiles = null;
            List <string>          list1             = ExportManager.GetInstance().List; //得到的是从数据库里查询出来的周期数据
            StatisticResultManager manager           = StatisticResultManager.GetInstance();
            List <StatisticResult> list  = manager.List;
            List <string>          list2 = manager.GetFilePathFromList(); //得到的是基于数据查询的数据又做的统计数据

            regionNames = _argumentProvider.GetArg("regionNames") as string;
            //处理后的数据,用它来出专题图
            List <string> afterProcessfiles = new List <string>();

            #region 获得目标区域
            aoiContainer = new GeoDo.RSS.Core.VectorDrawing.AOIContainerLayer();
            string        fieldName;
            string        shapeFilename;
            int           fieldIndex  = -1;
            List <string> fieldValues = new List <string>();
            string        regionsname = "";
            using (frmStatSubRegionTemplates frm = new frmStatSubRegionTemplates())
            {
                frm.listView1.MultiSelect = true;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    Feature[] fets = frm.GetSelectedFeatures();
                    fets = frm.GetStatFeatures(out fieldName, out shapeFilename, out fieldIndex);
                    if (fets == null)
                    {
                        aoiContainer = null;
                        regionsname  = "全国";
                    }
                    else
                    {
                        string chinafieldValue = fets[0].GetFieldValue(fieldIndex);
                        if (chinafieldValue == "中国")
                        {
                            aoiContainer = null;
                            regionsname  = "全国";
                        }
                        else
                        {
                            foreach (Feature fet in fets)
                            {
                                fieldValues.Add(fet.GetFieldValue(fieldIndex)); //获得选择区域名称
                                aoiContainer.AddAOI(fet);
                            }
                            foreach (string region in fieldValues)
                            {
                                regionsname += region;
                            }
                            if (regionsname.Contains("西藏") && regionsname.Contains("青海"))
                            {
                                regionsname = "青藏地区";
                            }
                            if (!string.IsNullOrEmpty(regionNames))
                            {
                                regionsname = regionNames.Trim();
                            }
                        }
                    }
                }
                else
                {
                    return(null);
                }
            }
            #endregion
            Regex DataReg = new Regex(@"(?<year>\d{4})", RegexOptions.Compiled);
            //处理后的数据存储路径
            string savePath   = _argumentProvider.GetArg("HistoryDataSave") as string;
            string jpsavepath = savePath + "\\" + "距平分析";
            if (!System.IO.Directory.Exists(jpsavepath))//如果不存在这个路径
            {
                System.IO.Directory.CreateDirectory(jpsavepath);
            }
            //参数设置
            List <string>       paraset    = _argumentProvider.GetArg("paraSet") as List <string>;
            string[]            paras      = paraset.ToArray();
            List <string>       jpfiles    = new List <string>();//存放相减的距平分析文件
            string              date       = "";
            string              jupingfile = "";
            IExtractResultArray array      = new ExtractResultArray("距平分析");
            string              Nostr      = ""; //排除非选择的轨道数据
            if (paras[0] == "Ascend")
            {
                Nostr = "_D_";
            }
            if (paras[0] == "Descend")
            {
                Nostr = "_A_";
            }
            if (paras[1] == "winter")   // inputCurrentFiles = manager.GetFilePathFromList() 冬季的数所是统计出来的。
            {                           // inputHistoryFiles  需要再重新计算一次  *** 这是多对一计算距平
                //比如说要算2000-2013年冬季的距平,需要先分别算出每年冬季的值,用这些值算总的均值。再分别用每年冬季减去总冬季值。
                List <string> files = new List <string>();
                foreach (string file in list2)
                {
                    if (!Path.GetFileName(file).Contains(Nostr))
                    {
                        files.Add(file);
                    }
                }
                inputCurrentFiles = files.ToArray();
                string      outHistoryFile = jpsavepath + "\\" + Path.GetFileNameWithoutExtension(inputCurrentFiles[0]).Substring(0, 14) + "_" + paras[2] + ".dat";
                SNWParaStat snwStat        = new SNWParaStat();
                snwStat.SNWParaAvgStat(inputCurrentFiles, 0.1f, outHistoryFile);
                List <string> temphistory = new List <string>();
                temphistory.Add(outHistoryFile);
                inputHistoryFiles = temphistory.ToArray();
                if (inputCurrentFiles == null || inputCurrentFiles.Length < 0 || inputHistoryFiles == null || inputHistoryFiles.Length < 0)
                {
                    PrintInfo("缺少分析文件");
                    return(null);
                }
                foreach (string inputCurrentFile in inputCurrentFiles)
                {
                    Regex  DataReg2 = new Regex(@"(?<year>\d{4})_(?<month>\d{2})_(?<year>\d{4})_(?<month>\d{1})", RegexOptions.Compiled);
                    Match  m        = DataReg2.Match(inputCurrentFile); //提取每年冬季的时间
                    string year     = "";
                    if (m.Success)
                    {
                        year = m.Value;
                    }
                    jupingfile = JuPinComputer(inputCurrentFile, inputHistoryFiles[0], jpsavepath);
                    string   hdrfile    = Path.GetDirectoryName(jupingfile) + "\\" + Path.GetFileNameWithoutExtension(jupingfile) + ".hdr";
                    FileInfo fi         = new FileInfo(jupingfile);
                    string   newjpfile  = Path.Combine(jpsavepath, Path.GetFileNameWithoutExtension(jupingfile) + "_" + year.Substring(0, 4) + ".dat");
                    string   newhdrfile = Path.Combine(jpsavepath, Path.GetFileNameWithoutExtension(jupingfile) + "_" + year.Substring(0, 4) + ".hdr");
                    fi.MoveTo(newjpfile);
                    FileInfo fihdr = new FileInfo(hdrfile);
                    fihdr.MoveTo(newhdrfile);
                    jpfiles.Add(newjpfile);
                }
            }
            else
            {                                        //例 2013年11月上旬-2013年11月下旬分别与1987-2013年11月上中下旬 同期比较   一对一计算距平
                inputCurrentFiles = list1.ToArray();
                inputHistoryFiles = list2.ToArray();
                if (inputCurrentFiles == null || inputCurrentFiles.Length < 0 || inputHistoryFiles == null || inputHistoryFiles.Length < 0)
                {
                    PrintInfo("缺少分析文件");
                    return(null);
                }
                if ((inputCurrentFiles.Length) * 2 != inputHistoryFiles.Length)
                {
                    MessageBox.Show("当年数据与同期数据不对应");
                    return(null);
                }
                foreach (string inputCurrentFile in inputCurrentFiles)
                {
                    //先假设选择的是旬数据 MWS_MWSD_China_Xun_0SD_A_2011_1_avg.dat
                    //       则同期旬数据 MWS_MWSD_China_Xun_0SD_A_1989_2011_1_avg.dat
                    string cfile = Path.GetFileNameWithoutExtension(inputCurrentFile);
                    Match  m     = DataReg.Match(cfile);
                    if (m.Success)
                    {
                        date = m.Value;    //根据年4个数字来拆分字符串
                    }
                    string bhalf = cfile.Substring(0, cfile.IndexOf(date));
                    string ahalf = cfile.Substring(cfile.IndexOf(date) + 4, cfile.Length - 4 - cfile.IndexOf(date));
                    foreach (string inputHistoryFile in inputHistoryFiles)
                    {
                        string aa = Path.GetFileNameWithoutExtension(inputHistoryFile);
                        if (aa.Contains(bhalf) && aa.Contains(ahalf) && aa.Contains(date) && !aa.Contains(Nostr))
                        {
                            jupingfile = JuPinComputer(inputCurrentFile, inputHistoryFile, jpsavepath);
                            jpfiles.Add(jupingfile);
                            break;
                        }
                    }
                }
            }
            #region  距平的文件在jpfiles 中,下面是裁切和平滑处理
            MulRegionsClip muticlip = new MulRegionsClip(); //裁切
            MWSSmoothHelp  smooth   = new MWSSmoothHelp();  //平滑
            //创建专题图路径
            gxdsave = jpsavepath + "\\" + regionsname + "\\" + "专题图";
            if (!System.IO.Directory.Exists(gxdsave))//如果不存在这个路径
            {
                System.IO.Directory.CreateDirectory(gxdsave);
            }
            //创建平滑路径
            string smoothsave = jpsavepath + "\\" + regionsname + "\\" + "平滑";
            if (!System.IO.Directory.Exists(smoothsave))
            {
                System.IO.Directory.CreateDirectory(smoothsave);
            }
            //创建平滑\\中值
            string filtersave = smoothsave + "\\" + "中值";
            if (!System.IO.Directory.Exists(filtersave))
            {
                System.IO.Directory.CreateDirectory(filtersave);
            }
            if (aoiContainer == null)
            {
                //只做中值处理
                foreach (string infile in jpfiles)
                {
                    // 先判断这个文件是否存在,存在了就不做
                    string filterfile = filtersave + "\\" + Path.GetFileName(infile);
                    if (!File.Exists(filterfile))
                    {
                        filterfile = smooth.ComputerMid(infile, 5, filtersave);
                    }
                    afterProcessfiles.Add(filterfile);
                    toBarfiles.Add(infile);
                }
            }
            else
            {
                // 裁切 // 中值 // 插值
                string clipsave = jpsavepath + "\\" + regionsname + "\\" + "裁切";
                if (!System.IO.Directory.Exists(clipsave))//如果不存在这个路径
                {
                    System.IO.Directory.CreateDirectory(clipsave);
                }
                string bilisave = smoothsave + "\\" + "插值";
                if (!System.IO.Directory.Exists(bilisave))
                {
                    System.IO.Directory.CreateDirectory(bilisave);
                }
                foreach (string infile in jpfiles)
                {
                    string newclipfile = clipsave + "\\" + Path.GetFileName(infile).Replace("China", regionsname);
                    if (!File.Exists(newclipfile))
                    {
                        string clipfile = muticlip.MutiRegionsClip(infile, aoiContainer, clipsave);
                        string hdrfile  = Path.GetDirectoryName(clipfile) + "\\" + Path.GetFileNameWithoutExtension(clipfile) + ".hdr";
                        //重命名
                        string   newhdrfile = Path.Combine(Path.GetDirectoryName(clipfile), Path.GetFileNameWithoutExtension(infile).Replace("China", regionsname) + ".hdr");
                        FileInfo fi         = new FileInfo(clipfile);
                        fi.MoveTo(newclipfile);
                        FileInfo fihdr = new FileInfo(hdrfile);
                        fihdr.MoveTo(newhdrfile);
                    }
                    toBarfiles.Add(newclipfile); //加上裁切后的文件
                    //中值、插值
                    string filterfile = smooth.ComputerMid(newclipfile, 5, filtersave);
                    string bilifile   = smooth.Bilinear(filterfile, 10, bilisave);
                    afterProcessfiles.Add(bilifile);
                }
            }
            #endregion
            //出专题图
            #region
            IExtractResultArray results = new ExtractResultArray("");
            foreach (string arguments in afterProcessfiles.ToArray())
            {
                string product = "";
                if (arguments.Contains("MWSD"))
                {
                    product = "雪深";
                    _argumentProvider.SetArg("OutFileIdentify", "JPDI");
                }
                if (arguments.Contains("MSWE"))
                {
                    product = "雪水当量";
                    _argumentProvider.SetArg("OutFileIdentify", "JPEI");
                }
                //解析文件名确定专题图名称
                string filename = Path.GetFileNameWithoutExtension(arguments);
                if (paras[1] == "usual")
                {
                    Regex  DataReg1 = new Regex(@"(?<year>\d{4})_(?<year>\d{4})", RegexOptions.Compiled);
                    Match  m        = DataReg1.Match(filename);
                    string year     = "";
                    if (m.Success)
                    {
                        year = m.Value;
                    }
                    //提取年至avg之间的字符
                    string   filetime = filename.Substring(filename.IndexOf(year), filename.Length - 3 - filename.IndexOf(year));
                    string[] mxchars  = filetime.Split(new char[] { '_' });
                    string   mx       = "";//月+旬
                    if (filename.Contains("Xun"))
                    {
                        if (mxchars[3] == "1")
                        {
                            mx = mxchars[2] + "月" + "上旬";
                        }
                        if (mxchars[3] == "2")
                        {
                            mx = mxchars[2] + "月" + "中旬";
                        }
                        if (mxchars[3] == "3")
                        {
                            mx = mxchars[2] + "月" + "下旬";
                        }
                    }
                    if (filename.Contains("Month"))
                    {
                        mx = mxchars[2] + "月";
                    }
                    imgname = year.Substring(5, 4) + "年" + mx + regionsname + product + "距平分布图(" + paras[2] + "年)";
                }
                if (paras[1] == "winter")
                {
                    imgname = Path.GetFileNameWithoutExtension(arguments).Substring(Path.GetFileNameWithoutExtension(arguments).Length - 4, 4) + "年" + "冬季" + regionsname + product + "距平分布图(" + paras[2] + "年)";
                }
                _argumentProvider.SetArg("SelectedPrimaryFiles", arguments);
                _argumentProvider.SetArg("fileOpenArgs", arguments);
                FileExtractResult result = ThemeGraphyResult(null) as FileExtractResult;
                //增加矢量
                string autopath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"SystemData\ProductArgs\MWS\shppath.txt");
                string shpFile  = "";
                if (File.Exists(autopath))
                {
                    FileStream   fauto = new FileStream(autopath, FileMode.Open, FileAccess.Read);
                    StreamReader rauto = new StreamReader(fauto, Encoding.GetEncoding("gb2312"));
                    shpFile = rauto.ReadLine();
                    rauto.Close();
                    fauto.Close();
                }
                else
                {
                    shpFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"数据引用\基础矢量\行政区划\线\中国边界_线.shp");
                }
                CreateMcd(shpFile);
                _shpFile = shpFile;
                _gxdFile = (result as FileExtractResult).FileName;
                AddShpToGxd();
                string   newresultfile = Path.Combine(gxdsave, Path.GetFileNameWithoutExtension(arguments) + ".gxd");
                FileInfo fi            = new FileInfo(result.FileName);
                if (!File.Exists(newresultfile))
                {
                    fi.MoveTo(newresultfile);
                }
                else
                {
                    FileInfo fi1 = new FileInfo(newresultfile);
                    fi1.Delete();
                }

                IFileExtractResult res = new FileExtractResult(_subProductDef.Identify, newresultfile, false);
                results.Add(res);
            }
            #endregion
            return(results);
        }