OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimTranmerc.h
Go to the documentation of this file.
1 #ifndef TRANMERC_H
2 #define TRANMERC_H
3 
4 /***************************************************************************/
5 /* RSC IDENTIFIER: TRANSVERSE MERCATOR
6  *
7  * ABSTRACT
8  *
9  * This component provides conversions between Geodetic coordinates
10  * (latitude and longitude) and Transverse Mercator projection coordinates
11  * (easting and northing).
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  * TRANMERC_NO_ERROR : No errors occurred in function
21  * TRANMERC_LAT_ERROR : Latitude outside of valid range
22  * (-90 to 90 degrees)
23  * TRANMERC_LON_ERROR : Longitude outside of valid range
24  * (-180 to 360 degrees, and within
25  * +/-90 of Central Meridian)
26  * TRANMERC_EASTING_ERROR : Easting outside of valid range
27  * (depending on ellipsoid and
28  * projection parameters)
29  * TRANMERC_NORTHING_ERROR : Northing outside of valid range
30  * (depending on ellipsoid and
31  * projection parameters)
32  * TRANMERC_ORIGIN_LAT_ERROR : Origin latitude outside of valid range
33  * (-90 to 90 degrees)
34  * TRANMERC_CENT_MER_ERROR : Central meridian outside of valid range
35  * (-180 to 360 degrees)
36  * TRANMERC_A_ERROR : Semi-major axis less than or equal to zero
37  * TRANMERC_INV_F_ERROR : Inverse flattening outside of valid range
38  * (250 to 350)
39  * TRANMERC_SCALE_FACTOR_ERROR : Scale factor outside of valid
40  * range (0.3 to 3.0)
41  * TM_LON_WARNING : Distortion will result if longitude is more
42  * than 9 degrees from the Central Meridian
43  *
44  * REUSE NOTES
45  *
46  * TRANSVERSE MERCATOR is intended for reuse by any application that
47  * performs a Transverse Mercator projection or its inverse.
48  *
49  * REFERENCES
50  *
51  * Further information on TRANSVERSE MERCATOR can be found in the
52  * Reuse Manual.
53  *
54  * TRANSVERSE MERCATOR 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 MERCATOR has no restrictions.
67  *
68  * ENVIRONMENT
69  *
70  * TRANSVERSE MERCATOR was tested and certified in the following
71  * environments:
72  *
73  * 1. Solaris 2.5 with GCC, version 2.8.1
74  * 2. Windows 95 with MS Visual C++, version 6
75  *
76  * MODIFICATIONS
77  *
78  * Date Description
79  * ---- -----------
80  * 10-02-97 Original Code
81  * 03-02-97 Re-engineered Code
82  *
83  */
84 
85 
86 /***************************************************************************/
87 /*
88  * DEFINES
89  */
90 
91 #define TRANMERC_NO_ERROR 0x0000
92 #define TRANMERC_LAT_ERROR 0x0001
93 #define TRANMERC_LON_ERROR 0x0002
94 #define TRANMERC_EASTING_ERROR 0x0004
95 #define TRANMERC_NORTHING_ERROR 0x0008
96 #define TRANMERC_ORIGIN_LAT_ERROR 0x0010
97 #define TRANMERC_CENT_MER_ERROR 0x0020
98 #define TRANMERC_A_ERROR 0x0040
99 #define TRANMERC_INV_F_ERROR 0x0080
100 #define TRANMERC_SCALE_FACTOR_ERROR 0x0100
101 #define TRANMERC_LON_WARNING 0x0200
102 
103 
104 /***************************************************************************/
105 /*
106  * FUNCTION PROTOTYPES
107  * for TRANMERC.C
108  */
109 
110 /* ensure proper linkage to c++ programs */
111 #ifdef __cplusplus
112 extern "C" {
113 #endif
114 
115  long Set_Transverse_Mercator_Parameters(double a,
116  double f,
117  double Origin_Latitude,
118  double Central_Meridian,
119  double False_Easting,
120  double False_Northing,
121  double Scale_Factor);
122 /*
123  * The function Set_Tranverse_Mercator_Parameters receives the ellipsoid
124  * parameters and Tranverse Mercator projection parameters as inputs, and
125  * sets the corresponding state variables. If any errors occur, the error
126  * code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
127  * returned.
128  *
129  * a : Semi-major axis of ellipsoid, in meters (input)
130  * f : Flattening of ellipsoid (input)
131  * Origin_Latitude : Latitude in radians at the origin of the (input)
132  * projection
133  * Central_Meridian : Longitude in radians at the center of the (input)
134  * projection
135  * False_Easting : Easting/X at the center of the projection (input)
136  * False_Northing : Northing/Y at the center of the projection (input)
137  * Scale_Factor : Projection scale factor (input)
138  */
139 
140 
141  void Get_Transverse_Mercator_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_Transverse_Mercator_Parameters returns the current
150  * ellipsoid and Transverse Mercator projection parameters.
151  *
152  * a : Semi-major axis of ellipsoid, in meters (output)
153  * f : Flattening of ellipsoid (output)
154  * Origin_Latitude : Latitude in radians at the origin of the (output)
155  * projection
156  * Central_Meridian : Longitude in radians at the center of the (output)
157  * projection
158  * False_Easting : Easting/X at the center of the projection (output)
159  * False_Northing : Northing/Y at the center of the projection (output)
160  * Scale_Factor : Projection scale factor (output)
161  */
162 
163 
164  long Convert_Geodetic_To_Transverse_Mercator (double Latitude,
165  double Longitude,
166  double *Easting,
167  double *Northing);
168 
169 /*
170  * The function Convert_Geodetic_To_Transverse_Mercator converts geodetic
171  * (latitude and longitude) coordinates to Transverse Mercator projection
172  * (easting and northing) coordinates, according to the current ellipsoid
173  * and Transverse Mercator projection coordinates. If any errors occur, the
174  * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
175  * returned.
176  *
177  * Latitude : Latitude in radians (input)
178  * Longitude : Longitude in radians (input)
179  * Easting : Easting/X in meters (output)
180  * Northing : Northing/Y in meters (output)
181  */
182 
183 
184  long Convert_Transverse_Mercator_To_Geodetic (double Easting,
185  double Northing,
186  double *Latitude,
187  double *Longitude);
188 
189 /*
190  * The function Convert_Transverse_Mercator_To_Geodetic converts Transverse
191  * Mercator projection (easting and northing) coordinates to geodetic
192  * (latitude and longitude) coordinates, according to the current ellipsoid
193  * and Transverse Mercator projection parameters. If any errors occur, the
194  * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
195  * returned.
196  *
197  * Easting : Easting/X in meters (input)
198  * Northing : Northing/Y in meters (input)
199  * Latitude : Latitude in radians (output)
200  * Longitude : Longitude in radians (output)
201  */
202 
203 
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 #endif /* TRANMERC_H */
long Set_Transverse_Mercator_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing, double Scale_Factor)
void Get_Transverse_Mercator_Parameters(double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing, double *Scale_Factor)
long Convert_Transverse_Mercator_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude)
long Convert_Geodetic_To_Transverse_Mercator(double Latitude, double Longitude, double *Easting, double *Northing)