UNCLASSIFIED

GeographicTranslator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
NZMG.h
Go to the documentation of this file.
1 // CLASSIFICATION: UNCLASSIFIED
2 
3 #ifndef NZMG_H
4 #define NZMG_H
5 
6 /***************************************************************************/
7 /* RSC IDENTIFIER: NEW ZEALAND MAP GRID
8  *
9  * ABSTRACT
10  *
11  * This component provides conversions between Geodetic coordinates
12  * (latitude and longitude) and New Zealand Map Grid coordinates
13  * (easting and northing).
14  *
15  * ERROR HANDLING
16  *
17  * This component checks parameters for valid values. If an invalid value
18  * is found the error code is combined with the current error code using
19  * the bitwise or. This combining allows multiple error codes to be
20  * returned. The possible error codes are:
21  *
22  * NZMG_NO_ERROR : No errors occurred in function
23  * NZMG_LAT_ERROR : Latitude outside of valid range
24  * (-33.5 to -48.5 degrees)
25  * NZMG_LON_ERROR : Longitude outside of valid range
26  * (165.5 to 180.0 degrees)
27  * NZMG_EASTING_ERROR : Easting outside of valid range
28  * (depending on ellipsoid and
29  * projection parameters)
30  * NZMG_NORTHING_ERROR : Northing outside of valid range
31  * (depending on ellipsoid and
32  * projection parameters)
33  * NZMG_ELLIPSOID_ERROR : Invalid ellipsoid - must be International
34  *
35  * REUSE NOTES
36  *
37  * NEW ZEALAND MAP GRID is intended for reuse by any application that
38  * performs a New Zealand Map Grid projection or its inverse.
39  *
40  * REFERENCES
41  *
42  * Further information on NEW ZEALAND MAP GRID can be found in the
43  * Reuse Manual.
44  *
45  * NEW ZEALAND MAP GRID originated from :
46  * U.S. Army Topographic Engineering Center
47  * Geospatial Information Division
48  * 7701 Telegraph Road
49  * Alexandria, VA 22310-3864
50  *
51  * LICENSES
52  *
53  * None apply to this component.
54  *
55  * RESTRICTIONS
56  *
57  * NEW ZEALAND MAP GRID has no restrictions.
58  *
59  * ENVIRONMENT
60  *
61  * NEW ZEALAND MAP GRID was tested and certified in the following
62  * environments:
63  *
64  * 1. Solaris 2.5 with GCC, version 2.8.1
65  * 2. Windows 95 with MS Visual C++, version 6
66  *
67  * MODIFICATIONS
68  *
69  * Date Description
70  * ---- -----------
71  * 09-14-00 Original Code
72  * 03-2-07 Original C++ Code
73  *
74  *
75  */
76 
77 #include "CoordinateSystem.h"
78 
79 
80 namespace MSP
81 {
82  namespace CCS
83  {
84  class EllipsoidParameters;
85  class MapProjectionCoordinates;
86  class GeodeticCoordinates;
87 
88 
89  /***************************************************************************/
90  /*
91  * DEFINES
92  */
93 
94  class NZMG : public CoordinateSystem
95  {
96  public:
97 
98  /*
99  * The constructor receives the ellipsoid code and sets
100  * the corresponding state variables. If any errors occur, an exception is
101  * thrown with a description of the error.
102  *
103  * ellipsoidCode : 2-letter code for ellipsoid (input)
104  */
105 
106  NZMG( char* ellipsoidCode );
107 
108 
109  NZMG( const NZMG &n );
110 
111 
112  ~NZMG( void );
113 
114 
115  NZMG& operator=( const NZMG &n );
116 
117 
118  /*
119  * The function getParameters returns the current ellipsoid
120  * code.
121  *
122  * ellipsoidCode : 2-letter code for ellipsoid (output)
123  */
124 
126 
127 
128  /*
129  * The function convertFromGeodetic converts geodetic (latitude and
130  * longitude) coordinates to New Zealand Map Grid projection (easting and northing)
131  * coordinates, according to the current ellipsoid and New Zealand Map Grid
132  * projection parameters. If any errors occur, an exception is thrown with a description
133  * of the error.
134  *
135  * longitude : Longitude (lambda), in radians (input)
136  * latitude : Latitude (phi), in radians (input)
137  * easting : Easting (X), in meters (output)
138  * northing : Northing (Y), in meters (output)
139  */
140 
142 
143 
144  /*
145  * The function convertToGeodetic converts New Zealand Map Grid projection
146  * (easting and northing) coordinates to geodetic (latitude and longitude)
147  * coordinates, according to the current ellipsoid and New Zealand Map Grid projection
148  * coordinates. If any errors occur, an exception is thrown with a description
149  * of the error.
150  *
151  * easting : Easting (X), in meters (input)
152  * northing : Northing (Y), in meters (input)
153  * longitude : Longitude (lambda), in radians (output)
154  * latitude : Latitude (phi), in radians (output)
155  */
156 
158 
159  private:
160 
161  /* Ellipsoid Parameters, must be International */
162  char NZMGEllipsoidCode[3];
163 
164  };
165  }
166 }
167 
168 #endif
169 
170 
171 // CLASSIFICATION: UNCLASSIFIED