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

« back to all changes in this revision

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