00001 // CLASSIFICATION: UNCLASSIFIED 00002 00003 #ifndef GEOREF_H 00004 #define GEOREF_H 00005 00006 /***************************************************************************/ 00007 /* RSC IDENTIFIER: GEOREF 00008 * 00009 * ABSTRACT 00010 * 00011 * This component provides conversions from Geodetic coordinates (latitude 00012 * and longitude in radians) to a GEOREF coordinate string. 00013 * 00014 * ERROR HANDLING 00015 * 00016 * This component checks parameters for valid values. If an invalid value 00017 * is found, the error code is combined with the current error code using 00018 * the bitwise or. This combining allows multiple error codes to be 00019 * returned. The possible error codes are: 00020 * 00021 * GEOREF_NO_ERROR : No errors occurred in function 00022 * GEOREF_LAT_ERROR : Latitude outside of valid range 00023 * (-90 to 90 degrees) 00024 * GEOREF_LON_ERROR : Longitude outside of valid range 00025 * (-180 to 360 degrees) 00026 * GEOREF_STR_ERROR : A GEOREF string error: string too long, 00027 * string too short, or string length 00028 * not even. 00029 * GEOREF_STR_LAT_ERROR : The latitude part of the GEOREF string 00030 * (second or fourth character) is invalid. 00031 * GEOREF_STR_LON_ERROR : The longitude part of the GEOREF string 00032 * (first or third character) is invalid. 00033 * GEOREF_STR_LAT_MIN_ERROR : The latitude minute part of the GEOREF 00034 * string is greater than 60. 00035 * GEOREF_STR_LON_MIN_ERROR : The longitude minute part of the GEOREF 00036 * string is greater than 60. 00037 * GEOREF_PRECISION_ERROR : The precision must be between 0 and 5 00038 * inclusive. 00039 * 00040 * 00041 * REUSE NOTES 00042 * 00043 * GEOREF is intended for reuse by any application that performs a 00044 * conversion between Geodetic and GEOREF coordinates. 00045 * 00046 * REFERENCES 00047 * 00048 * Further information on GEOREF can be found in the Reuse Manual. 00049 * 00050 * GEOREF 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 * GEOREF has no restrictions. 00062 * 00063 * ENVIRONMENT 00064 * 00065 * GEOREF was tested and certified in the following environments: 00066 * 00067 * 1. Solaris 2.5 with GCC version 2.8.1 00068 * 2. Windows 95 with MS Visual C++ version 6 00069 * 00070 * MODIFICATIONS 00071 * 00072 * Date Description 00073 * ---- ----------- 00074 * 02-20-97 Original Code 00075 * 03-02-07 Original C++ Code 00076 */ 00077 00078 00079 #include "CoordinateSystem.h" 00080 00081 00082 namespace MSP 00083 { 00084 namespace CCS 00085 { 00086 class GEOREFCoordinates; 00087 class GeodeticCoordinates; 00088 00089 00090 /***************************************************************************/ 00091 /* 00092 * DEFINES 00093 */ 00094 00095 const long GEOREF_STR_LAT_MIN_ERROR = 0x0020; 00096 const long GEOREF_STR_LON_MIN_ERROR = 0x0040; 00097 00098 00099 class GEOREF : public CoordinateSystem 00100 { 00101 public: 00102 00103 GEOREF(); 00104 00105 00106 GEOREF( const GEOREF &g ); 00107 00108 00109 ~GEOREF( void ); 00110 00111 00112 GEOREF& operator=( const GEOREF &g ); 00113 00114 00115 /* 00116 * The function convertFromGeodetic converts Geodetic (latitude and longitude in radians) 00117 * coordinates to a GEOREF coordinate string. Precision specifies the 00118 * number of digits in the GEOREF string for latitude and longitude: 00119 * 0 for nearest degree 00120 * 1 for nearest ten minutes 00121 * 2 for nearest minute 00122 * 3 for nearest tenth of a minute 00123 * 4 for nearest hundredth of a minute 00124 * 5 for nearest thousandth of a minute 00125 * 00126 * longitude : Longitude in radians. (input) 00127 * latitude : Latitude in radians. (input) 00128 * precision : Precision specified by the user. (input) 00129 * GEOREFString : GEOREF coordinate string. (output) 00130 * 00131 */ 00132 00133 MSP::CCS::GEOREFCoordinates* convertFromGeodetic( MSP::CCS::GeodeticCoordinates* geodeticCoordinates, long precision ); 00134 00135 00136 /* 00137 * The function convertToGeodetic converts a GEOREF coordinate string to Geodetic (latitude 00138 * and longitude in radians) coordinates. 00139 * 00140 * GEOREFString : GEOREF coordinate string. (input) 00141 * longitude : Longitude in radians. (output) 00142 * latitude : Latitude in radians. (output) 00143 * 00144 */ 00145 00146 MSP::CCS::GeodeticCoordinates* convertToGeodetic( MSP::CCS::GEOREFCoordinates* GEOREFString ); 00147 00148 private: 00149 00150 }; 00151 } 00152 } 00153 00154 #endif 00155 00156 00157 // CLASSIFICATION: UNCLASSIFIED