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

« back to all changes in this revision

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