00001 // CLASSIFICATION: UNCLASSIFIED 00002 00003 #ifndef Neys_H 00004 #define Neys_H 00005 00006 /***************************************************************************/ 00007 /* RSC IDENTIFIER: NEYS 00008 * 00009 * ABSTRACT 00010 * 00011 * This component provides conversions between Geodetic coordinates 00012 * (latitude and longitude in radians) and Ney's (Modified Lambert 00013 * Conformal Conic) projection coordinates (easting and northing in meters). 00014 * 00015 * ERROR HANDLING 00016 * 00017 * This component checks parameters for valid values. If an invalid value 00018 * is found the error code is combined with the current error code using 00019 * the bitwise or. This combining allows multiple error codes to be 00020 * returned. The possible error codes are: 00021 * 00022 * NEYS_NO_ERROR : No errors occurred in function 00023 * NEYS_LAT_ERROR : Latitude outside of valid range 00024 * (-90 to 90 degrees) 00025 * NEYS_LON_ERROR : Longitude outside of valid range 00026 * (-180 to 360 degrees) 00027 * NEYS_EASTING_ERROR : Easting outside of valid range 00028 * (depends on ellipsoid and projection 00029 * parameters) 00030 * NEYS_NORTHING_ERROR : Northing outside of valid range 00031 * (depends on ellipsoid and projection 00032 * parameters) 00033 * NEYS_FIRST_STDP_ERROR : First standard parallel outside of valid 00034 * range (71 or 74 degrees) 00035 * NEYS_ORIGIN_LAT_ERROR : Origin latitude outside of valid range 00036 * (-89 59 59.0 to 89 59 59.0 degrees) 00037 * NEYS_CENT_MER_ERROR : Central meridian outside of valid range 00038 * (-180 to 360 degrees) 00039 * NEYS_A_ERROR : Semi-major axis less than or equal to zero 00040 * NEYS_INV_F_ERROR : Inverse flattening outside of valid range 00041 * (250 to 350) 00042 * 00043 * 00044 * REUSE NOTES 00045 * 00046 * NEYS is intended for reuse by any application that performs a Ney's (Modified 00047 * Lambert Conformal Conic) projection or its inverse. 00048 * 00049 * REFERENCES 00050 * 00051 * Further information on NEYS can be found in the Reuse Manual. 00052 * 00053 * NEYS originated from: 00054 * U.S. Army Topographic Engineering Center 00055 * Geospatial Information Division 00056 * 7701 Telegraph Road 00057 * Alexandria, VA 22310-3864 00058 * 00059 * LICENSES 00060 * 00061 * None apply to this component. 00062 * 00063 * RESTRICTIONS 00064 * 00065 * NEYS has no restrictions. 00066 * 00067 * ENVIRONMENT 00068 * 00069 * NEYS was tested and certified in the following environments: 00070 * 00071 * 1. Solaris 2.5 with GCC, version 2.8.1 00072 * 2. Windows 95 with MS Visual C++, version 6 00073 * 00074 * MODIFICATIONS 00075 * 00076 * Date Description 00077 * ---- ----------- 00078 * 8-4-00 Original Code 00079 * 3-2-07 Original C++ Code 00080 * 00081 * 00082 * 00083 */ 00084 00085 00086 #include "CoordinateSystem.h" 00087 00088 00089 namespace MSP 00090 { 00091 namespace CCS 00092 { 00093 class NeysParameters; 00094 class LambertConformalConic; 00095 class MapProjectionCoordinates; 00096 class GeodeticCoordinates; 00097 00098 00099 /***************************************************************************/ 00100 /* 00101 * DEFINES 00102 */ 00103 00104 class Neys : public CoordinateSystem 00105 { 00106 public: 00107 00108 /* 00109 * The constructor receives the ellipsoid parameters and 00110 * Ney's (Modified Lambert Conformal Conic) projection parameters as inputs, and sets the 00111 * corresponding state variables. If any errors occur, an exception is thrown with a description 00112 * of the error. 00113 * 00114 * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (input) 00115 * ellipsoidFlattening : Flattening of ellipsoid (input) 00116 * centralMeridian : Longitude of origin, in radians (input) 00117 * originLatitude : Latitude of origin, in radians (input) 00118 * standardParallel : First standard parallel, in radians (input) 00119 * falseEasting : False easting, in meters (input) 00120 * falseNorthing : False northing, in meters (input) 00121 */ 00122 00123 Neys( double ellipsoidSemiMajorAxis, double ellipsoidFlattening, double centralMeridian, double originLatitude, double standardParallel, double falseEasting, double falseNorthing ); 00124 00125 00126 Neys( const Neys &n ); 00127 00128 00129 ~Neys( void ); 00130 00131 00132 Neys& operator=( const Neys &n ); 00133 00134 00135 /* 00136 * The function getParameters returns the current ellipsoid 00137 * parameters and Ney's (Modified Lambert Conformal Conic) projection parameters. 00138 * 00139 * ellipsoidSemiMajorAxis : Semi-major axis of ellipsoid, in meters (output) 00140 * ellipsoidFlattening : Flattening of ellipsoid (output) 00141 * centralMeridian : Longitude of origin, in radians (output) 00142 * originLatitude : Latitude of origin, in radians (output) 00143 * standardParallel : First standard parallel, in radians (output) 00144 * falseEasting : False easting, in meters (output) 00145 * falseNorthing : False northing, in meters (output) 00146 */ 00147 00148 NeysParameters* getParameters() const; 00149 00150 00151 /* 00152 * The function convertFromGeodetic converts Geodetic (latitude and 00153 * longitude) coordinates to Ney's (Modified Lambert Conformal Conic) projection 00154 * (easting and northing) coordinates, according to the current ellipsoid and 00155 * Ney's (Modified Lambert Conformal Conic) projection parameters. If any errors occur, an exception 00156 * is thrown with a description of the error. 00157 * 00158 * longitude : Longitude, in radians (input) 00159 * latitude : Latitude, in radians (input) 00160 * easting : Easting (X), in meters (output) 00161 * northing : Northing (Y), in meters (output) 00162 */ 00163 00164 MSP::CCS::MapProjectionCoordinates* convertFromGeodetic( MSP::CCS::GeodeticCoordinates* geodeticCoordinates ); 00165 00166 00167 /* 00168 * The function convertToGeodetic converts Ney's (Modified Lambert Conformal 00169 * Conic) projection (easting and northing) coordinates to Geodetic (latitude) 00170 * and longitude) coordinates, according to the current ellipsoid and Ney's 00171 * (Modified Lambert Conformal Conic) projection parameters. If any errors occur, 00172 * an exception is thrown with a description f the error. 00173 * 00174 * easting : Easting (X), in meters (input) 00175 * northing : Northing (Y), in meters (input) 00176 * longitude : Longitude, in radians (output) 00177 * latitude : Latitude, in radians (output) 00178 */ 00179 00180 MSP::CCS::GeodeticCoordinates* convertToGeodetic( MSP::CCS::MapProjectionCoordinates* mapProjectionCoordinates ); 00181 00182 private: 00183 00184 LambertConformalConic* lambertConformalConic2; 00185 00186 /* Ney's projection Parameters */ 00187 double Neys_Std_Parallel_1; /* Lower std. parallel, in radians */ 00188 double Neys_Std_Parallel_2; /* Upper std. parallel, in radians */ 00189 double Neys_Origin_Lat; /* Latitude of origin, in radians */ 00190 double Neys_Origin_Long; /* Longitude of origin, in radians */ 00191 double Neys_False_Northing; /* False northing, in meters */ 00192 double Neys_False_Easting; /* False easting, in meters */ 00193 00194 /* Maximum variance for easting and northing values for WGS 84. */ 00195 double Neys_Delta_Easting; 00196 double Neys_Delta_Northing; 00197 }; 00198 } 00199 } 00200 00201 #endif 00202 00203 00204 // CLASSIFICATION: UNCLASSIFIED