UNCLASSIFIED

GeographicTranslator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
AlbersEqualAreaConic.h
Go to the documentation of this file.
1 // CLASSIFICATION: UNCLASSIFIED
2 
3 #ifndef AlbersEqualAreaConic_H
4 #define AlbersEqualAreaConic_H
5 
6 /***************************************************************************/
7 /* RSC IDENTIFIER: ALBERS
8  *
9  * ABSTRACT
10  *
11  * This component provides conversions between Geodetic coordinates
12  * (latitude and longitude in radians) and Albers Equal Area Conic
13  * projection coordinates (easting and northing in meters) defined
14  * by two standard parallels.
15  *
16  * ERROR HANDLING
17  *
18  * This component checks parameters for valid values. If an invalid value
19  * is found the error code is combined with the current error code using
20  * the bitwise or. This combining allows multiple error codes to be
21  * returned. The possible error codes are:
22  *
23  * ALBERS_NO_ERROR : No errors occurred in function
24  * ALBERS_LAT_ERROR : Latitude outside of valid range
25  * (-90 to 90 degrees)
26  * ALBERS_LON_ERROR : Longitude outside of valid range
27  * (-180 to 360 degrees)
28  * ALBERS_EASTING_ERROR : Easting outside of valid range
29  * (depends on ellipsoid and projection
30  * parameters)
31  * ALBERS_NORTHING_ERROR : Northing outside of valid range
32  * (depends on ellipsoid and projection
33  * parameters)
34  * ALBERS_FIRST_STDP_ERROR : First standard parallel outside of valid
35  * range (-90 to 90 degrees)
36  * ALBERS_SECOND_STDP_ERROR : Second standard parallel outside of valid
37  * range (-90 to 90 degrees)
38  * ALBERS_ORIGIN_LAT_ERROR : Origin latitude outside of valid range
39  * (-90 to 90 degrees)
40  * ALBERS_CENT_MER_ERROR : Central meridian outside of valid range
41  * (-180 to 360 degrees)
42  * ALBERS_A_ERROR : Semi-major axis less than or equal to zero
43  * ALBERS_INV_F_ERROR : Inverse flattening outside of valid range
44  * (250 to 350)
45  * ALBERS_HEMISPHERE_ERROR : Standard parallels cannot be opposite
46  * latitudes
47  * ALBERS_FIRST_SECOND_ERROR : The 1st & 2nd standard parallels cannot
48  * both be 0
49  *
50  *
51  * REUSE NOTES
52  *
53  * ALBERS is intended for reuse by any application that performs an Albers
54  * Equal Area Conic projection or its inverse.
55  *
56  * REFERENCES
57  *
58  * Further information on ALBERS can be found in the Reuse Manual.
59  *
60  * ALBERS originated from: U.S. Army Topographic Engineering Center
61  * Geospatial Information Division
62  * 7701 Telegraph Road
63  * Alexandria, VA 22310-3864
64  *
65  * LICENSES
66  *
67  * None apply to this component.
68  *
69  * RESTRICTIONS
70  *
71  * ALBERS has no restrictions.
72  *
73  * ENVIRONMENT
74  *
75  * ALBERS was tested and certified in the following environments:
76  *
77  * 1. Solaris 2.5 with GCC, version 2.8.1
78  * 2. MSDOS with MS Visual C++, version 6
79  *
80  * MODIFICATIONS
81  *
82  * Date Description
83  * ---- -----------
84  * 07-09-99 Original Code
85  * 03-08-07 Original C++ Code
86  *
87  *
88  */
89 
90 
91 #include "CoordinateSystem.h"
92 
93 #include "DtccApi.h"
94 
95 
96 
97 namespace MSP
98 {
99  namespace CCS
100  {
101  class MapProjection6Parameters;
102  class MapProjectionCoordinates;
103  class GeodeticCoordinates;
104 
105 
106  /***************************************************************************/
107  /*
108  * DEFINES
109  */
110 
112  {
113  public:
114 
115  /*
116  * The constructor receives the ellipsoid parameters and
117  * projection parameters as inputs, and sets the corresponding state
118  * variables. If any errors occur, an exception is thrown with a description
119  * of the error.
120  *
121  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (input)
122  * ellipsoidFlattening : Flattening of ellipsoid (input)
123  * centralMeridian : Longitude in radians at the center of (input)
124  * the projection
125  * originLatitude : Latitude in radians at which the (input)
126  * point scale factor is 1.0
127  * standardParallel1 : First standard parallel (input)
128  * standardParallel2 : Second standard parallel (input)
129  * falseEasting : A coordinate value in meters assigned to the
130  * central meridian of the projection. (input)
131  * falseNorthing : A coordinate value in meters assigned to the
132  * origin latitude of the projection (input)
133  */
134 
135  AlbersEqualAreaConic( double ellipsoidSemiMajorAxis, double ellipsoidFlattening, double centralMeridian, double originLatitude, double standardParallel1, double standardParallel2, double falseEasting, double falseNorthing );
136 
137 
139 
140 
141  ~AlbersEqualAreaConic( void );
142 
143 
144  AlbersEqualAreaConic& operator=( const AlbersEqualAreaConic &aeac );
145 
146 
147  /*
148  * The function getParameters returns the current ellipsoid
149  * parameters, and Albers projection parameters.
150  *
151  * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (output)
152  * ellipsoidFlattening : Flattening of ellipsoid (output)
153  * centralMeridian : Longitude in radians at the center of (output)
154  * the projection
155  * originLatitude : Latitude in radians at which the (output)
156  * point scale factor is 1.0
157  * standardParallel1 : First standard parallel (output)
158  * standardParallel2 : Second standard parallel (output)
159  * falseEasting : A coordinate value in meters assigned to the
160  * central meridian of the projection. (output)
161  * falseNorthing : A coordinate value in meters assigned to the
162  * origin latitude of the projection (output)
163  */
164 
165  MapProjection6Parameters* getParameters() const;
166 
167 
168  /*
169  * The function convertFromGeodetic converts geodetic (latitude and
170  * longitude) coordinates to Albers projection (easting and northing)
171  * coordinates, according to the current ellipsoid and Albers projection
172  * parameters. If any errors occur, an exception is thrown with a description
173  * of the error.
174  *
175  * longitude : Longitude (lambda) in radians (input)
176  * latitude : Latitude (phi) in radians (input)
177  * easting : Easting (X) in meters (output)
178  * northing : Northing (Y) in meters (output)
179  */
180 
181  MSP::CCS::MapProjectionCoordinates* convertFromGeodetic( MSP::CCS::GeodeticCoordinates* geodeticCoordinates );
182 
183 
184  /*
185  * The function convertToGeodetic converts Albers projection
186  * (easting and northing) coordinates to geodetic (latitude and longitude)
187  * coordinates, according to the current ellipsoid and Albers projection
188  * coordinates. If any errors occur, an exception is thrown with a description
189  * of the error.
190  *
191  * easting : Easting (X) in meters (input)
192  * northing : Northing (Y) in meters (input)
193  * latitude : Latitude (phi) in radians (output)
194  * longitude : Longitude (lambda) in radians (output)
195  */
196 
197  MSP::CCS::GeodeticCoordinates* convertToGeodetic( MSP::CCS::MapProjectionCoordinates* mapProjectionCoordinates );
198 
199  private:
200 
201  /* Ellipsoid Parameters, default to WGS 84 */
202  double es; /* Eccentricity of ellipsoid */
203  double es2; /* Eccentricity squared */
204  double C; /* constant c */
205  double rho0; /* height above ellipsoid */
206  double n; /* ratio between meridians */
207  double Albers_a_OVER_n; /* Albers_a / n */
208  double one_MINUS_es2; /* 1 - es2 */
209  double two_es; /* 2 * es */
210 
211  /* Albers Projection Parameters */
212  double Albers_Origin_Lat; /* Latitude of origin in radians */
213  double Albers_Origin_Long; /* Longitude of origin in radians */
214  double Albers_Std_Parallel_1;
215  double Albers_Std_Parallel_2;
216  double Albers_False_Easting;
217  double Albers_False_Northing;
218 
219  double Albers_Delta_Northing;
220  double Albers_Delta_Easting;
221 
222  double esSine( double sinlat );
223 
224  double albersQ( double slat, double oneminussqressin, double essin );
225 
226  };
227  }
228 }
229 
230 #endif
231 
232 
233 // CLASSIFICATION: UNCLASSIFIED