Beispiel #1
0
        private void AngleMosaicToFile()
        {
            int          length = inArg.MosaicEnvelopes.Length;
            DataIdentify di     = DataIdentifyMatcher.Match(GetFirstname(inArg.InputFilename));

            for (int i = 0; i < length; i++)
            {
                string tFilename = GetSpliceFilename(inArg.MosaicResoultionX, di, inArg, inArg.MosaicEnvelopes[i].Name);
                AngleMosaic.Mosaic(new string[] { inArg.InputFilename, inArg.OutputDir + "\\" + tFilename, inArg.MosaicBands, GetGeoHeadInfo(inArg.MosaicEnvelopes[i]), inArg.MosaicIdentify });
            }
        }
Beispiel #2
0
        private void UpdateFileItemsAddToList(string[] files, bool checkTime, DateTime beginTime, DateTime endTime)
        {
            lstFileInfoList.Items.Clear();
            RasterIdentify rid = null;
            FileListItem   fli = null;

            if (checkTime)
            {
                foreach (string file in files)
                {
                    DataIdentify di = DataIdentifyMatcher.Match(Path.GetFileName(file));
                    rid               = new RasterIdentify();
                    rid.OriFileName   = new string[] { file };
                    rid.Satellite     = di.Satellite;
                    rid.Sensor        = di.Sensor;
                    rid.OrbitDateTime = di.OrbitDateTime;
                    FillRid(ref rid);
                    if (rid.OrbitDateTime == DateTime.MinValue || rid.OrbitDateTime > Convert.ToDateTime(endTime.ToString("MM-dd-yyyy") + " 23:59:59") ||
                        rid.OrbitDateTime < Convert.ToDateTime(beginTime.ToString("MM-dd-yyyy") + " 00:00:00"))
                    {
                        continue;
                    }
                    fli = new FileListItem(file, rid);
                    AddToFileListItem(fli);
                }
            }
            else
            {
                foreach (string file in files)
                {
                    DataIdentify di = DataIdentifyMatcher.Match(Path.GetFileName(file));
                    rid               = new RasterIdentify();
                    rid.OriFileName   = new string[] { file };
                    rid.Satellite     = di.Satellite;
                    rid.Sensor        = di.Sensor;
                    rid.OrbitDateTime = di.OrbitDateTime;
                    FillRid(ref rid);
                    fli = new FileListItem(file, rid);
                    AddToFileListItem(fli);
                }
            }
            if (lstFileInfoList.Items.Count != 0)
            {
                lstFileInfoList.Items[0].Selected = true;
            }
        }
Beispiel #3
0
        /*
         *分卫星 传感器
         *日信息:卫星_传感器_年_季_月_旬_日_时间起_时间止
         *旬信息: 卫星_传感器_年_季_月_旬_时间起_时间止
         *月信息:卫星_传感器_年_季_月_时间起_时间止
         * 季信息:卫星_传感器_年_季_时间起_时间止
         * 年信息:卫星_传感器_年_时间起_时间止
         *
         * 周信息:卫星_传感器_年_周_时间起_时间止
         */
        public static CYCAFileListInfo GeneralFileList(string[] files, RegionArg args, SubProductDef subPro, string outSubProIdentify)
        {
            CYCAFileListInfo result = new CYCAFileListInfo();

            GetMaxCyctime(args, ref result);
            if (result.Days001Files == null)
            {
                return(null);
            }
            DataIdentify   di       = null;
            string         fileInfo = string.Empty;
            RasterIdentify ri       = null;

            foreach (string file in files)
            {
                di = DataIdentifyMatcher.Match(file);
                string days001file = AddDays001FilesInfo(ref result, di, args, subPro, file, out ri, out fileInfo, outSubProIdentify);
                if (result.Days007Files != null && !string.IsNullOrEmpty(days001file))
                {
                    AddDays007FilesInfo(ref result, ri, args, subPro, days001file, fileInfo);
                }
                string days010file = string.Empty;
                if (result.Days010Files != null && !string.IsNullOrEmpty(days001file))
                {
                    days010file = AddDays010FilesInfo(ref result, ri, args, subPro, days001file, ref fileInfo);
                }
                string days030file = string.Empty;
                if (result.Days030Files != null && !string.IsNullOrEmpty(days010file))
                {
                    days030file = AddDays030FilesInfo(ref result, ri, args, subPro, days010file, ref fileInfo);
                }
                string days090file = string.Empty;
                if (result.Days090Files != null && !string.IsNullOrEmpty(days030file))
                {
                    days090file = AddDays090FilesInfo(ref result, ri, args, subPro, days030file, ref fileInfo);
                }
                string days365file = string.Empty;
                if (result.Days365Files != null && !string.IsNullOrEmpty(days090file))
                {
                    days365file = AddDays365FilesInfo(ref result, ri, args, subPro, days090file, ref fileInfo);
                }
            }
            return(result);
        }
Beispiel #4
0
        private void UpdateOutPutFilename(string inFilename)
        {
            string       filename = Path.GetFileNameWithoutExtension(inFilename);
            DataIdentify df       = DataIdentifyMatcher.Match(inFilename);

            string[] names = filename.Split('_');
            if (names.Length > 8)
            {
                names[2] = "GLL";
            }
            string newFilename = names[0];

            for (int i = 1; i < names.Length; i++)
            {
                string name = names[i];
                newFilename = newFilename + "_" + name;
            }
            string filenameExt = ".LDF";

            textBox3.Text = Path.Combine(Path.GetDirectoryName(inFilename), newFilename + filenameExt);
        }
Beispiel #5
0
        private void TryGetBandProviderDefinition(string fname, Dictionary <string, string> subdatasets)
        {
            List <string> datasetNames = null;

            if (subdatasets != null)
            {
                datasetNames = GetDatasetNames(subdatasets);
            }
            BandProviderDef[] bandProviderDefs = null;
            //Console.WriteLine(this.GetType().Assembly.Location);
            string configfile = Path.Combine(Path.GetDirectoryName(this.GetType().Assembly.Location), "GeoDo.RSS.DF.GDAL.H4BandPrd.xml");

            using (H4BandProviderXmlParser xml = new H4BandProviderXmlParser(configfile))
            {
                bandProviderDefs = xml.GetBandProviderDefs();
            }
            if (bandProviderDefs == null)
            {
                return;
            }
            string dayornight = "";

            using (Hdf4Operator hdf = new Hdf4Operator(fname))
            {
                foreach (BandProviderDef prddef in bandProviderDefs)
                {
                    bool isMatched = true;
                    if (datasetNames != null)
                    {
                        foreach (DefaultBandDatasetDef bandDef in prddef.DefaultBandDatasetDefs)
                        {
                            if (!datasetNames.Contains(bandDef.Name))
                            {
                                isMatched = false;
                                break;
                            }
                        }
                        if (!isMatched)
                        {
                            continue;
                        }
                    }
                    foreach (IdentifyAttDef id in prddef.IdentifyAttDefs)
                    {
                        string attvalue = hdf.GetAttributeValue(id.Name);
                        if (attvalue != id.Value)
                        {
                            isMatched = false;
                            break;
                        }
                    }
                    //增加对网站下载MODIS数据的支持,数据未在属性中定义卫星、传感器信息
                    if (!isMatched)
                    {
                        DataIdentify di = DataIdentifyMatcher.Match(fname);
                        if (di != null && !string.IsNullOrEmpty(di.Satellite))
                        {
                            foreach (IdentifyAttDef id in prddef.IdentifyAttDefs)
                            {
                                if (di.Satellite.ToUpper() == id.Value.ToUpper())
                                {
                                    isMatched = true;
                                    break;
                                }
                            }
                        }
                    }
                    if (isMatched)
                    {
                        _matchedBandProviderDef = prddef;
                        break;
                    }
                }
                dayornight = TryGetDayOrnight(hdf);
            }
            if (_matchedBandProviderDef != null)
            {
                _dataIdentify         = new DataIdentify(_matchedBandProviderDef.Satellite, _matchedBandProviderDef.Sensor);
                _dataIdentify.IsOrbit = true;
                TrySetIdentifyByName(fname);
                TryGetOrbitDirection(dayornight, _matchedBandProviderDef.Satellite);
            }
        }