4
/***************************************************************************/
5
/* RSC IDENTIFIER: LAMBERT_2
9
* This component provides conversions between Geodetic coordinates
10
* (latitude and longitude in radians) and Lambert Conformal Conic
11
* (2 parallel) projection coordinates (easting and northing in meters) defined
12
* by two standard parallels. When both standard parallel parameters
13
* are set to the same latitude value, the result is a Lambert
14
* Conformal Conic projection with one standard parallel at the
19
* This component checks parameters for valid values. If an invalid value
20
* is found the error code is combined with the current error code using
21
* the bitwise or. This combining allows multiple error codes to be
22
* returned. The possible error codes are:
24
* LAMBERT_2_NO_ERROR : No errors occurred in function
25
* LAMBERT_2_LAT_ERROR : Latitude outside of valid range
27
* LAMBERT_2_LON_ERROR : Longitude outside of valid range
28
* (-180 to 360 degrees)
29
* LAMBERT_2_EASTING_ERROR : Easting outside of valid range
30
* (depends on ellipsoid and projection
32
* LAMBERT_2_NORTHING_ERROR : Northing outside of valid range
33
* (depends on ellipsoid and projection
35
* LAMBERT_2_FIRST_STDP_ERROR : First standard parallel outside of valid
36
* range (-89 59 59.0 to 89 59 59.0 degrees)
37
* LAMBERT_2_SECOND_STDP_ERROR : Second standard parallel outside of valid
38
* range (-89 59 59.0 to 89 59 59.0 degrees)
39
* LAMBERT_2_ORIGIN_LAT_ERROR : Origin latitude outside of valid range
40
* (-89 59 59.0 to 89 59 59.0 degrees)
41
* LAMBERT_2_CENT_MER_ERROR : Central meridian outside of valid range
42
* (-180 to 360 degrees)
43
* LAMBERT_2_A_ERROR : Semi-major axis less than or equal to zero
44
* LAMBERT_2_INV_F_ERROR : Inverse flattening outside of valid range
46
* LAMBERT_2_HEMISPHERE_ERROR : Standard parallels cannot be opposite latitudes
47
* LAMBERT_2_FIRST_SECOND_ERROR : The 1st & 2nd standard parallels cannot
53
* LAMBERT_2 is intended for reuse by any application that performs a Lambert
54
* Conformal Conic (2 parallel) projection or its inverse.
58
* Further information on LAMBERT_2 can be found in the Reuse Manual.
60
* LAMBERT_2 originated from:
61
* U.S. Army Topographic Engineering Center
62
* Geospatial Information Division
64
* Alexandria, VA 22310-3864
68
* None apply to this component.
72
* LAMBERT_2 has no restrictions.
76
* LAMBERT_2 was tested and certified in the following environments:
78
* 1. Solaris 2.5 with GCC, version 2.8.1
79
* 2. Windows 98/2000 with MS Visual C++, version 6
85
* 03-05-05 Original Code
91
/***************************************************************************/
96
#define LAMBERT_2_NO_ERROR 0x0000
97
#define LAMBERT_2_LAT_ERROR 0x0001
98
#define LAMBERT_2_LON_ERROR 0x0002
99
#define LAMBERT_2_EASTING_ERROR 0x0004
100
#define LAMBERT_2_NORTHING_ERROR 0x0008
101
#define LAMBERT_2_FIRST_STDP_ERROR 0x0010
102
#define LAMBERT_2_SECOND_STDP_ERROR 0x0020
103
#define LAMBERT_2_ORIGIN_LAT_ERROR 0x0040
104
#define LAMBERT_2_CENT_MER_ERROR 0x0080
105
#define LAMBERT_2_A_ERROR 0x0100
106
#define LAMBERT_2_INV_F_ERROR 0x0200
107
#define LAMBERT_2_HEMISPHERE_ERROR 0x0400
108
#define LAMBERT_2_FIRST_SECOND_ERROR 0x0800
109
#define LAMBERT_2_SCALE_FACTOR_ERROR 0x1000
112
/***************************************************************************/
114
* FUNCTION PROTOTYPES
118
/* ensure proper linkage to c++ programs */
125
long Set_Lambert_2_Parameters(double a,
127
double Origin_Latitude,
128
double Central_Meridian,
129
double Std_Parallel_1,
130
double Std_Parallel_2,
131
double False_Easting,
132
double False_Northing);
135
* The function Set_Lambert_2_Parameters receives the ellipsoid parameters and
136
* Lambert Conformal Conic (2 parallel) projection parameters as inputs, and sets the
137
* corresponding state variables. If any errors occur, the error code(s)
138
* are returned by the function, otherwise LAMBERT_2_NO_ERROR is returned.
140
* a : Semi-major axis of ellipsoid, in meters (input)
141
* f : Flattening of ellipsoid (input)
142
* Origin_Latitude : Latitude of origin in radians (input)
143
* Central_Meridian : Longitude of origin in radians (input)
144
* Std_Parallel_1 : First standard parallel (input)
145
* Std_Parallel_2 : Second standard parallel (input)
146
* False_Easting : False easting in meters (input)
147
* False_Northing : False northing in meters (input)
149
* Note that when the two standard parallel parameters are both set to the
150
* same latitude value, the result is a Lambert Conformal Conic projection
151
* with one standard parallel at the specified latitude.
156
void Get_Lambert_2_Parameters(double *a,
158
double *Origin_Latitude,
159
double *Central_Meridian,
160
double *Std_Parallel_1,
161
double *Std_Parallel_2,
162
double *False_Easting,
163
double *False_Northing);
166
* The function Get_Lambert_2_Parameters returns the current ellipsoid
167
* parameters and Lambert Conformal Conic (2 parallel) projection parameters.
169
* a : Semi-major axis of ellipsoid, in meters (output)
170
* f : Flattening of ellipsoid (output)
171
* Origin_Latitude : Latitude of origin, in radians (output)
172
* Central_Meridian : Longitude of origin, in radians (output)
173
* Std_Parallel_1 : First standard parallel (output)
174
* Std_Parallel_2 : Second standard parallel (output)
175
* False_Easting : False easting, in meters (output)
176
* False_Northing : False northing, in meters (output)
181
long Convert_Geodetic_To_Lambert_2 (double Latitude,
187
* The function Convert_Geodetic_To_Lambert_2 converts Geodetic (latitude and
188
* longitude) coordinates to Lambert Conformal Conic (2 parallel) projection (easting
189
* and northing) coordinates, according to the current ellipsoid and
190
* Lambert Conformal Conic (2 parallel) projection parameters. If any errors occur, the
191
* error code(s) are returned by the function, otherwise LAMBERT_2_NO_ERROR is
194
* Latitude : Latitude in radians (input)
195
* Longitude : Longitude in radians (input)
196
* Easting : Easting (X) in meters (output)
197
* Northing : Northing (Y) in meters (output)
201
long Convert_Lambert_2_To_Geodetic (double Easting,
207
* The function Convert_Lambert_2_To_Geodetic converts Lambert Conformal
208
* Conic (2 parallel) projection (easting and northing) coordinates to Geodetic
209
* (latitude and longitude) coordinates, according to the current ellipsoid
210
* and Lambert Conformal Conic (2 parallel) projection parameters. If any errors occur,
211
* the error code(s) are returned by the function, otherwise LAMBERT_2_NO_ERROR
214
* Easting : Easting (X) in meters (input)
215
* Northing : Northing (Y) in meters (input)
216
* Latitude : Latitude in radians (output)
217
* Longitude : Longitude in radians (output)
225
#endif /* LAMBERT_2_H */