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

« back to all changes in this revision

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