UNCLASSIFIED

GeographicTranslator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
EquidistantCylindrical.h
Go to the documentation of this file.
1 // CLASSIFICATION: UNCLASSIFIED
2 
3 #ifndef EquidistantCylindrical_H
4 #define EquidistantCylindrical_H
5 
6 /***************************************************************************/
7 /* RSC IDENTIFIER: EQUIDISTANT CYLINDRICAL
8  *
9  * ABSTRACT
10  *
11  * This component provides conversions between Geodetic coordinates
12  * (latitude and longitude in radians) and Equidistant Cylindrical projection coordinates
13  * (easting and northing in meters). The Equidistant Cylindrical
14  * projection employs a spherical Earth model. The Spherical Radius
15  * used is the the radius of the sphere having the same area as the
16  * ellipsoid.
17  *
18  * ERROR HANDLING
19  *
20  * This component checks parameters for valid values. If an invalid value
21  * is found, the error code is combined with the current error code using
22  * the bitwise or. This combining allows multiple error codes to be
23  * returned. The possible error codes are:
24  *
25  * EQCY_NO_ERROR : No errors occurred in function
26  * EQCY_LAT_ERROR : Latitude outside of valid range
27  * (-90 to 90 degrees)
28  * EQCY_LON_ERROR : Longitude outside of valid range
29  * (-180 to 360 degrees)
30  * EQCY_EASTING_ERROR : Easting outside of valid range
31  * (False_Easting +/- ~20,000,000 m,
32  * depending on ellipsoid parameters
33  * and Standard Parallel)
34  * EQCY_NORTHING_ERROR : Northing outside of valid range
35  * (False_Northing +/- 0 to ~10,000,000 m,
36  * depending on ellipsoid parameters
37  * and Standard Parallel)
38  * EQCY_STDP_ERROR : Standard parallel outside of valid range
39  * (-90 to 90 degrees)
40  * EQCY_CENT_MER_ERROR : Central meridian outside of valid range
41  * (-180 to 360 degrees)
42  * EQCY_A_ERROR : Semi-major axis less than or equal to zero
43  * EQCY_INV_F_ERROR : Inverse flattening outside of valid range
44  * (250 to 350)
45  *
46  * REUSE NOTES
47  *
48  * EQUIDISTANT CYLINDRICAL is intended for reuse by any application that performs a
49  * Equidistant Cylindrical projection or its inverse.
50  *
51  * REFERENCES
52  *
53  * Further information on EQUIDISTANT CYLINDRICAL can be found in the Reuse Manual.
54  *
55  * EQUIDISTANT CYLINDRICAL originated from : U.S. Army Topographic Engineering Center
56  * Geospatial Information Division
57  * 7701 Telegraph Road
58  * Alexandria, VA 22310-3864
59  *
60  * LICENSES
61  *
62  * None apply to this component.
63  *
64  * RESTRICTIONS
65  *
66  * EQUIDISTANT CYLINDRICAL has no restrictions.
67  *
68  * ENVIRONMENT
69  *
70  * EQUIDISTANT CYLINDRICAL was tested and certified in the following environments:
71  *
72  * 1. Solaris 2.5 with GCC 2.8.1
73  * 2. MS Windows with MS Visual C++ 6
74  *
75  * MODIFICATIONS
76  *
77  * Date Description
78  * ---- -----------
79  * 04-16-99 Original Code
80  * 03-06-07 Original C++ Code
81  *
82  *
83  */
84 
85 
86 #include "CoordinateSystem.h"
87 
88 
89 namespace MSP
90 {
91  namespace CCS
92  {
93  class EquidistantCylindricalParameters;
94  class MapProjectionCoordinates;
95  class GeodeticCoordinates;
96 
97 
98  /***************************************************************************/
99  /*
100  * DEFINES
101  */
102 
104  {
105  public:
106 
107  /*
108  * The function setParameters receives the ellipsoid parameters and
109  * projection parameters as inputs, and sets the corresponding state
110  * variables. It also calculates the spherical radius of the sphere having
111  * the same area as the ellipsoid. If any errors occur, an exception is thrown with a description
112  * of the error.
113  *
114  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (input)
115  * ellipsoidFlattening : Flattening of ellipsoid (input)
116  * centralMeridian : Longitude in radians at the center of (input)
117  * the projection
118  * standardParallel : Latitude in radians at which the (input)
119  * point scale factor is 1.0
120  * falseEasting : A coordinate value in meters assigned to the
121  * central meridian of the projection. (input)
122  * falseNorthing : A coordinate value in meters assigned to the
123  * standard parallel of the projection (input)
124  */
125 
126  EquidistantCylindrical( double ellipsoidSemiMajorAxis, double ellipsoidFlattening, double centralMeridian, double standardParallel, double falseEasting, double falseNorthing );
127 
128 
130 
131 
132  ~EquidistantCylindrical( void );
133 
134 
136 
137 
138  /*
139  * The function getParameters returns the current ellipsoid
140  * parameters and Equidistant Cylindrical projection parameters.
141  *
142  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (output)
143  * ellipsoidFlattening : Flattening of ellipsoid (output)
144  * centralMeridian : Longitude in radians at the center of (output)
145  * the projection
146  * standardParallel : Latitude in radians at which the (output)
147  * point scale factor is 1.0
148  * falseEasting : A coordinate value in meters assigned to the
149  * central meridian of the projection. (output)
150  * falseNorthing : A coordinate value in meters assigned to the
151  * standard parallel of the projection (output)
152  */
153 
155 
156 
157  /*
158  * The function convertFromGeodetic converts geodetic (latitude and
159  * longitude) coordinates to Equidistant Cylindrical projection (easting and northing)
160  * coordinates, according to the current ellipsoid, spherical radiius
161  * and Equidistant Cylindrical projection parameters.
162  * If any errors occur, an exception is thrown with a description
163  * of the error.
164  *
165  * longitude : Longitude (lambda) in radians (input)
166  * latitude : Latitude (phi) in radians (input)
167  * easting : Easting (X) in meters (output)
168  * northing : Northing (Y) in meters (output)
169  */
170 
172 
173 
174  /*
175  * The function convertToGeodetic converts Equidistant Cylindrical projection
176  * (easting and northing) coordinates to geodetic (latitude and longitude)
177  * coordinates, according to the current ellipsoid, spherical radius
178  * and Equidistant Cylindrical projection coordinates.
179  * If any errors occur, an exception is thrown with a description
180  * of the error.
181  *
182  * easting : Easting (X) in meters (input)
183  * northing : Northing (Y) in meters (input)
184  * longitude : Longitude (lambda) in radians (output)
185  * latitude : Latitude (phi) in radians (output)
186  */
187 
189 
190  private:
191 
192  /* Ellipsoid Parameters, default to WGS 84 */
193  double es2; /* Eccentricity (0.08181919084262188000) squared */
194  double es4; /* es2 * es2 */
195  double es6; /* es4 * es2 */
196  double Ra; /* Spherical Radius */
197 
198  /* Equidistant Cylindrical projection Parameters */
199  double Eqcy_Std_Parallel; /* Latitude of standard parallel in radians */
200  double Cos_Eqcy_Std_Parallel; /* cos(Eqcy_Std_Parallel) */
201  double Eqcy_Origin_Long; /* Longitude of origin in radians */
202  double Eqcy_False_Easting;
203  double Eqcy_False_Northing;
204  double Eqcy_Delta_Northing;
205  double Eqcy_Max_Easting;
206  double Eqcy_Min_Easting;
207  double Ra_Cos_Eqcy_Std_Parallel; /* Ra * Cos_Eqcy_Std_Parallel */
208 
209  };
210  }
211 }
212 
213 #endif
214 
215 
216 // CLASSIFICATION: UNCLASSIFIED