Пример #1
0
 public Proj4DatumWrapper(Datum datum, Proj4MeridianWrapper meridian)
 {
     if (datum == null) throw new ArgumentNullException("datum");
     if (meridian == null) throw new ArgumentNullException("meridian");
     if (datum.Spheroid == null) throw new ArgumentException("Datum has no spheroid.", "datum");
     Contract.EndContractBlock();
     Core = datum;
     PrimeMeridian = meridian;
 }
Пример #2
0
 public Proj4DatumWrapper(Datum datum, Proj4MeridianWrapper meridian)
 {
     if (datum == null)
     {
         throw new ArgumentNullException("datum");
     }
     if (meridian == null)
     {
         throw new ArgumentNullException("meridian");
     }
     if (datum.Spheroid == null)
     {
         throw new ArgumentException("Datum has no spheroid.", "datum");
     }
     Contract.EndContractBlock();
     Core          = datum;
     PrimeMeridian = meridian;
 }
Пример #3
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);
        }