UNCLASSIFIED
GeographicTranslator
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Friends
Macros
master
geotrans3.7
CCS
src
dtcc
CoordinateSystems
webmerc
WebMercator.h
Go to the documentation of this file.
1
// CLASSIFICATION: UNCLASSIFIED
2
3
#ifndef WEBM_H
4
#define WEBM_H
5
/***************************************************************************/
6
/* RSC IDENTIFIER: Web Mercator
7
*
8
* ABSTRACT
9
*
10
* This component provides conversions between Geodetic coordinates
11
* (latitude and longitude) and Web Mercator coordinates
12
* (easting and northing).
13
*
14
* ERROR HANDLING
15
*
16
* This component checks parameters for valid values. If an invalid value
17
* is found the error code is combined with the current error code using
18
* the bitwise or. This combining allows multiple error codes to be
19
* returned. The possible error codes are:
20
*
21
* WEBM_NO_ERROR : No errors occurred in function
22
* WEBM_LAT_ERROR : Latitude outside of valid range
23
* (-33.5 to -48.5 degrees)
24
* WEBM_ELLIPSOID_ERROR : Invalid ellipsoid - must be WGS84
25
*
26
* REFERENCES
27
*
28
* Further information on Web Mercator can be found in the NGA document
29
* "Implementation Practice Web Mercator Map Projection", 2014-02-18.
30
*
31
* LICENSES
32
*
33
* None apply to this component.
34
*
35
* MODIFICATIONS
36
*
37
* Date Description
38
* ---- -----------
39
* 06-14-14 Original Code
40
*
41
*/
42
43
#include "
CoordinateSystem.h
"
44
45
namespace
MSP
46
{
47
namespace
CCS
48
{
49
class
EllipsoidParameters;
50
class
MapProjectionCoordinates;
51
class
GeodeticCoordinates;
52
53
/*
54
* DEFINES
55
*/
56
57
class
WebMercator
:
public
CoordinateSystem
58
{
59
public
:
60
61
/*
62
* The constructor receives the ellipsoid code and sets
63
* the corresponding state variables. If any errors occur,
64
* an exception is thrown with a description of the error.
65
*
66
* ellipsoidCode : 2-letter code for ellipsoid (input)
67
*/
68
69
WebMercator
(
char
* ellipsoidCode );
70
71
/*
72
* The function getParameters returns the current ellipsoid code.
73
*
74
* ellipsoidCode : 2-letter code for ellipsoid (output)
75
*/
76
77
EllipsoidParameters
*
getParameters
()
const
;
78
79
80
/*
81
* The function convertFromGeodetic converts geodetic (latitude and
82
* longitude) coordinates to Web Mercator projection
83
* (easting and northing) coordinates, according to the current
84
* ellipsoid.
85
* If any errors occur, an exception is thrown with a
86
* description of the error.
87
*
88
* longitude : Longitude (lambda), in radians (input)
89
* latitude : Latitude (phi), in radians (input)
90
* easting : Easting (X), in meters (output)
91
* northing : Northing (Y), in meters (output)
92
*/
93
94
MSP::CCS::MapProjectionCoordinates
*
convertFromGeodetic
(
95
MSP::CCS::GeodeticCoordinates
* geodeticCoordinates );
96
97
/*
98
* The function convertToGeodetic converts Web Mercator projection
99
* (easting and northing) coordinates to geodetic
100
* (latitude and longitude) coordinates.
101
* If any errors occur, an exception is thrown with a description
102
* of the error.
103
*
104
* easting : Easting (X), in meters (input)
105
* northing : Northing (Y), in meters (input)
106
* longitude : Longitude (lambda), in radians (output)
107
* latitude : Latitude (phi), in radians (output)
108
*/
109
110
MSP::CCS::GeodeticCoordinates
*
convertToGeodetic
(
111
MSP::CCS::MapProjectionCoordinates
* mapProjectionCoordinates );
112
113
private
:
114
115
/* Ellipsoid Parameters, must be WGS84 */
116
char
WebMEllipsoidCode[3];
117
118
};
119
}
120
}
121
122
#endif
123
124
125
// CLASSIFICATION: UNCLASSIFIED
Generated on Tue Feb 16 2016 14:54:02 for GeographicTranslator by doxygen 1.8.2