4
/***************************************************************************/
5
/* RSC IDENTIFIER: MOLLWEIDE
9
* This component provides conversions between Geodetic coordinates
10
* (latitude and longitude in radians) and Mollweide 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
* MOLL_NO_ERROR : No errors occurred in function
21
* MOLL_LAT_ERROR : Latitude outside of valid range
23
* MOLL_LON_ERROR : Longitude outside of valid range
24
* (-180 to 360 degrees)
25
* MOLL_EASTING_ERROR : Easting outside of valid range
26
* (False_Easting +/- ~18,000,000 m,
27
* depending on ellipsoid parameters)
28
* MOLL_NORTHING_ERROR : Northing outside of valid range
29
* (False_Northing +/- ~9,000,000 m,
30
* depending on ellipsoid parameters)
31
* MOLL_ORIGIN_LON_ERROR : Origin longitude outside of valid range
32
* (-180 to 360 degrees)
33
* MOLL_A_ERROR : Semi-major axis less than or equal to zero
34
* MOLL_INV_F_ERROR : Inverse flattening outside of valid range
39
* MOLLWEID is intended for reuse by any application that performs a
40
* Mollweide projection or its inverse.
44
* Further information on MOLLWEID can be found in the Reuse Manual.
46
* MOLLWEID originated from : U.S. Army Topographic Engineering Center
47
* Geospatial Information Division
49
* Alexandria, VA 22310-3864
53
* None apply to this component.
57
* MOLLWEID has no restrictions.
61
* MOLLWEID was tested and certified in the following environments:
63
* 1. Solaris 2.5 with GCC 2.8.1
64
* 2. Windows 95 with MS Visual C++ 6
70
* 04/16/99 Original Code
75
/***************************************************************************/
80
#define MOLL_NO_ERROR 0x0000
81
#define MOLL_LAT_ERROR 0x0001
82
#define MOLL_LON_ERROR 0x0002
83
#define MOLL_EASTING_ERROR 0x0004
84
#define MOLL_NORTHING_ERROR 0x0008
85
#define MOLL_CENT_MER_ERROR 0x0020
86
#define MOLL_A_ERROR 0x0040
87
#define MOLL_INV_F_ERROR 0x0080
90
/***************************************************************************/
96
/* ensure proper linkage to c++ programs */
101
long Set_Mollweide_Parameters(double a,
103
double Central_Meridian,
104
double False_Easting,
105
double False_Northing);
107
* The function Set_Mollweide_Parameters receives the ellipsoid parameters and
108
* Mollweide projcetion 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 MOLL_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_Mollweide_Parameters(double *a,
125
double *Central_Meridian,
126
double *False_Easting,
127
double *False_Northing);
129
* The function Get_Mollweide_Parameters returns the current ellipsoid
130
* parameters and Mollweide 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_Mollweide (double Latitude,
148
* The function Convert_Geodetic_To_Mollweide converts geodetic (latitude and
149
* longitude) coordinates to Mollweide projection easting, and northing
150
* coordinates, according to the current ellipsoid and Mollweide projection
151
* parameters. If any errors occur, the error code(s) are returned by the
152
* function, otherwise MOLL_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_Mollweide_To_Geodetic(double Easting,
166
* The function Convert_Mollweide_To_Geodetic converts Mollweide projection
167
* easting and northing coordinates to geodetic (latitude and longitude)
168
* coordinates, according to the current ellipsoid and Mollweide projection
169
* coordinates. If any errors occur, the error code(s) are returned by the
170
* function, otherwise MOLL_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 /* MOLLWEID_H */