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