~ubuntu-branches/ubuntu/raring/geotranz/raring

« back to all changes in this revision

Viewing changes to dt_cc/cyleqa/cyleqa.h

  • Committer: Bazaar Package Importer
  • Author(s): Roberto Lumbreras
  • Date: 2008-10-17 14:43:09 UTC
  • Revision ID: james.westby@ubuntu.com-20081017144309-jb7uzfi1y1lvez8j
Tags: upstream-2.4.2
ImportĀ upstreamĀ versionĀ 2.4.2

Show diffs side-by-side

added added

removed removed

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