UNCLASSIFIED

GeographicTranslator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
TransverseMercator.h
Go to the documentation of this file.
1 // CLASSIFICATION: UNCLASSIFIED
2 
3 #ifndef TransverseMercator_H
4 #define TransverseMercator_H
5 
6 /***************************************************************************/
7 /* RSC IDENTIFIER: TRANSVERSE MERCATOR
8  *
9  * ABSTRACT
10  *
11  * This component provides conversions between Geodetic coordinates
12  * (latitude and longitude) and Transverse Mercator projection coordinates
13  * (easting and northing).
14  *
15  * ERROR HANDLING
16  *
17  * This component checks parameters for valid values. An exception is
18  * returned for invalid parameters.
19  *
20  * REFERENCES
21  *
22  * Based on NGA.SIG.0012_2.0.0_UTMUPS 25MAR2014
23  * "The Universal Grids and the Transverse Mercator and
24  * Polar Stereographic Map Projections"
25  *
26  * LICENSES
27  *
28  * None apply to this component.
29  *
30  * RESTRICTIONS
31  *
32  * TRANSVERSE MERCATOR has no restrictions.
33  *
34  * MODIFICATIONS
35  *
36  * Date Description
37  * ---- -----------
38  * 2-26-07 Original C++ Code
39  * 7-01-14 Updated algorithm in NGA.SIG.0012_2.0.0_UTMUPS.
40  *
41  */
42 
43 #include "DtccApi.h"
44 #include "CoordinateSystem.h"
45 
46 namespace MSP
47 {
48  namespace CCS
49  {
50  class MapProjection5Parameters;
51  class MapProjectionCoordinates;
52  class GeodeticCoordinates;
53 
60  {
61  public:
62 
79  double ellipsoidSemiMajorAxis,
80  double ellipsoidFlattening,
81  double centralMeridian,
82  double latitudeOfTrueScale,
83  double falseEasting,
84  double falseNorthing,
85  double scaleFactor,
86  char *ellipsoidCode);
87 
92 
96  ~TransverseMercator( void );
97 
101  TransverseMercator& operator=( const TransverseMercator &tm );
102 
108  MapProjection5Parameters* getParameters() const;
109 
121  MSP::CCS::MapProjectionCoordinates* convertFromGeodetic(
122  MSP::CCS::GeodeticCoordinates* geodeticCoordinates );
123 
124  /*
125  * Converts Transverse Mercator projection (easting and northing)
126  * coordinates to geodetic (latitude and longitude)
127  * coordinates, according to the current ellipsoid and Transverse
128  * Mercator projection parameters.
129  *
130  * @param easting Easting/X in meters (input)
131  * @param northing Northing/Y in meters (input)
132  * @param longitude Longitude in radians (output)
133  * @param latitude Latitude in radians (output)
134  */
135  MSP::CCS::GeodeticCoordinates* convertToGeodetic(
136  MSP::CCS::MapProjectionCoordinates* mapProjectionCoordinates );
137 
138  private:
139 
140  /* Ellipsoid Parameters */
141  char ellipsCode[3]; // 2 Letter ellipsoid code
142 
143  double TranMerc_eps; // Eccentricity
144 
145  double TranMerc_K0R4; // SCALE_FACTOR*R4
146  double TranMerc_K0R4inv; // 1/(SCALE_FACTOR*R4)
147 
148  double TranMerc_aCoeff[8];
149  double TranMerc_bCoeff[8];
150 
151  /* Transverse_Mercator projection Parameters */
152  double TranMerc_Origin_Lat; // Latitude of origin in radians
153  double TranMerc_Origin_Long; // Longitude of origin in radians
154  double TranMerc_False_Northing; // False northing in meters
155  double TranMerc_False_Easting; // False easting in meters
156  double TranMerc_Scale_Factor; // Scale factor
157 
158  /* Maximum variance for easting and northing values */
159  double TranMerc_Delta_Easting;
160  double TranMerc_Delta_Northing;
161 
165  void latLonToNorthingEasting(
166  const double &lat,
167  const double &lon,
168  double &northing,
169  double &easting );
170 
174  void northingEastingToLatLon(
175  const double &northing,
176  const double &easting,
177  double &latitude,
178  double &longitude );
179 
184  static void generateCoefficients(
185  double invfla,
186  double &n1,
187  double Acoeff[8],
188  double Bcoeff[8],
189  double &R4oa,
190  char *ellipsoidCode);
191 
196  static void checkLatLon( double latitude, double deltaLon );
197 
201  static double aTanH( double x );
202 
206  static double geodeticLat(
207  double sinChi,
208  double e );
209 
214  static void computeHyperbolicSeries(
215  double twoX,
216  double c2kx[],
217  double s2kx[]);
218 
223  void computeTrigSeries(
224  double twoY,
225  double c2ky[],
226  double s2ky[]);
227 
228  };
229  }
230 }
231 
232 #endif
233 
234 
235 // CLASSIFICATION: UNCLASSIFIED