internal static CoordinateSystemBase Create(ICoordinateSystem coordSys)
        {
            CoordinateSystemBase csb = null;

            try
            {
                //This fails because the XY-M projection is not supported
                csb = new ActualCoordinateSystem(coordSys);
            }
            catch { }

            if (csb == null && coordSys != null)
            {
                IUnit unit = coordSys.GetUnits(0);
                var   au   = unit as IAngularUnit;
                var   lu   = unit as ILinearUnit;
                if (au != null)
                {
                    double radians = au.RadiansPerUnit;
                    csb = new DegreeBasedCoordinateSystem();
                }
                else if (lu != null)
                {
                    csb = new MeterBasedCoordinateSystem(lu.MetersPerUnit, lu.MetersPerUnit);
                }
            }

            if (csb == null)
            {
                csb = new MeterBasedCoordinateSystem();
            }

            return(csb);
        }
Пример #2
0
        /// <summary>
        /// Gets the coordinate system for the given well-known text
        /// </summary>
        /// <param name="wkt"></param>
        /// <returns></returns>
        public virtual ICoordinateSystemRef CreateCoordinateSystem(string wkt)
        {
            var cs = CoordinateSystemBase.Create(wkt);

            return(new CSRef(cs));
        }
Пример #3
0
 public CSRef(CoordinateSystemBase cs)
 {
     _cs = cs;
 }