UNCLASSIFIED

GeographicTranslator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
PolarStereographic.h
Go to the documentation of this file.
1 // CLASSIFICATION: UNCLASSIFIED
2 
3 #ifndef PolarStereographic_H
4 #define PolarStereographic_H
5 
6 /***************************************************************************/
7 /* RSC IDENTIFIER: POLAR STEREOGRAPHIC
8  *
9  *
10  * ABSTRACT
11  *
12  * This component provides conversions between geodetic (latitude and
13  * longitude) coordinates and Polar Stereographic (easting and northing)
14  * coordinates.
15  *
16  * ERROR HANDLING
17  *
18  * This component checks parameters for valid values. If an invalid
19  * value is found the error code is combined with the current error code
20  * using the bitwise or. This combining allows multiple error codes to
21  * be returned. The possible error codes are:
22  *
23  * POLAR_NO_ERROR : No errors occurred in function
24  * POLAR_LAT_ERROR : Latitude outside of valid range
25  * (-90 to 90 degrees)
26  * POLAR_LON_ERROR : Longitude outside of valid range
27  * (-180 to 360 degrees)
28  * POLAR_ORIGIN_LAT_ERROR : Latitude of true scale outside of valid
29  * range (-90 to 90 degrees)
30  * POLAR_ORIGIN_LON_ERROR : Longitude down from pole outside of valid
31  * range (-180 to 360 degrees)
32  * POLAR_EASTING_ERROR : Easting outside of valid range,
33  * depending on ellipsoid and
34  * projection parameters
35  * POLAR_NORTHING_ERROR : Northing outside of valid range,
36  * depending on ellipsoid and
37  * projection parameters
38  * POLAR_RADIUS_ERROR : Coordinates too far from pole,
39  * depending on ellipsoid and
40  * projection parameters
41  * POLAR_A_ERROR : Semi-major axis less than or equal to zero
42  * POLAR_INV_F_ERROR : Inverse flattening outside of valid range
43  * (250 to 350)
44  *
45  *
46  * REUSE NOTES
47  *
48  * POLAR STEREOGRAPHIC is intended for reuse by any application that
49  * performs a Polar Stereographic projection.
50  *
51  *
52  * REFERENCES
53  *
54  * Further information on POLAR STEREOGRAPHIC can be found in the
55  * Reuse Manual.
56  *
57  *
58  * POLAR STEREOGRAPHIC originated from :
59  * U.S. Army Topographic Engineering Center
60  * Geospatial Information Division
61  * 7701 Telegraph Road
62  * Alexandria, VA 22310-3864
63  *
64  *
65  * LICENSES
66  *
67  * None apply to this component.
68  *
69  *
70  * RESTRICTIONS
71  *
72  * POLAR STEREOGRAPHIC has no restrictions.
73  *
74  *
75  * ENVIRONMENT
76  *
77  * POLAR STEREOGRAPHIC was tested and certified in the following
78  * environments:
79  *
80  * 1. Solaris 2.5 with GCC, version 2.8.1
81  * 2. Window 95 with MS Visual C++, version 6
82  *
83  *
84  * MODIFICATIONS
85  *
86  * Date Description
87  * ---- -----------
88  * 2-27-07 Original Code
89  *
90  *
91  */
92 
93 
94 #include "CoordinateSystem.h"
95 #include "CoordinateType.h"
96 
97 
98 namespace MSP
99 {
100  namespace CCS
101  {
102  class PolarStereographicStandardParallelParameters;
103  class PolarStereographicScaleFactorParameters;
104  class MapProjectionCoordinates;
105  class GeodeticCoordinates;
106 
107 
108  /**********************************************************************/
109  /*
110  * DEFINES
111  */
112 
114  {
115  public:
116 
117  /*
118  * The constructor receives the ellipsoid
119  * parameters and Polar Stereograpic (Standard Parallel) projection parameters as inputs, and
120  * sets the corresponding state variables. If any errors occur, an exception
121  * is thrown with a description of the error.
122  *
123  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (input)
124  * ellipsoidFlattening : Flattening of ellipsoid (input)
125  * centralMeridian : Longitude down from pole, in radians (input)
126  * standardParallel : Latitude of true scale, in radians (input)
127  * falseEasting : Easting (X) at center of projection, in meters (input)
128  * falseNorthing : Northing (Y) at center of projection, in meters (input)
129  */
130 
131  PolarStereographic( double ellipsoidSemiMajorAxis, double ellipsoidFlattening, double centralMeridian, double standardParallel, double falseEasting, double falseNorthing );
132 
133 
134  /*
135  * The constructor receives the ellipsoid
136  * parameters and Polar Stereograpic (Scale Factor) projection parameters as inputs, and
137  * sets the corresponding state variables. If any errors occur, an
138  * exception is thrown with a description of the error.
139  *
140  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (input)
141  * ellipsoidFlattening : Flattening of ellipsoid (input)
142  * centralMeridian : Longitude down from pole, in radians (input)
143  * scaleFactor : Scale Factor (input)
144  * falseEasting : Easting (X) at center of projection, in meters (input)
145  * falseNorthing : Northing (Y) at center of projection, in meters (input)
146  */
147 
148  PolarStereographic( double ellipsoidSemiMajorAxis, double ellipsoidFlattening, double centralMeridian, double scaleFactor, char hemisphere, double falseEasting, double falseNorthing );
149 
150 
152 
153 
154  ~PolarStereographic( void );
155 
156 
158 
159 
160  /*
161  * The function getStandardParallelParameters returns the current
162  * ellipsoid parameters and Polar (Standard Parallel) projection parameters.
163  *
164  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (output)
165  * ellipsoidFlattening : Flattening of ellipsoid (output)
166  * centralMeridian : Longitude down from pole, in radians (output)
167  * standardParallel : Latitude of true scale, in radians (output)
168  * falseEasting : Easting (X) at center of projection, in meters (output)
169  * falseNorthing : Northing (Y) at center of projection, in meters (output)
170  */
171 
173 
174 
175  /*
176  * The function getScaleFactorParameters returns the current
177  * ellipsoid parameters and Polar (Scale Factor) projection parameters.
178  *
179  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (output)
180  * ellipsoidFlattening : Flattening of ellipsoid (output)
181  * centralMeridian : Longitude down from pole, in radians (output)
182  * scaleFactor : Scale factor (output)
183  * falseEasting : Easting (X) at center of projection, in meters (output)
184  * falseNorthing : Northing (Y) at center of projection, in meters (output)
185  */
186 
188 
189 
190  /*
191  * The function convertFromGeodetic converts geodetic
192  * coordinates (latitude and longitude) to Polar Stereographic coordinates
193  * (easting and northing), according to the current ellipsoid
194  * and Polar Stereographic projection parameters. If any errors occur,
195  * an exception is thrown with a description of the error.
196  *
197  * longitude : Longitude, in radians (input)
198  * latitude : Latitude, in radians (input)
199  * easting : Easting (X), in meters (output)
200  * northing : Northing (Y), in meters (output)
201  */
202 
204 
205 
206  /*
207  * The function convertToGeodetic converts Polar
208  * Stereographic coordinates (easting and northing) to geodetic
209  * coordinates (latitude and longitude) according to the current ellipsoid
210  * and Polar Stereographic projection Parameters. If any errors occur,
211  * an exception is thrown with a description of the error.
212  *
213  * easting : Easting (X), in meters (input)
214  * northing : Northing (Y), in meters (input)
215  * longitude : Longitude, in radians (output)
216  * latitude : Latitude, in radians (output)
217  *
218  */
219 
221 
222  private:
223 
224  CoordinateType::Enum coordinateType;
225 
226  double es; /* Eccentricity of ellipsoid */
227  double es_OVER_2; /* es / 2.0 */
228  double Southern_Hemisphere; /* Flag variable */
229  double Polar_tc;
230  double Polar_k90;
231  double Polar_a_mc; /* Polar_a * mc */
232  double two_Polar_a; /* 2.0 * Polar_a */
233 
234  /* Polar Stereographic projection Parameters */
235  double Polar_Standard_Parallel; /* Latitude of origin in radians */
236  double Polar_Central_Meridian; /* Longitude of origin in radians */
237  double Polar_False_Easting; /* False easting in meters */
238  double Polar_False_Northing; /* False northing in meters */
239 
240  /* Maximum variance for easting and northing values for WGS 84. */
241  double Polar_Delta_Easting;
242  double Polar_Delta_Northing;
243 
244  double Polar_Scale_Factor;
245 
246  double polarPow( double esSin);
247  };
248  }
249 }
250 
251 #endif
252 
253 
254 // CLASSIFICATION: UNCLASSIFIED