Beispiel #1
0
 public bool IsSame(Spheroid sp)
 {
     return(sp != null && (
                (Math.Abs(SemiminorAxis - sp.SemiminorAxis) < MINI_DOUBLE &&
                 Math.Abs(SemimajorAxis - sp.SemimajorAxis) < MINI_DOUBLE) ||
                (Math.Abs(SemimajorAxis - sp.SemimajorAxis) < MINI_DOUBLE &&
                 Math.Abs(InverseFlattening - sp.InverseFlattening) < MINI_DOUBLE)));
 }
Beispiel #2
0
        public object Clone()
        {
            Spheroid sp = new Spheroid();

            sp.InverseFlattening = this.InverseFlattening;
            sp.Name          = this.Name;
            sp.SemimajorAxis = this.SemimajorAxis;
            sp.SemiminorAxis = this.SemiminorAxis;
            return(sp);
        }
Beispiel #3
0
        public object Clone()
        {
            Spheroid sp = null;

            if (this.Spheroid != null)
            {
                sp = this.Spheroid.Clone() as Spheroid;
            }
            return(new Datum(this.Name, sp));
        }
Beispiel #4
0
        private Datum GetDatum(string name, Dictionary <string, string> nameValuePairs)
        {
            Spheroid spheroid = null;

            if (nameValuePairs.ContainsKey("a") && nameValuePairs.ContainsKey("b") && nameValuePairs.ContainsKey("f"))
            {
                spheroid = new Spheroid();
                spheroid.SemimajorAxis     = double.Parse(nameValuePairs["a"]);
                spheroid.SemiminorAxis     = double.Parse(nameValuePairs["b"]);
                spheroid.InverseFlattening = 1 / double.Parse(nameValuePairs["f"]);
            }
            else
            {
                spheroid = GetSheroidByDatum(name);
            }
            return(new Datum(name, spheroid));
        }
Beispiel #5
0
 public Datum(string name, Spheroid spheroid)
 {
     Name     = name;
     Spheroid = spheroid;
 }
Beispiel #6
0
 //DATUM["D_WGS_1984",
 //             SPHEROID["WGS_1984",6378137.0,298.257223563]
 //            ]
 public Datum(WktItem wktItem)
 {
     Spheroid = new Spheroid(wktItem.GetWktItem("SPHEROID"));
     Name     = (wktItem.Value.Split(',')[0]).Replace("\"", string.Empty);
 }