ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
coordinate_conversion.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017-2020 German Aerospace Center (DLR).
3  * Eclipse ADORe, Automated Driving Open Research https://eclipse.org/adore
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License 2.0 which is available at
7  * http://www.eclipse.org/legal/epl-2.0.
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  * Reza Dariani - initial API and implementation
13  ********************************************************************************/
14 
15 #pragma once
16 #include <math.h>
21 //https://de.wikipedia.org/wiki/World_Geodetic_System_1984
22 //http://alephnull.net/software/gis/UTM_WGS84_C_plus_plus.shtml
23 //https://www.springer.com/de/book/9783211835340
24 // Hoffmann-Wellenhof, B., Lichtenegger, H., and Collins, J. GPS: Theory and Practice, 3rd ed. New York: Springer-Verlag Wien, 1994
25 //Germany has 3 different UTM zones see: http://www.killetsoft.de/t_0901_d.htm
26 
27 #define sm_a 6378137.0 //Ellipsoid model major axis
28 #define sm_b 6356752.314 //Ellipsoid model minor axis
29 #define sm_EccSquared 6.69437999013e-03
30 #define UTMScaleFactor 0.9996
31 #define PI 3.14159265358979
32 namespace adore
33 {
34  namespace mad
35  {
36  class CoordinateConversion
37  {
38 
39  public:
47  static int LatLonToUTMXY (double lat, double lon, int zone, double& x, double& y);
57  static void UTMXYToLatLon (double x, double y, int zone, bool southhemi, double& lat, double& lon);
67  static void UTMXYToLatLonDegree (double x, double y, int zone, bool southhemi, double& lat, double& lon);
73  static double DegToRad(double deg);
79  static double RadToDeg(double rad);
85  static double twoPIrange(double rad);
86 
87  private:
88  static double ArcLengthOfMeridian (double phi) ;
89  static double UTMCentralMeridian(int zone);
90  static double FootpointLatitude(double y);
91 
92  static void MapLatLonToXY (double phi, double lambda, double lambda0, double &x, double &y);
93  static void MapXYToLatLon (double x, double y, double lambda0, double& phi, double& lambda);
94  };
95  }
96 }
static double FootpointLatitude(double y)
static void MapLatLonToXY(double phi, double lambda, double lambda0, double &x, double &y)
static double twoPIrange(double rad)
static void MapXYToLatLon(double x, double y, double lambda0, double &phi, double &lambda)
static double UTMCentralMeridian(int zone)
static void UTMXYToLatLon(double x, double y, int zone, bool southhemi, double &lat, double &lon)
static double RadToDeg(double rad)
static double DegToRad(double deg)
static int LatLonToUTMXY(double lat, double lon, int zone, double &x, double &y)
static double ArcLengthOfMeridian(double phi)
static void UTMXYToLatLonDegree(double x, double y, int zone, bool southhemi, double &lat, double &lon)
x
Definition: adore_set_goal.py:30
y
Definition: adore_set_goal.py:31
Definition: areaofeffectconverter.h:20