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

« back to all changes in this revision

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