UNCLASSIFIED

GeographicTranslator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
CylindricalEqualArea.h
Go to the documentation of this file.
1 // CLASSIFICATION: UNCLASSIFIED
2 
3 #ifndef CylindricalEqualArea_H
4 #define CylindricalEqualArea_H
5 
6 /***************************************************************************/
7 /* RSC IDENTIFIER: CYLINDRICAL EQUAL AREA
8  *
9  * ABSTRACT
10  *
11  * This component provides conversions between Geodetic coordinates
12  * (latitude and longitude in radians) and Cylindrical Equal Area projection
13  * coordinates (easting and northing in meters).
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  * CYEQ_NO_ERROR : No errors occurred in function
23  * CYEQ_LAT_ERROR : Latitude outside of valid range
24  * (-90 to 90 degrees)
25  * CYEQ_LON_ERROR : Longitude outside of valid range
26  * (-180 to 360 degrees)
27  * CYEQ_EASTING_ERROR : Easting outside of valid range
28  * (False_Easting +/- ~20,000,000 m,
29  * depending on ellipsoid parameters
30  * and Origin_Latitude)
31  * CYEQ_NORTHING_ERROR : Northing outside of valid range
32  * (False_Northing +/- ~6,000,000 m,
33  * depending on ellipsoid parameters
34  * and Origin_Latitude)
35  * CYEQ_ORIGIN_LAT_ERROR : Origin latitude outside of valid range
36  * (-90 to 90 degrees)
37  * CYEQ_CENT_MER_ERROR : Central meridian outside of valid range
38  * (-180 to 360 degrees)
39  * CYEQ_A_ERROR : Semi-major axis less than or equal to zero
40  * CYEQ_INV_F_ERROR : Inverse flattening outside of valid range
41  * (250 to 350)
42  *
43  * REUSE NOTES
44  *
45  * CYLINDRICAL EQUAL AREA is intended for reuse by any application that performs a
46  * Cylindrical Equal Area projection or its inverse.
47  *
48  * REFERENCES
49  *
50  * Further information on CYLINDRICAL EQUAL AREA can be found in the Reuse Manual.
51  *
52  * CYLINDRICAL EQUAL AREA originated from :
53  * U.S. Army Topographic Engineering Center
54  * Geospatial Information Division
55  * 7701 Telegraph Road
56  * Alexandria, VA 22310-3864
57  *
58  * LICENSES
59  *
60  * None apply to this component.
61  *
62  * RESTRICTIONS
63  *
64  * CYLINDRICAL EQUAL AREA has no restrictions.
65  *
66  * ENVIRONMENT
67  *
68  * CYLINDRICAL EQUAL AREA was tested and certified in the following environments:
69  *
70  * 1. Solaris 2.5 with GCC 2.8.1
71  * 2. MS Windows 95 with MS Visual C++ 6
72  *
73  * MODIFICATIONS
74  *
75  * Date Description
76  * ---- -----------
77  * 04-16-99 Original Code
78  * 03-07-07 Original C++ Code
79  *
80  */
81 
82 
83 #include "CoordinateSystem.h"
84 
85 
86 namespace MSP
87 {
88  namespace CCS
89  {
90  class MapProjection4Parameters;
91  class MapProjectionCoordinates;
92  class GeodeticCoordinates;
93 
94 
95  /***************************************************************************/
96  /*
97  * DEFINES
98  */
99 
101  {
102  public:
103 
104  /*
105  * The constructor receives the ellipsoid parameters and
106  * Cylindrical Equal Area projcetion parameters as inputs, and sets the corresponding
107  * state variables. If any errors occur, an exception is thrown with a description
108  * of the error.
109  *
110  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (input)
111  * ellipsoidFlattening : Flattening of ellipsoid (input)
112  * centralMeridian : Longitude in radians at the center of (input)
113  * the projection
114  * originLatitude : Latitude in radians at which the (input)
115  * point scale factor is 1.0
116  * falseEasting : A coordinate value in meters assigned to the
117  * central meridian of the projection. (input)
118  * falseNorthing : A coordinate value in meters assigned to the
119  * origin latitude of the projection (input)
120  */
121 
122  CylindricalEqualArea( double ellipsoidSemiMajorAxis, double ellipsoidFlattening, double centralMeridian, double originLatitude, double falseEasting, double falseNorthing );
123 
124 
126 
127 
128  ~CylindricalEqualArea( void );
129 
130 
132 
133 
134  /*
135  * The function getParameters returns the current ellipsoid
136  * parameters, and Cylindrical Equal Area projection parameters.
137  *
138  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (output)
139  * ellipsoidFlattening : Flattening of ellipsoid (output)
140  * centralMeridian : Longitude in radians at the center of (output)
141  * the projection
142  * originLatitude : Latitude in radians at which the (output)
143  * point scale factor is 1.0
144  * falseEasting : A coordinate value in meters assigned to the
145  * central meridian of the projection. (output)
146  * falseNorthing : A coordinate value in meters assigned to the
147  * origin latitude of the projection (output)
148  */
149 
151 
152 
153  /*
154  * The function convertFromGeodetic converts geodetic (latitude and
155  * longitude) coordinates to Cylindrical Equal Area projection (easting and northing)
156  * coordinates, according to the current ellipsoid and Cylindrical Equal Area projection
157  * parameters. If any errors occur, an exception is thrown with a description
158  * of the error.
159  *
160  * longitude : Longitude (lambda) in radians (input)
161  * latitude : Latitude (phi) in radians (input)
162  * easting : Easting (X) in meters (output)
163  * northing : Northing (Y) in meters (output)
164  */
165 
167 
168 
169  /*
170  * The function convertToGeodetic converts
171  * Cylindrical Equal Area projection (easting and northing) coordinates
172  * to geodetic (latitude and longitude) coordinates, according to the
173  * current ellipsoid and Cylindrical Equal Area projection
174  * coordinates. If any errors occur, an exception is thrown with a description
175  * of the error.
176  *
177  * easting : Easting (X) in meters (input)
178  * northing : Northing (Y) in meters (input)
179  * longitude : Longitude (lambda) in radians (output)
180  * latitude : Latitude (phi) in radians (output)
181  */
182 
184 
185  private:
186 
187  /* Ellipsoid Parameters, default to WGS 84 */
188  double es2; /* Eccentricity (0.08181919084262188000) squared */
189  double es; /* Sqrt(es2) */
190  double es4; /* es2 * es2 */
191  double es6; /* es4 * es2 */
192  double k0;
193  double Cyeq_a_k0; /* Cyeq_a * k0 */
194  double two_k0; /* 2.0 * k0 */
195  double c0; /* es2 / 3.0 + 31.0 * es4 / 180.0 + 517.0 * es6 / 5040.0 */
196  double c1; /* 23.0 es4 / 360.0 + 251.0 * es6 / 3780.0 */
197  double c2; /* 761.0 * es6 / 45360.0 */
198 
199  /* Cylindrical Equal Area projection Parameters */
200  double Cyeq_Origin_Lat; /* Latitude of origin in radians */
201  double Cyeq_Origin_Long; /* Longitude of origin in radians */
202  double Cyeq_False_Northing; /* False northing in meters */
203  double Cyeq_False_Easting; /* False easting in meters */
204 
205  /* Maximum variance for easting and northing values for WGS 84.*/
206  double Cyeq_Max_Easting;
207  double Cyeq_Min_Easting;
208  double Cyeq_Delta_Northing;
209 
210 
211  double cyleqarQ( double slat, double x );
212  };
213  }
214 }
215 
216 #endif
217 
218 
219 // CLASSIFICATION: UNCLASSIFIED