Beispiel #1
0
 public Proj4CrsGeographic(GeographicInfo geographicInfo)
     : base(geographicInfo.Name ?? geographicInfo.Datum.Name ?? "Unknown", new AuthorityTag("PROJ4", String.Empty))
 {
     Contract.Requires(geographicInfo != null);
     Contract.Requires(geographicInfo.Meridian != null);
     Contract.Requires(geographicInfo.Datum != null);
     Contract.Requires(geographicInfo.Datum.Spheroid != null);
     Core  = geographicInfo;
     Datum = Proj4DatumWrapper.CreateWrapper(geographicInfo);
 }
Beispiel #2
0
        public static GeographicInfo CreateGeographic(ICrsGeodetic crsGeodetic)
        {
            if (crsGeodetic == null)
            {
                throw new ArgumentNullException("crsGeodetic");
            }
            Contract.Requires(crsGeodetic.Datum.PrimeMeridian != null);
            Contract.Ensures(Contract.Result <GeographicInfo>() != null);

            var result = new GeographicInfo {
                Name = crsGeodetic.Name
            };

            result.Datum = Proj4DatumWrapper.Create(crsGeodetic.Datum);

            Contract.Assume(crsGeodetic.Datum.PrimeMeridian != null);
            result.Meridian = Proj4MeridianWrapper.Create(crsGeodetic.Datum.PrimeMeridian);

            // TODO: set the unit

            return(result);
        }