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))); }
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); }
public object Clone() { Spheroid sp = null; if (this.Spheroid != null) { sp = this.Spheroid.Clone() as Spheroid; } return(new Datum(this.Name, sp)); }
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)); }
public Datum(string name, Spheroid spheroid) { Name = name; Spheroid = spheroid; }
//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); }