コード例 #1
0
        /// <summary>
        /// 读取数据
        /// </summary>
        public static Data.Rinex.RinexObsFile ReadFile(string ObsPath)
        {
            Data.Rinex.RinexObsFile ObsFile = null;
            string lastChar  = Geo.Utils.StringUtil.GetLastChar(ObsPath);
            string lastChar3 = Geo.Utils.StringUtil.GetLastChar(ObsPath, 3);
            string lastChar5 = Geo.Utils.StringUtil.GetLastChar(ObsPath, 5);

            if (String.Equals(lastChar, "o", StringComparison.CurrentCultureIgnoreCase) || String.Equals(lastChar3, "rnx", StringComparison.CurrentCultureIgnoreCase))
            {
                var obsFileReader = new RinexObsFileReader(ObsPath);
                ObsFile = obsFileReader.ReadObsFile();
            }

            if (String.Equals(lastChar, "z", StringComparison.CurrentCultureIgnoreCase) ||
                String.Equals(lastChar3, "crx", StringComparison.CurrentCultureIgnoreCase) ||
                String.Equals(lastChar5, "crx.gz", StringComparison.CurrentCultureIgnoreCase)
                )
            {
                Geo.IO.InputFileManager inputFileManager = new Geo.IO.InputFileManager(Setting.TempDirectory);
                ObsPath = inputFileManager.GetLocalFilePath(ObsPath, "*.*o;*.rnx", "*.*");
                var obsFileReader = new RinexObsFileReader(ObsPath);
                ObsFile = obsFileReader.ReadObsFile();
            }
            if (String.Equals(lastChar, "s", StringComparison.CurrentCultureIgnoreCase))
            {
                ObsFile = new TableObsFileReader(ObsPath).Read();
            }
            if (ObsFile == null)
            {
                throw new Exception("不支持输入文件格式!");
                return(ObsFile);
            }
            return(ObsFile);
        }
コード例 #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dcbFileDir">地址目录</param>
        /// <param name="Option">设置</param>
        public DcbDataService(string dcbFileDir, GnssProcessOption Option = null) : base(dcbFileDir)
        {
            this.GnssOption  = Option;
            data             = new Dictionary <string, DcbFile>();
            InputFileManager = new Geo.IO.InputFileManager(dcbFileDir);

            TotalLocalDirectories = new List <string>();
            TotalLocalDirectories.Add(dcbFileDir);
            TotalLocalDirectories.Add(DownloadDirectory);
            TotalLocalDirectories.AddRange(IgsProductDirectories);
        }
コード例 #3
0
ファイル: GnssFormFactory.cs プロジェクト: yxw027/GNSSer
        /// <summary>
        /// open one OpenFileDialog to select rinex O files, and create one anyinfo point layer;
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public static Layer OpenAndShowOFileOnMap(string title)
        {
            Layer          layer          = null;
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter      = Setting.RinexOFileFilter;
            openFileDialog.Multiselect = true;

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string[] files = openFileDialog.FileNames;
                List <AnyInfo.Geometries.Point> lonlats = new List <AnyInfo.Geometries.Point>();


                Geo.IO.InputFileManager inputFileManager = new Geo.IO.InputFileManager(Setting.TempDirectory);

                foreach (var item in files)
                {
                    var local = inputFileManager.GetLocalFilePath(item, "*.*O;*.rnx", "*.*");
                    Data.Rinex.RinexObsFileHeader header = new Data.Rinex.RinexObsFileReader(local).GetHeader();
                    if (header.ApproxXyz == null)
                    {
                        continue;
                    }

                    Geo.Coordinates.GeoCoord lonlat = Geo.Coordinates.CoordTransformer.XyzToGeoCoord(header.ApproxXyz);
                    lonlats.Add(new AnyInfo.Geometries.Point(lonlat, Path.GetFileNameWithoutExtension(item).Substring(0, 4))
                    {
                        Name = header.MarkerName
                    });
                    header = null;//释放资源。
                }
                layer = LayerFactory.CreatePointLayer(lonlats, title);
            }
            return(layer);
        }