Пример #1
0
        public ConfigHeadItem(XmlNode headNode)
        {
            XmlAttributeCollection pAttributeCollection = headNode.Attributes;

            ///读取特征属性
            XmlAttribute pAttribute = pAttributeCollection["Symbol"];

            if (pAttribute != null)
            {
                m_Symbol = pAttribute.Value;
            }

            ///读取特征说明
            pAttribute = pAttributeCollection["AlisName"];
            if (pAttribute != null)
            {
                m_AlisName = pAttribute.Value;
            }

            ///读取特征值
            pAttribute = pAttributeCollection["Mark"];
            if (pAttribute != null)
            {
                m_Mark = pAttribute.Value;
            }

            ///读取特征值
            pAttribute = pAttributeCollection["Defualt"];
            if (pAttribute != null)
            {
                m_Defualt = pAttribute.Value;
            }

            m_Name = headNode.Name;
            foreach (XmlNode item in headNode.ChildNodes)
            {
                ConfigInfo info = GetConfigInfo(item);
                m_ConfigInfo.Add(info);
            }
        }
Пример #2
0
        /// <summary>
        /// 解析xml属性获取配置信息
        /// </summary>
        /// <param name="pInfoNode"></param>
        /// <returns></returns>
        private ConfigInfo GetConfigInfo(XmlNode pInfoNode)
        {
            string sSymbol = "";
            string sValue = "";
            string sMark = "";
            XmlAttributeCollection pAttributeCollection = pInfoNode.Attributes;

            ///读取特征属性
            XmlAttribute pAttribute = pAttributeCollection["Symbol"];
            if (pAttribute != null)
                sSymbol = pAttribute.Value;

            ///读取特征说明
            pAttribute = pAttributeCollection["AlisName"];
            if (pAttribute != null)
                sValue = pAttribute.Value;

            ///读取特征值
            pAttribute = pAttributeCollection["Mark"];
            if (pAttribute != null)
                sMark = pAttribute.Value;

            ConfigInfo info = new ConfigInfo(sSymbol, sValue, sMark);
            return info;
        }
Пример #3
0
        /// <summary>
        /// 初始化头文件配置信息
        /// </summary>
        /// <param name="pHeadNode"></param>
        /// <returns></returns>
        public bool Initial(XmlNode pHeadNode)
        {
            if (pHeadNode == null)
                return false;
            foreach (XmlNode pHeadInfo in pHeadNode.ChildNodes)
            {
                ///处理坐标系统类型
                if (pHeadInfo.Name == "COORDINATESYSTEMTYPE")
                {
                    m_CoordSystemType = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                ///处理坐标维数
                if (pHeadInfo.Name == "COORDINATEDIM")
                {
                    m_CoordinateDim = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                ///X坐标轴方向
                if (pHeadInfo.Name == "XAXISDIRECTION")
                {
                    m_XAxisDirection = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                ///Y坐标轴方向
                if (pHeadInfo.Name == "YAXISDIRECTION")
                {
                    m_YAxisDirection = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                 ///坐标单位
                if (pHeadInfo.Name == "COORDINATEUNIT")
                {
                    m_CoordinateUnit = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                ///版本
                if (pHeadInfo.Name == "VERSION")
                {
                    m_Version = new ConfigHeadItem(pHeadInfo);
                    if (m_Version != null)
                    {
                        ////修改默认值为当前标准
                      string strMark = m_DBStandard.ToString();
                      foreach (ConfigInfo item in m_Version.ConfigInfoList)
                      {
                          if (strMark.Trim() == item.Mark.Trim())
                          {
                              m_Version.Defualt = item.Symbol;
                              break;
                          }
                      }
                    }
                    continue;
                }

                ///分隔符
                if (pHeadInfo.Name == "SEPARATOR")
                {
                    m_Sparator = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///头信息分隔符
                if (pHeadInfo.Name == "HEADSEPARATOR")
                {
                    m_HeadSpilit = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///参考椭球
                if (pHeadInfo.Name == "SPHEROID")
                {
                    m_Spheroid = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///数据标识
                if (pHeadInfo.Name == "DATAMERK")
                {
                    m_DataMark = GetConfigInfo(pHeadInfo);
                    continue;
                }

                /////版本
                //if (pHeadInfo.Name == "VERSION")
                //{
                //    m_Version = GetConfigInfo(pHeadInfo);
                //    continue;
                //}

                //投影类型
                if (pHeadInfo.Name == "PROJECTION")
                {
                    m_Projection = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///首子午线
                if (pHeadInfo.Name == "PRIMEMERIDIAN")
                {
                    m_PrimeMeridian = GetConfigInfo(pHeadInfo);
                    continue;
                }

                /////投影类型
                //if (pHeadInfo.Name == "PROJECTIONTYPE")
                //{
                //    m_ProjectionType = GetConfigInfo(pHeadInfo);
                //    continue;
                //}

                ///投影参数
                if (pHeadInfo.Name == "PROJECTIONPARAMETOR")
                {
                    m_ProjectionParator = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///高程基准
                if (pHeadInfo.Name == "VERTICAL")
                {
                    m_Vertical = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///时间参考系
                if (pHeadInfo.Name == "TEMPORALREFERENCESYSTEM")
                {
                    m_TemporalReferenceSystem = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///最大坐标
                if (pHeadInfo.Name == "MAXLOCAL")
                {
                    m_MaxCoordinate = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///最小坐标
                if (pHeadInfo.Name == "MINLOCAL")
                {
                    m_MinCoordinate = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///比例尺
                if (pHeadInfo.Name == "SCALE")
                {
                    m_Scale = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///偏移量
                if (pHeadInfo.Name == "EXCURSION")
                {
                    m_Excurtion = GetConfigInfo(pHeadInfo);
                    continue;
                }
                 ///土地规划批准时间
                if (pHeadInfo.Name == "PASSTIME")
                {
                    m_PassTime = GetConfigInfo(pHeadInfo);
                    continue;
                }
            }
            return true;
        }
Пример #4
0
        /// <summary>
        /// 根据vct文件中的特征值获取标志
        /// </summary>
        /// <param name="sNodeName">所在标准文件的头文件节点名称</param>
        /// <param name="strSymbol">vct文件中的特征值</param>
        /// <returns></returns>
        public string GetGraphMark(string sNodeName, string strSymbol)
        {
            try
            {
                #region
                ///点的特征类型
                if (sNodeName == "POINTFEATURETYPE")
                {
                    for (int i = 0; i < this.PointFeatureType.Count; i++)
                    {
                        ConfigInfo pPointFeatureType = this.PointFeatureType[i];
                        if (strSymbol == pPointFeatureType.Symbol)
                        {
                            return(pPointFeatureType.Mark);
                        }
                    }
                }///线的特征类型
                else if (sNodeName == "LINEFEATURETYPE")
                {
                    for (int i = 0; i < this.LineFeatureType.Count; i++)
                    {
                        ConfigInfo pLineFeatureType = this.LineFeatureType[i];
                        if (strSymbol == pLineFeatureType.Symbol)
                        {
                            return(pLineFeatureType.Mark);
                        }
                    }
                }//线段类型
                else if (sNodeName == "LINETYPE")
                {
                    for (int i = 0; i < this.StructLineType.Count; i++)
                    {
                        ConfigInfo pStructLineType = this.StructLineType[i];
                        if (strSymbol == pStructLineType.Symbol)
                        {
                            return(pStructLineType.Mark);
                        }
                    }
                }//面的特征类型
                else if (sNodeName == "POLYGONFEATURETYPE")
                {
                    for (int i = 0; i < this.PolygonFeatureType.Count; i++)
                    {
                        ConfigInfo pPolygonFeatureType = this.PolygonFeatureType[i];
                        if (strSymbol == pPolygonFeatureType.Symbol)
                        {
                            return(pPolygonFeatureType.Mark);
                        }
                    }
                }///间接坐标面的构成类型
                else if (sNodeName == "POLYGONTYPE")
                {
                    for (int i = 0; i < this.StructPolygonType.Count; i++)
                    {
                        ConfigInfo pStructPolygonType = this.StructPolygonType[i];
                        if (strSymbol == pStructPolygonType.Symbol)
                        {
                            return(pStructPolygonType.Mark);
                        }
                    }
                }///注记的特征类型
                else if (sNodeName == "ANNOTATIONFEATURETYPE")
                {
                    for (int i = 0; i < this.AnnotationFeatureType.Count; i++)
                    {
                        ConfigInfo pAnnotationFeatureType = this.AnnotationFeatureType[i];
                        if (strSymbol == pAnnotationFeatureType.Symbol)
                        {
                            return(pAnnotationFeatureType.Mark);
                        }
                    }
                }
                return("");

                #endregion
            }
            catch (Exception ex)
            {
                LogAPI.WriteErrorLog(ex);
                return("");
            }
        }
Пример #5
0
        /// <summary>
        /// 根据vct文件中的特征值获取标志
        /// </summary>
        /// <param name="sNodeName">所在标准文件的节点名称</param>
        /// <param name="strSymbol">vct文件中的特征值</param>
        /// <returns></returns>
        public string GetHeadMark(string strSymbol)
        {
            try
            {
                #region
                ///坐标系统类型

                ConfigHeadItem pSystemTypeInfo = this.CoordSystemType;
                if (strSymbol == pSystemTypeInfo.Symbol)
                {
                    return(pSystemTypeInfo.Mark);
                }

                ////坐标维数

                ConfigHeadItem pSystemDimInfo = this.CoordinateDim;
                if (strSymbol == pSystemDimInfo.Symbol)
                {
                    return(pSystemDimInfo.Mark);
                }

                ////版本
                ConfigHeadItem pVersion = this.Version;
                if (strSymbol == pVersion.Symbol)
                {
                    return(pVersion.Mark);
                }

                ///x坐标轴方向


                ConfigHeadItem pAxisDirection = this.XAxisDirection;
                if (strSymbol == pAxisDirection.Symbol)
                {
                    return(pAxisDirection.Mark);
                }


                ///y坐标轴方向
                pAxisDirection = this.YAxisDirection;
                if (strSymbol == pAxisDirection.Symbol)
                {
                    return(pAxisDirection.Mark);
                }

                ///坐标单位

                ConfigHeadItem pCoordinateUnit = this.CoordinateUnit;
                if (strSymbol == pCoordinateUnit.Symbol)
                {
                    return(pCoordinateUnit.Mark);
                }

                ///首子午线

                ConfigInfo pConfig = this.PrimeMeridian;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///分隔符

                pConfig = this.Sparator;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }


                ///数据标识
                pConfig = this.DataMark;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }


                ///参考椭球
                pConfig = this.Spheroid;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///投影类型
                pConfig = this.Projection;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///投影参数
                pConfig = this.ProjectionParator;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///高程基准
                pConfig = this.Vertical;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///时间参考系
                pConfig = this.TemporalReferenceSystem;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///最大坐标
                pConfig = this.MaxCoordinate;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///最小坐标
                pConfig = this.MinCoordinate;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///比例尺
                pConfig = this.Scale;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///坐标偏移量
                pConfig = this.Excurtion;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                ///土地规划批准时间
                pConfig = this.PassTime;
                if (strSymbol == pConfig.Symbol)
                {
                    return(pConfig.Mark);
                }

                return("");

                #endregion
            }
            catch (Exception ex)
            {
                Logger.WriteErrorLog(ex);
                return("");
            }
        }
Пример #6
0
        /// <summary>
        /// 初始化头文件配置信息
        /// </summary>
        /// <param name="pHeadNode"></param>
        /// <returns></returns>
        public bool Initial(XmlNode pHeadNode)
        {
            if (pHeadNode == null)
            {
                return(false);
            }
            foreach (XmlNode pHeadInfo in pHeadNode.ChildNodes)
            {
                ///处理坐标系统类型
                if (pHeadInfo.Name == "COORDINATESYSTEMTYPE")
                {
                    m_CoordSystemType = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                ///处理坐标维数
                if (pHeadInfo.Name == "COORDINATEDIM")
                {
                    m_CoordinateDim = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                ///X坐标轴方向
                if (pHeadInfo.Name == "XAXISDIRECTION")
                {
                    m_XAxisDirection = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                ///Y坐标轴方向
                if (pHeadInfo.Name == "YAXISDIRECTION")
                {
                    m_YAxisDirection = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                ///坐标单位
                if (pHeadInfo.Name == "COORDINATEUNIT")
                {
                    m_CoordinateUnit = new ConfigHeadItem(pHeadInfo);
                    continue;
                }

                ///版本
                if (pHeadInfo.Name == "VERSION")
                {
                    m_Version = new ConfigHeadItem(pHeadInfo);
                    if (m_Version != null)
                    {
                        ////修改默认值为当前标准
                        string strMark = m_DBStandard.ToString();
                        foreach (ConfigInfo item in m_Version.ConfigInfoList)
                        {
                            if (strMark.Trim() == item.Mark.Trim())
                            {
                                m_Version.Defualt = item.Symbol;
                                break;
                            }
                        }
                    }
                    continue;
                }

                ///分隔符
                if (pHeadInfo.Name == "SEPARATOR")
                {
                    m_Sparator = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///头信息分隔符
                if (pHeadInfo.Name == "HEADSEPARATOR")
                {
                    m_HeadSpilit = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///参考椭球
                if (pHeadInfo.Name == "SPHEROID")
                {
                    m_Spheroid = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///数据标识
                if (pHeadInfo.Name == "DATAMERK")
                {
                    m_DataMark = GetConfigInfo(pHeadInfo);
                    continue;
                }

                /////版本
                //if (pHeadInfo.Name == "VERSION")
                //{
                //    m_Version = GetConfigInfo(pHeadInfo);
                //    continue;
                //}

                //投影类型
                if (pHeadInfo.Name == "PROJECTION")
                {
                    m_Projection = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///首子午线
                if (pHeadInfo.Name == "PRIMEMERIDIAN")
                {
                    m_PrimeMeridian = GetConfigInfo(pHeadInfo);
                    continue;
                }

                /////投影类型
                //if (pHeadInfo.Name == "PROJECTIONTYPE")
                //{
                //    m_ProjectionType = GetConfigInfo(pHeadInfo);
                //    continue;
                //}

                ///投影参数
                if (pHeadInfo.Name == "PROJECTIONPARAMETOR")
                {
                    m_ProjectionParator = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///高程基准
                if (pHeadInfo.Name == "VERTICAL")
                {
                    m_Vertical = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///时间参考系
                if (pHeadInfo.Name == "TEMPORALREFERENCESYSTEM")
                {
                    m_TemporalReferenceSystem = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///最大坐标
                if (pHeadInfo.Name == "MAXLOCAL")
                {
                    m_MaxCoordinate = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///最小坐标
                if (pHeadInfo.Name == "MINLOCAL")
                {
                    m_MinCoordinate = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///比例尺
                if (pHeadInfo.Name == "SCALE")
                {
                    m_Scale = GetConfigInfo(pHeadInfo);
                    continue;
                }

                ///偏移量
                if (pHeadInfo.Name == "EXCURSION")
                {
                    m_Excurtion = GetConfigInfo(pHeadInfo);
                    continue;
                }
                ///土地规划批准时间
                if (pHeadInfo.Name == "PASSTIME")
                {
                    m_PassTime = GetConfigInfo(pHeadInfo);
                    continue;
                }
            }
            return(true);
        }