00001 // CLASSIFICATION: UNCLASSIFIED 00002 00003 #ifndef Orthographic_H 00004 #define Orthographic_H 00005 00006 /***************************************************************************/ 00007 /* RSC IDENTIFIER: ORTHOGRAPHIC 00008 * 00009 * ABSTRACT 00010 * 00011 * This component provides conversions between Geodetic coordinates 00012 * (latitude and longitude in radians) and Orthographic projection 00013 * coordinates (easting and northing in meters). The Orthographic 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 * ORTH_NO_ERROR : No errors occurred in function 00026 * ORTH_LAT_ERROR : Latitude outside of valid range 00027 * (-90 to 90 degrees) 00028 * ORTH_LON_ERROR : Longitude outside of valid range 00029 * (-180 to 360 degrees) 00030 * ORTH_EASTING_ERROR : Easting outside of valid range 00031 * (False_Easting +/- ~6,500,000 m, 00032 * depending on ellipsoid parameters) 00033 * ORTH_NORTHING_ERROR : Northing outside of valid range 00034 * (False_Northing +/- ~6,500,000 m, 00035 * depending on ellipsoid parameters) 00036 * ORTH_RADIUS_ERROR : Coordinates too far from pole, 00037 * depending on ellipsoid and 00038 * projection parameters 00039 * ORTH_ORIGIN_LAT_ERROR : Origin latitude outside of valid range 00040 * (-90 to 90 degrees) 00041 * ORTH_CENT_MER_ERROR : Central meridian outside of valid range 00042 * (-180 to 360 degrees) 00043 * ORTH_A_ERROR : Semi-major axis less than or equal to zero 00044 * ORTH_INV_F_ERROR : Inverse flattening outside of valid range 00045 * (250 to 350) 00046 * 00047 * REUSE NOTES 00048 * 00049 * ORTHOGRAPHIC is intended for reuse by any application that performs a 00050 * Orthographic projection or its inverse. 00051 * 00052 * REFERENCES 00053 * 00054 * Further information on ORTHOGRAPHIC can be found in the Reuse Manual. 00055 * 00056 * ORTHOGRAPHIC originated from : U.S. Army Topographic Engineering Center 00057 * Geospatial Information Division 00058 * 7701 Telegraph Road 00059 * Alexandria, VA 22310-3864 00060 * 00061 * LICENSES 00062 * 00063 * None apply to this component. 00064 * 00065 * RESTRICTIONS 00066 * 00067 * ORTHOGRAPHIC has no restrictions. 00068 * 00069 * ENVIRONMENT 00070 * 00071 * ORTHOGRAPHIC was tested and certified in the following environments: 00072 * 00073 * 1. Solaris 2.5 with GCC, version 2.8.1 00074 * 2. Windows 95 with MS Visual C++, version 6 00075 * 00076 * MODIFICATIONS 00077 * 00078 * Date Description 00079 * ---- ----------- 00080 * 06-15-99 Original Code 00081 * 03-05-07 Original C++ Code 00082 * 00083 */ 00084 00085 00086 #include "CoordinateSystem.h" 00087 00088 00089 namespace MSP 00090 { 00091 namespace CCS 00092 { 00093 class MapProjection4Parameters; 00094 class MapProjectionCoordinates; 00095 class GeodeticCoordinates; 00096 00097 00098 /***************************************************************************/ 00099 /* 00100 * DEFINES 00101 */ 00102 00103 class Orthographic : public CoordinateSystem 00104 { 00105 public: 00106 00107 /* 00108 * The constructor receives the ellipsoid parameters and 00109 * projection parameters as inputs, and sets the corresponding state 00110 * variables. If any errors occur, an exception is thrown with a description 00111 * of the error. 00112 * 00113 * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (input) 00114 * ellipsoidFlattening : Flattening of ellipsoid (input) 00115 * centralMeridian : Longitude in radians at the center of (input) 00116 * the projection 00117 * originLatitude : Latitude in radians at which the (input) 00118 * point scale factor is 1.0 00119 * falseEasting : A coordinate value in meters assigned to the 00120 * central meridian of the projection. (input) 00121 * falseNorthing : A coordinate value in meters assigned to the 00122 * origin latitude of the projection (input) 00123 */ 00124 00125 Orthographic( double ellipsoidSemiMajorAxis, double ellipsoidFlattening, double centralMeridian, double originLatitude, double falseEasting, double falseNorthing ); 00126 00127 00128 Orthographic( const Orthographic &o ); 00129 00130 00131 ~Orthographic( void ); 00132 00133 00134 Orthographic& operator=( const Orthographic &o ); 00135 00136 00137 /* 00138 * The function getParameters returns the current ellipsoid 00139 * parameters and Orthographic projection parameters. 00140 * 00141 * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (output) 00142 * ellipsoidFlattening : Flattening of ellipsoid (output) 00143 * centralMeridian : Longitude in radians at the center of (output) 00144 * the projection 00145 * originLatitude : Latitude in radians at which the (output) 00146 * point scale factor is 1.0 00147 * falseEasting : A coordinate value in meters assigned to the 00148 * central meridian of the projection. (output) 00149 * falseNorthing : A coordinate value in meters assigned to the 00150 * origin latitude of the projection (output) 00151 */ 00152 00153 MapProjection4Parameters* getParameters() const; 00154 00155 00156 /* 00157 * The function convertFromGeodetic converts geodetic (latitude and 00158 * longitude) coordinates to Orthographic projection (easting and northing) 00159 * coordinates, according to the current ellipsoid and Orthographic projection 00160 * parameters. If any errors occur, an exception is thrown with a description 00161 * of the error. 00162 * 00163 * longitude : Longitude (lambda) in radians (input) 00164 * latitude : Latitude (phi) in radians (input) 00165 * easting : Easting (X) in meters (output) 00166 * northing : Northing (Y) in meters (output) 00167 */ 00168 00169 MSP::CCS::MapProjectionCoordinates* convertFromGeodetic( MSP::CCS::GeodeticCoordinates* geodeticCoordinates ); 00170 00171 00172 /* 00173 * The function convertToGeodetic converts Orthographic projection 00174 * (easting and northing) coordinates to geodetic (latitude and longitude) 00175 * coordinates, according to the current ellipsoid and Orthographic projection 00176 * coordinates. If any errors occur, an exception is thrown with a description 00177 * of the error. 00178 * 00179 * easting : Easting (X) in meters (input) 00180 * northing : Northing (Y) in meters (input) 00181 * longitude : Longitude (lambda) in radians (output) 00182 * latitude : Latitude (phi) in radians (output) 00183 */ 00184 00185 MSP::CCS::GeodeticCoordinates* convertToGeodetic( MSP::CCS::MapProjectionCoordinates* mapProjectionCoordinates ); 00186 00187 private: 00188 00189 /* Ellipsoid Parameters, default to WGS 84 */ 00190 double es2; /* Eccentricity (0.08181919084262188000) squared */ 00191 double es4; /* es2 * es2 */ 00192 double es6; /* es4 * es2 */ 00193 double Ra; /* Spherical Radius */ 00194 00195 /* Orthographic projection Parameters */ 00196 double Orth_Origin_Lat; /* Latitude of origin in radians */ 00197 double Orth_Origin_Long; /* Longitude of origin in radians */ 00198 double Orth_False_Easting; 00199 double Orth_False_Northing; 00200 double Sin_Orth_Origin_Lat; /* sin(Orth_Origin_Lat) */ 00201 double Cos_Orth_Origin_Lat; /* cos(Orth_Origin_Lat) */ 00202 00203 }; 00204 } 00205 } 00206 00207 #endif 00208 00209 00210 // CLASSIFICATION: UNCLASSIFIED