1 /********************************************************** 2 * Version $Id: eckert4.h 911 2011-02-14 16:38:15Z reklov_w $ 3 *********************************************************/ 4 #ifndef ECKERT4_H 5 #define ECKERT4_H 6 7 /***************************************************************************/ 8 /* RSC IDENTIFIER: ECKERT4 9 * 10 * ABSTRACT 11 * 12 * This component provides conversions between Geodetic coordinates 13 * (latitude and longitude in radians) and Eckert4 projection coordinates 14 * (easting and northing in meters). 15 * 16 * ERROR HANDLING 17 * 18 * This component checks parameters for valid values. If an invalid value 19 * is found, the error code is combined with the current error code using 20 * the bitwise or. This combining allows multiple error codes to be 21 * returned. The possible error codes are: 22 * 23 * ECK4_NO_ERROR : No errors occurred in function 24 * ECK4_LAT_ERROR : Latitude outside of valid range 25 * (-90 to 90 degrees) 26 * ECK4_LON_ERROR : Longitude outside of valid range 27 * (-180 to 360 degrees) 28 * ECK4_EASTING_ERROR : Easting outside of valid range 29 * (False_Easting +/- ~17,000,000 m, 30 * depending on ellipsoid parameters) 31 * ECK4_NORTHING_ERROR : Northing outside of valid range 32 * (False_Northing +/- 0 to 8,000,000 m, 33 * depending on ellipsoid parameters) 34 * ECK4_CENT_MER_ERROR : Central Meridian outside of valid range 35 * (-180 to 360 degrees) 36 * ECK4_A_ERROR : Semi-major axis less than or equal to zero 37 * ECK4_INV_F_ERROR : Inverse flattening outside of valid range 38 * (250 to 350) 39 * 40 * REUSE NOTES 41 * 42 * ECKERT4 is intended for reuse by any application that performs a 43 * Eckert IV projection or its inverse. 44 * 45 * REFERENCES 46 * 47 * Further information on ECKERT4 can be found in the Reuse Manual. 48 * 49 * ECKERT4 originated from : U.S. Army Topographic Engineering Center 50 * Geospatial Information Division 51 * 7701 Telegraph Road 52 * Alexandria, VA 22310-3864 53 * 54 * LICENSES 55 * 56 * None apply to this component. 57 * 58 * RESTRICTIONS 59 * 60 * ECKERT4 has no restrictions. 61 * 62 * ENVIRONMENT 63 * 64 * ECKERT4 was tested and certified in the following environments: 65 * 66 * 1. Solaris 2.5 with GCC 2.8.1 67 * 2. MS Windows 95 with MS Visual C++ 6 68 * 69 * MODIFICATIONS 70 * 71 * Date Description 72 * ---- ----------- 73 * 04/16/99 Original Code 74 * 75 */ 76 77 78 /***************************************************************************/ 79 /* 80 * DEFINES 81 */ 82 83 #define ECK4_NO_ERROR 0x0000 84 #define ECK4_LAT_ERROR 0x0001 85 #define ECK4_LON_ERROR 0x0002 86 #define ECK4_EASTING_ERROR 0x0004 87 #define ECK4_NORTHING_ERROR 0x0008 88 #define ECK4_CENT_MER_ERROR 0x0020 89 #define ECK4_A_ERROR 0x0040 90 #define ECK4_INV_F_ERROR 0x0080 91 92 93 /***************************************************************************/ 94 /* 95 * FUNCTION PROTOTYPES 96 * for ECKERT4.C 97 */ 98 99 /* ensure proper linkage to c++ programs */ 100 #ifdef __cplusplus 101 extern "C" { 102 #endif 103 104 long Set_Eckert4_Parameters(double a, 105 double f, 106 double Central_Meridian, 107 double False_Easting, 108 double False_Northing); 109 /* 110 * The function Set_Eckert4_Parameters receives the ellipsoid parameters and 111 * Eckert IV projection parameters as inputs, and sets the corresponding state 112 * variables. If any errors occur, the error code(s) are returned by the 113 * function, otherwise ECK4_NO_ERROR is returned. 114 * 115 * a : Semi-major axis of ellipsoid, in meters (input) 116 * f : Flattening of ellipsoid (input) 117 * Central_Meridian : Longitude in radians at the center of (input) 118 * the projection 119 * False_Easting : A coordinate value in meters assigned to the 120 * central meridian of the projection. (input) 121 * False_Northing : A coordinate value in meters assigned to the 122 * origin latitude of the projection (input) 123 */ 124 125 126 void Get_Eckert4_Parameters(double *a, 127 double *f, 128 double *Central_Meridian, 129 double *False_Easting, 130 double *False_Northing); 131 /* 132 * The function Get_Eckert4_Parameters returns the current ellipsoid 133 * parameters and EckertIV projection parameters. 134 * 135 * a : Semi-major axis of ellipsoid, in meters (output) 136 * f : Flattening of ellipsoid (output) 137 * Central_Meridian : Longitude in radians at the center of (output) 138 * the projection 139 * False_Easting : A coordinate value in meters assigned to the 140 * central meridian of the projection. (output) 141 * False_Northing : A coordinate value in meters assigned to the 142 * origin latitude of the projection (output) 143 */ 144 145 146 long Convert_Geodetic_To_Eckert4 (double Latitude, 147 double Longitude, 148 double *Easting, 149 double *Northing); 150 /* 151 * The function Convert_Geodetic_To_Eckert4 converts geodetic (latitude and 152 * longitude) coordinates to Eckert IV projection easting, and northing 153 * coordinates, according to the current ellipsoid and Eckert IV projection 154 * parameters. If any errors occur, the error code(s) are returned by the 155 * function, otherwise ECK4_NO_ERROR is returned. 156 * 157 * Latitude : Latitude (phi) in radians (input) 158 * Longitude : Longitude (lambda) in radians (input) 159 * Easting : Easting (X) in meters (output) 160 * Northing : Northing (Y) in meters (output) 161 */ 162 163 164 long Convert_Eckert4_To_Geodetic(double Easting, 165 double Northing, 166 double *Latitude, 167 double *Longitude); 168 /* 169 * The function Convert_Eckert4_To_Geodetic converts Eckert IV projection 170 * easting and northing coordinates to geodetic (latitude and longitude) 171 * coordinates, according to the current ellipsoid and Eckert IV projection 172 * coordinates. If any errors occur, the error code(s) are returned by the 173 * function, otherwise ECK4_NO_ERROR is returned. 174 * 175 * Easting : Easting (X) in meters (input) 176 * Northing : Northing (Y) in meters (input) 177 * Latitude : Latitude (phi) in radians (output) 178 * Longitude : Longitude (lambda) in radians (output) 179 */ 180 181 #ifdef __cplusplus 182 } 183 #endif 184 185 #endif /* ECKERT4_H */ 186 187