/// <summary>Creates an AXPoint from WGS84 lat/lon coordinates. Time is unknown and altitude is not barometric /// </summary> /// <param name="latitude"></param> /// <param name="longitude"></param> /// <param name="altitude"></param> /// <returns></returns> public AXPoint FromLatLonToAXPoint(double latitude, double longitude, double altitude) { var llc = new LatLonCoordinates(Datum.GetInstance("WGS84"), latitude, longitude, altitude); var utmc = llc.ToUtm(Datum.GetInstance(DatumName), UtmZone); return(new AXPoint(Date.Date, utmc)); }
private void buttonCoords_Click(object sender, RoutedEventArgs e) { var wgs84 = Datum.GetInstance("WGS84"); var ed50 = Datum.GetInstance("European 1950"); var osgb36 = Datum.GetInstance("OSGB36"); Coordinates p1, p2, p3; Print("From latlon WGS84 to UTM ED50 and back"); p1 = new LatLonCoordinates(wgs84, 41.973256, 2.780310, 87.0); p2 = p1.ToUtm(ed50); p3 = p2.ToLatLon(wgs84); Print(p1.ToString()); Print(p2.ToString()); Print(p3.ToString()); Print(""); Print("From UTM ED50 to UTM WGS84 and back"); p1 = new UtmCoordinates(ed50, "31T", 365000, 4612000, 56); p2 = p1.ToUtm(wgs84); p3 = p2.ToUtm(ed50); Print(p1.ToString()); Print(p2.ToString()); Print(p3.ToString()); Print(""); Print("From UTM ED50 (default zone) to UTM ED50 (different zone) and back"); p1 = new UtmCoordinates(ed50, "31T", 365000, 4612000, 56); p2 = p1.ToUtm(ed50, "30T"); p3 = p2.ToUtm(ed50); Print(p1.ToString()); Print(p2.ToString()); Print(p3.ToString()); Print(""); }