4
/***************************************************************************/
5
/* RSC IDENTIFIER: ECKERT4
9
* This component provides conversions between Geodetic coordinates
10
* (latitude and longitude in radians) and Eckert4 projection coordinates
11
* (easting and northing in meters).
15
* This component checks parameters for valid values. If an invalid value
16
* is found, the error code is combined with the current error code using
17
* the bitwise or. This combining allows multiple error codes to be
18
* returned. The possible error codes are:
20
* ECK4_NO_ERROR : No errors occurred in function
21
* ECK4_LAT_ERROR : Latitude outside of valid range
23
* ECK4_LON_ERROR : Longitude outside of valid range
24
* (-180 to 360 degrees)
25
* ECK4_EASTING_ERROR : Easting outside of valid range
26
* (False_Easting +/- ~17,000,000 m,
27
* depending on ellipsoid parameters)
28
* ECK4_NORTHING_ERROR : Northing outside of valid range
29
* (False_Northing +/- 0 to 8,000,000 m,
30
* depending on ellipsoid parameters)
31
* ECK4_CENT_MER_ERROR : Central Meridian outside of valid range
32
* (-180 to 360 degrees)
33
* ECK4_A_ERROR : Semi-major axis less than or equal to zero
34
* ECK4_INV_F_ERROR : Inverse flattening outside of valid range
39
* ECKERT4 is intended for reuse by any application that performs a
40
* Eckert IV projection or its inverse.
44
* Further information on ECKERT4 can be found in the Reuse Manual.
46
* ECKERT4 originated from : U.S. Army Topographic Engineering Center
47
* Geospatial Information Division
49
* Alexandria, VA 22310-3864
53
* None apply to this component.
57
* ECKERT4 has no restrictions.
61
* ECKERT4 was tested and certified in the following environments:
63
* 1. Solaris 2.5 with GCC 2.8.1
64
* 2. MS Windows 95 with MS Visual C++ 6
70
* 04/16/99 Original Code
75
/***************************************************************************/
80
#define ECK4_NO_ERROR 0x0000
81
#define ECK4_LAT_ERROR 0x0001
82
#define ECK4_LON_ERROR 0x0002
83
#define ECK4_EASTING_ERROR 0x0004
84
#define ECK4_NORTHING_ERROR 0x0008
85
#define ECK4_CENT_MER_ERROR 0x0020
86
#define ECK4_A_ERROR 0x0040
87
#define ECK4_INV_F_ERROR 0x0080
90
/***************************************************************************/
96
/* ensure proper linkage to c++ programs */
101
long Set_Eckert4_Parameters(double a,
103
double Central_Meridian,
104
double False_Easting,
105
double False_Northing);
107
* The function Set_Eckert4_Parameters receives the ellipsoid parameters and
108
* Eckert IV projection parameters as inputs, and sets the corresponding state
109
* variables. If any errors occur, the error code(s) are returned by the
110
* function, otherwise ECK4_NO_ERROR is returned.
112
* a : Semi-major axis of ellipsoid, in meters (input)
113
* f : Flattening of ellipsoid (input)
114
* Central_Meridian : Longitude in radians at the center of (input)
116
* False_Easting : A coordinate value in meters assigned to the
117
* central meridian of the projection. (input)
118
* False_Northing : A coordinate value in meters assigned to the
119
* origin latitude of the projection (input)
123
void Get_Eckert4_Parameters(double *a,
125
double *Central_Meridian,
126
double *False_Easting,
127
double *False_Northing);
129
* The function Get_Eckert4_Parameters returns the current ellipsoid
130
* parameters and EckertIV projection parameters.
132
* a : Semi-major axis of ellipsoid, in meters (output)
133
* f : Flattening of ellipsoid (output)
134
* Central_Meridian : Longitude in radians at the center of (output)
136
* False_Easting : A coordinate value in meters assigned to the
137
* central meridian of the projection. (output)
138
* False_Northing : A coordinate value in meters assigned to the
139
* origin latitude of the projection (output)
143
long Convert_Geodetic_To_Eckert4 (double Latitude,
148
* The function Convert_Geodetic_To_Eckert4 converts geodetic (latitude and
149
* longitude) coordinates to Eckert IV projection easting, and northing
150
* coordinates, according to the current ellipsoid and Eckert IV projection
151
* parameters. If any errors occur, the error code(s) are returned by the
152
* function, otherwise ECK4_NO_ERROR is returned.
154
* Latitude : Latitude (phi) in radians (input)
155
* Longitude : Longitude (lambda) in radians (input)
156
* Easting : Easting (X) in meters (output)
157
* Northing : Northing (Y) in meters (output)
161
long Convert_Eckert4_To_Geodetic(double Easting,
166
* The function Convert_Eckert4_To_Geodetic converts Eckert IV projection
167
* easting and northing coordinates to geodetic (latitude and longitude)
168
* coordinates, according to the current ellipsoid and Eckert IV projection
169
* coordinates. If any errors occur, the error code(s) are returned by the
170
* function, otherwise ECK4_NO_ERROR is returned.
172
* Easting : Easting (X) in meters (input)
173
* Northing : Northing (Y) in meters (input)
174
* Latitude : Latitude (phi) in radians (output)
175
* Longitude : Longitude (lambda) in radians (output)
182
#endif /* ECKERT4_H */