Пример #1
0
        public object Clone()
        {
            ProjectionCoordSystem prj = new ProjectionCoordSystem();

            if (_name != null)
            {
                prj._name = _name.Clone() as NameMapItem;
            }
            if (_parameters != null && _parameters.Length > 0)
            {
                prj._parameters = CloneParameters();
            }
            if (_unit != null)
            {
                prj._unit = _unit.Clone() as AngularUnit;
            }
            return(prj);
        }
        /*
         * PROJECTION["Mercator"],
         * PARAMETER["False_Easting",0.0],
         * PARAMETER["False_Northing",0.0],
         * PARAMETER["Central_Meridian",0.0],
         * PARAMETER["Standard_Parallel_1",0.0],
         * UNIT["Meter",1.0]
         */
        protected override IProjectionCoordSystem ParseProjectionCoordSystem(WktItem wktItem)
        {
            if (wktItem == null)//Is Graphics Coordinate System
            {
                return(null);
            }
            string      name    = wktItem.Value.Split(',')[0].Replace("\"", string.Empty);
            NameMapItem prjName = GetPrjName(wktItem.GetWktItem("PROJECTION"));

            if (prjName == null)
            {
                throw new Exception("投影坐标系统\"" + name + "\"没有在系统中预先配置。");
            }
            NameValuePair[]       parameters = GetPrjParameters(wktItem.GetWktItems("PARAMETER"));
            AngularUnit           unit       = new AngularUnit(wktItem.GetWktItem("UNIT"));
            ProjectionCoordSystem prj        = new ProjectionCoordSystem(prjName, parameters, unit);

            prj.NameDes = name;
            return(prj);
        }