00001 // CLASSIFICATION: UNCLASSIFIED 00002 00003 #ifndef Eckert6_H 00004 #define Eckert6_H 00005 00006 /***************************************************************************/ 00007 /* RSC IDENTIFIER: ECKERT6 00008 * 00009 * ABSTRACT 00010 * 00011 * This component provides conversions between Geodetic coordinates 00012 * (latitude and longitude in radians) and Eckert VI projection coordinates 00013 * (easting and northing in meters). This projection employs a spherical 00014 * Earth model. The spherical radius used is the radius of the sphere 00015 * having the same area as the ellipsoid. 00016 * 00017 * ERROR HANDLING 00018 * 00019 * This component checks parameters for valid values. If an invalid value 00020 * is found, the error code is combined with the current error code using 00021 * the bitwise or. This combining allows multiple error codes to be 00022 * returned. The possible error codes are: 00023 * 00024 * ECK6_NO_ERROR : No errors occurred in function 00025 * ECK6_LAT_ERROR : Latitude outside of valid range 00026 * (-90 to 90 degrees) 00027 * ECK6_LON_ERROR : Longitude outside of valid range 00028 * (-180 to 360 degrees) 00029 * ECK6_EASTING_ERROR : Easting outside of valid range 00030 * (False_Easting +/- ~18,000,000 m, 00031 * depending on ellipsoid parameters) 00032 * ECK6_NORTHING_ERROR : Northing outside of valid range 00033 * (False_Northing +/- 0 to ~8,000,000 m, 00034 * depending on ellipsoid parameters) 00035 * ECK6_CENT_MER_ERROR : Central meridian outside of valid range 00036 * (-180 to 360 degrees) 00037 * ECK6_A_ERROR : Semi-major axis less than or equal to zero 00038 * ECK6_INV_F_ERROR : Inverse flattening outside of valid range 00039 * (250 to 350) 00040 * 00041 * REUSE NOTES 00042 * 00043 * ECKERT6 is intended for reuse by any application that performs a 00044 * Eckert VI projection or its inverse. 00045 * 00046 * REFERENCES 00047 * 00048 * Further information on ECKERT6 can be found in the Reuse Manual. 00049 * 00050 * ECKERT6 originated from : U.S. Army Topographic Engineering Center 00051 * Geospatial Information Division 00052 * 7701 Telegraph Road 00053 * Alexandria, VA 22310-3864 00054 * 00055 * LICENSES 00056 * 00057 * None apply to this component. 00058 * 00059 * RESTRICTIONS 00060 * 00061 * ECKERT6 has no restrictions. 00062 * 00063 * ENVIRONMENT 00064 * 00065 * ECKERT6 was tested and certified in the following environments: 00066 * 00067 * 1. Solaris 2.5 with GCC 2.8.1 00068 * 2. MS Windows 95 with MS Visual C++ 6 00069 * 00070 * MODIFICATIONS 00071 * 00072 * Date Description 00073 * ---- ----------- 00074 * 04-16-99 Original Code 00075 * 03-06-07 Original C++ Code 00076 * 00077 */ 00078 00079 00080 #include "CoordinateSystem.h" 00081 00082 00083 namespace MSP 00084 { 00085 namespace CCS 00086 { 00087 class MapProjection3Parameters; 00088 class MapProjectionCoordinates; 00089 class GeodeticCoordinates; 00090 00091 00092 /***************************************************************************/ 00093 /* 00094 * DEFINES 00095 */ 00096 00097 class Eckert6 : public CoordinateSystem 00098 { 00099 public: 00100 00101 /* 00102 * The constructor receives the ellipsoid parameters and 00103 * Eckert VI projection parameters as inputs, and sets the corresponding state 00104 * variables. If any errors occur, an exception is thrown with a description 00105 * of the error. 00106 * 00107 * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (input) 00108 * ellipsoidFlattening : Flattening of ellipsoid (input) 00109 * centralMeridian : Longitude in radians at the center of (input) 00110 * the projection 00111 * falseEasting : A coordinate value in meters assigned to the 00112 * central meridian of the projection. (input) 00113 * falseNorthing : A coordinate value in meters assigned to the 00114 * origin latitude of the projection (input) 00115 */ 00116 00117 Eckert6( double ellipsoidSemiMajorAxis, double ellipsoidFlattening, double centralMeridian, double falseEasting, double falseNorthing ); 00118 00119 00120 Eckert6( const Eckert6 &e ); 00121 00122 00123 ~Eckert6( void ); 00124 00125 00126 Eckert6& operator=( const Eckert6 &e ); 00127 00128 00129 /* 00130 * The function getParameters returns the current ellipsoid 00131 * parameters and Eckert VI projection parameters. 00132 * 00133 * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (output) 00134 * ellipsoidFlattening : Flattening of ellipsoid (output) 00135 * centralMeridian : Longitude in radians at the center of (output) 00136 * the projection 00137 * falseEasting : A coordinate value in meters assigned to the 00138 * central meridian of the projection. (output) 00139 * falseNorthing : A coordinate value in meters assigned to the 00140 * origin latitude of the projection (output) 00141 */ 00142 00143 MapProjection3Parameters* getParameters() const; 00144 00145 00146 /* 00147 * The function convertFromGeodetic converts geodetic (latitude and 00148 * longitude) coordinates to Eckert VI projection (easting and northing) 00149 * coordinates, according to the current ellipsoid and Eckert VI projection 00150 * parameters. If any errors occur, an exception is thrown with a description 00151 * of the error. 00152 * 00153 * longitude : Longitude (lambda) in radians (input) 00154 * latitude : Latitude (phi) in radians (input) 00155 * easting : Easting (X) in meters (output) 00156 * northing : Northing (Y) in meters (output) 00157 */ 00158 00159 MSP::CCS::MapProjectionCoordinates* convertFromGeodetic( MSP::CCS::GeodeticCoordinates* geodeticCoordinates ); 00160 00161 00162 /* 00163 * The function convertToGeodetic converts Eckert VI projection 00164 * (easting and northing) coordinates to geodetic (latitude and longitude) 00165 * coordinates, according to the current ellipsoid and Eckert VI projection 00166 * coordinates. If any errors occur, an exception is thrown with a description 00167 * of the error. 00168 * 00169 * easting : Easting (X) in meters (input) 00170 * northing : Northing (Y) in meters (input) 00171 * longitude : Longitude (lambda) in radians (output) 00172 * latitude : Latitude (phi) in radians (output) 00173 */ 00174 00175 MSP::CCS::GeodeticCoordinates* convertToGeodetic( MSP::CCS::MapProjectionCoordinates* mapProjectionCoordinates ); 00176 00177 private: 00178 00179 /* Ellipsoid Parameters, default to WGS 84 */ 00180 double es2; /* Eccentricity (0.08181919084262188000) squared */ 00181 double es4; /* es2 * es2 */ 00182 double es6; /* es4 * es2 */ 00183 double Ra_Over_Sqrt_Two_Plus_PI; /* Ra(6371007.1810824)/Sqrt(2.0 + PI) */ 00184 double Inv_Ra_Over_Sqrt_Two_Plus_PI; /* Sqrt(2.0 + PI)/Ra(6371007.1810824) */ 00185 00186 /* Eckert6 projection Parameters */ 00187 double Eck6_Origin_Long; /* Longitude of origin in radians */ 00188 double Eck6_False_Easting; 00189 double Eck6_False_Northing; 00190 double Eck6_Delta_Northing; 00191 double Eck6_Max_Easting; 00192 double Eck6_Min_Easting; 00193 00194 }; 00195 } 00196 } 00197 00198 #endif 00199 00200 00201 // CLASSIFICATION: UNCLASSIFIED