UNCLASSIFIED

GeographicTranslator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Mollweide.h
Go to the documentation of this file.
1 // CLASSIFICATION: UNCLASSIFIED
2 
3 #ifndef Mollweide_H
4 #define Mollweide_H
5 
6 /***************************************************************************/
7 /* RSC IDENTIFIER: MOLLWEIDE
8  *
9  * ABSTRACT
10  *
11  * This component provides conversions between Geodetic coordinates
12  * (latitude and longitude in radians) and Mollweide projection coordinates
13  * (easting and northing in meters). The Mollweide Pseudocylindrical
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  * MOLL_NO_ERROR : No errors occurred in function
26  * MOLL_LAT_ERROR : Latitude outside of valid range
27  * (-90 to 90 degrees)
28  * MOLL_LON_ERROR : Longitude outside of valid range
29  * (-180 to 360 degrees)
30  * MOLL_EASTING_ERROR : Easting outside of valid range
31  * (False_Easting +/- ~18,000,000 m,
32  * depending on ellipsoid parameters)
33  * MOLL_NORTHING_ERROR : Northing outside of valid range
34  * (False_Northing +/- ~9,000,000 m,
35  * depending on ellipsoid parameters)
36  * MOLL_ORIGIN_LON_ERROR : Origin longitude outside of valid range
37  * (-180 to 360 degrees)
38  * MOLL_A_ERROR : Semi-major axis less than or equal to zero
39  * MOLL_INV_F_ERROR : Inverse flattening outside of valid range
40  * (250 to 350)
41  *
42  * REUSE NOTES
43  *
44  * MOLLWEID is intended for reuse by any application that performs a
45  * Mollweide projection or its inverse.
46  *
47  * REFERENCES
48  *
49  * Further information on MOLLWEID can be found in the Reuse Manual.
50  *
51  * MOLLWEID originated from : U.S. Army Topographic Engineering Center
52  * Geospatial Information Division
53  * 7701 Telegraph Road
54  * Alexandria, VA 22310-3864
55  *
56  * LICENSES
57  *
58  * None apply to this component.
59  *
60  * RESTRICTIONS
61  *
62  * MOLLWEID has no restrictions.
63  *
64  * ENVIRONMENT
65  *
66  * MOLLWEID was tested and certified in the following environments:
67  *
68  * 1. Solaris 2.5 with GCC 2.8.1
69  * 2. Windows 95 with MS Visual C++ 6
70  *
71  * MODIFICATIONS
72  *
73  * Date Description
74  * ---- -----------
75  * 04-16-99 Original Code
76  * 03-05-07 Original C++ Code
77  *
78  */
79 
80 
81 #include "CoordinateSystem.h"
82 
83 
84 namespace MSP
85 {
86  namespace CCS
87  {
88  class MapProjection3Parameters;
89  class MapProjectionCoordinates;
90  class GeodeticCoordinates;
91 
92 
93  /***************************************************************************/
94  /*
95  * DEFINES
96  */
97 
98  class Mollweide : public CoordinateSystem
99  {
100  public:
101 
102  /*
103  * The constructor receives the ellipsoid parameters and
104  * Mollweide projcetion parameters as inputs, and sets the corresponding state
105  * variables. If any errors occur, an exception is thrown with a description
106  * of the error.
107  *
108  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (input)
109  * ellipsoidFlattening : Flattening of ellipsoid (input)
110  * centralMeridian : Longitude in radians at the center of (input)
111  * the projection
112  * falseEasting : A coordinate value in meters assigned to the
113  * central meridian of the projection. (input)
114  * falseNorthing : A coordinate value in meters assigned to the
115  * origin latitude of the projection (input)
116  */
117 
118  Mollweide( double ellipsoidSemiMajorAxis, double ellipsoidFlattening, double centralMeridian, double falseEasting, double falseNorthing );
119 
120 
121  Mollweide( const Mollweide &m );
122 
123 
124  ~Mollweide( void );
125 
126 
127  Mollweide& operator=( const Mollweide &m );
128 
129 
130  /*
131  * The function getParameters returns the current ellipsoid
132  * parameters and Mollweide projection parameters.
133  *
134  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (output)
135  * ellipsoidFlattening : Flattening of ellipsoid (output)
136  * centralMeridian : Longitude in radians at the center of (output)
137  * the projection
138  * falseEasting : A coordinate value in meters assigned to the
139  * central meridian of the projection. (output)
140  * falseNorthing : A coordinate value in meters assigned to the
141  * origin latitude of the projection (output)
142  */
143 
145 
146 
147  /*
148  * The function convertFromGeodetic converts geodetic (latitude and
149  * longitude) coordinates to Mollweide projection (easting and northing)
150  * coordinates, according to the current ellipsoid and Mollweide projection
151  * parameters. If any errors occur, an exception is thrown with a description
152  * of the error.
153  *
154  * longitude : Longitude (lambda) in radians (input)
155  * latitude : Latitude (phi) in radians (input)
156  * easting : Easting (X) in meters (output)
157  * northing : Northing (Y) in meters (output)
158  */
159 
161 
162 
163  /*
164  * The function convertToGeodetic converts Mollweide projection
165  * (easting and northing) coordinates to geodetic (latitude and longitude)
166  * coordinates, according to the current ellipsoid and Mollweide projection
167  * coordinates. If any errors occur, an exception is thrown with a description
168  * of the error.
169  *
170  * easting : Easting (X) in meters (input)
171  * northing : Northing (Y) in meters (input)
172  * longitude : Longitude (lambda) in radians (output)
173  * latitude : Latitude (phi) in radians (output)
174  */
175 
177 
178  private:
179 
180  /* Ellipsoid Parameters, default to WGS 84 */
181  double es2; /* Eccentricity (0.08181919084262188000) squared */
182  double es4; /* es2 * es2 */
183  double es6; /* es4 * es2 */
184  double Sqrt2_Ra; /* sqrt(2.0) * Spherical Radius(6371007.1810824) */
185  double Sqrt8_Ra; /* sqrt(8.0) * Spherical Radius(6371007.1810824) */
186 
187  /* Mollweide projection Parameters */
188  double Moll_Origin_Long; /* Longitude of origin in radians */
189  double Moll_False_Easting;
190  double Moll_False_Northing;
191  double Moll_Delta_Northing;
192  double Moll_Max_Easting;
193  double Moll_Min_Easting;
194 
195  };
196  }
197 }
198 
199 #endif
200 
201 
202 // CLASSIFICATION: UNCLASSIFIED