OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimSinusoid.h
Go to the documentation of this file.
1 #ifndef SINUSOID_H
2  #define SINUSOID_H
3 
4 /***************************************************************************/
5 /* RSC IDENTIFIER: SINUSOIDAL
6  *
7  * ABSTRACT
8  *
9  * This component provides conversions between Geodetic coordinates
10  * (latitude and longitude in radians) and Sinusoid 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  * SINU_NO_ERROR : No errors occurred in function
21  * SINU_LAT_ERROR : Latitude outside of valid range
22  * (-90 to 90 degrees)
23  * SINU_LON_ERROR : Longitude outside of valid range
24  * (-180 to 360 degrees)
25  * SINU_EASTING_ERROR : Easting outside of valid range
26  * (False_Easting +/- ~20,000,000 m,
27  * depending on ellipsoid parameters)
28  * SINU_NORTHING_ERROR : Northing outside of valid range
29  * (False_Northing +/- ~10,000,000 m,
30  * depending on ellipsoid parameters)
31  * SINU_CENT_MER_ERROR : Origin longitude outside of valid range
32  * (-180 to 360 degrees)
33  * SINU_A_ERROR : Semi-major axis less than or equal to zero
34  * SINU_INV_F_ERROR : Inverse flattening outside of valid range
35  * (250 to 350)
36  *
37  * REUSE NOTES
38  *
39  * SINUSOIDAL is intended for reuse by any application that performs a
40  * Sinusoid projection or its inverse.
41  *
42  * REFERENCES
43  *
44  * Further information on SINUSOIDAL can be found in the Reuse Manual.
45  *
46  * SINUSOIDAL 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  * SINUSOIDAL has no restrictions.
58  *
59  * ENVIRONMENT
60  *
61  * SINUSOIDAL was tested and certified in the following environments:
62  *
63  * 1. Solaris 2.5 with GCC, version 2.8.1
64  * 2. Windows 95 with MS Visual C++, version 6
65  *
66  * MODIFICATIONS
67  *
68  * Date Description
69  * ---- -----------
70  * 7-15-99 Original Code
71  *
72  */
73 
74 
75 /***************************************************************************/
76 /*
77  * DEFINES
78  */
79 
80  #define SINU_NO_ERROR 0x0000
81  #define SINU_LAT_ERROR 0x0001
82  #define SINU_LON_ERROR 0x0002
83  #define SINU_EASTING_ERROR 0x0004
84  #define SINU_NORTHING_ERROR 0x0008
85  #define SINU_CENT_MER_ERROR 0x0020
86  #define SINU_A_ERROR 0x0040
87  #define SINU_INV_F_ERROR 0x0080
88 
89 
90 /***************************************************************************/
91 /*
92  * FUNCTION PROTOTYPES
93  * for SINUSOID.C
94  */
95 
96 /* ensure proper linkage to c++ programs */
97  #ifdef __cplusplus
98 extern "C" {
99  #endif
100 
101  long Set_Sinusoidal_Parameters(double a,
102  double f,
103  double Central_Meridian,
104  double False_Easting,
105  double False_Northing);
106 
107 /*
108  * The function Set_Sinusoidal_Parameters receives the ellipsoid parameters and
109  * Sinusoidal projcetion parameters as inputs, and sets the corresponding state
110  * variables. If any errors occur, the error code(s) are returned by the function,
111  * otherwise SINU_NO_ERROR is returned.
112  *
113  * a : Semi-major axis of ellipsoid, in meters (input)
114  * f : Flattening of ellipsoid (input)
115  * Central_Meridian : Longitude in radians at the center of (input)
116  * the projection
117  * False_Easting : A coordinate value in meters assigned to the
118  * central meridian of the projection. (input)
119  * False_Northing : A coordinate value in meters assigned to the
120  * origin latitude of the projection (input)
121  */
122 
123 
124  void Get_Sinusoidal_Parameters(double *a,
125  double *f,
126  double *Central_Meridian,
127  double *False_Easting,
128  double *False_Northing);
129 
130 /*
131  * The function Get_Sinusoidal_Parameters returns the current ellipsoid
132  * parameters and Sinusoidal projection parameters.
133  *
134  * a : Semi-major axis of ellipsoid, in meters (output)
135  * f : Flattening of ellipsoid (output)
136  * Central_Meridian : Longitude in radians at the center of (output)
137  * the projection
138  * False_Easting : A coordinate value in meters assigned to the
139  * central meridian of the projection. (output)
140  * False_Northing : A coordinate value in meters assigned to the
141  * origin latitude of the projection (output)
142  */
143 
144 
145  long Convert_Geodetic_To_Sinusoidal (double Latitude,
146  double Longitude,
147  double *Easting,
148  double *Northing);
149 /*
150  * The function Convert_Geodetic_To_Sinusoidal converts geodetic (latitude and
151  * longitude) coordinates to Sinusoidal projection easting, and northing
152  * coordinates, according to the current ellipsoid and Sinusoidal projection
153  * parameters. If any errors occur, the error code(s) are returned by the
154  * function, otherwise SINU_NO_ERROR is returned.
155  *
156  * Latitude : Latitude (phi) in radians (input)
157  * Longitude : Longitude (lambda) in radians (input)
158  * Easting : Easting (X) in meters (output)
159  * Northing : Northing (Y) in meters (output)
160  */
161 
162 
163  long Convert_Sinusoidal_To_Geodetic(double Easting,
164  double Northing,
165  double *Latitude,
166  double *Longitude);
167 /*
168  * The function Convert_Sinusoidal_To_Geodetic converts Sinusoidal projection
169  * easting and northing coordinates to geodetic (latitude and longitude)
170  * coordinates, according to the current ellipsoid and Sinusoida projection
171  * coordinates. If any errors occur, the error code(s) are returned by the
172  * function, otherwise SINU_NO_ERROR is returned.
173  *
174  * Easting : Easting (X) in meters (input)
175  * Northing : Northing (Y) in meters (input)
176  * Latitude : Latitude (phi) in radians (output)
177  * Longitude : Longitude (lambda) in radians (output)
178  */
179 
180  #ifdef __cplusplus
181 }
182  #endif
183 
184 #endif /* SINUSOID_H */
185 
void Get_Sinusoidal_Parameters(double *a, double *f, double *Central_Meridian, double *False_Easting, double *False_Northing)
long Set_Sinusoidal_Parameters(double a, double f, double Central_Meridian, double False_Easting, double False_Northing)
long Convert_Sinusoidal_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude)
long Convert_Geodetic_To_Sinusoidal(double Latitude, double Longitude, double *Easting, double *Northing)