Line 8... |
Line 8... |
8 |
* Package: |
8 |
* Package: |
9 |
* Status: Experimental |
9 |
* Status: Experimental |
10 |
* @doc |
10 |
* @doc |
11 |
* |
11 |
* |
12 |
************************************************************************/ |
12 |
************************************************************************/ |
13 |
#pragma once |
- |
|
14 |
|
13 |
|
15 |
//======================================================================= |
14 |
//======================================================================= |
16 |
/** |
15 |
/** |
17 |
* UTM support goes here |
16 |
* UTM support goes here |
18 |
*/ |
17 |
*/ |
19 |
//======================================================================= |
18 |
//======================================================================= |
20 |
class CUtmPoint |
- |
|
21 |
{ |
- |
|
22 |
protected: |
- |
|
23 |
double m_easting; |
- |
|
24 |
double m_northing; |
- |
|
25 |
int m_xzone; |
- |
|
26 |
char m_yzone; |
- |
|
27 |
public: |
- |
|
28 |
|
- |
|
29 |
//======================================================================= |
- |
|
30 |
//======================================================================= |
- |
|
31 |
CUtmPoint() |
- |
|
32 |
{Clear();} |
- |
|
33 |
|
- |
|
34 |
//======================================================================= |
- |
|
35 |
//======================================================================= |
- |
|
36 |
CUtmPoint(const CPosition &p) |
- |
|
37 |
{ |
- |
|
38 |
FromPosition(p); |
- |
|
39 |
} |
- |
|
40 |
|
- |
|
41 |
//======================================================================= |
- |
|
42 |
//======================================================================= |
- |
|
43 |
CUtmPoint(const CUtmPoint& that) |
- |
|
44 |
{ |
- |
|
45 |
m_easting=that.m_easting; |
- |
|
46 |
m_northing=that.m_northing; |
- |
|
47 |
m_xzone=that.m_xzone; |
- |
|
48 |
m_yzone=that.m_yzone; |
- |
|
49 |
} |
- |
|
50 |
|
- |
|
51 |
//======================================================================= |
- |
|
52 |
//======================================================================= |
- |
|
53 |
void Clear() |
- |
|
54 |
{ |
- |
|
55 |
m_easting=m_northing=0; |
- |
|
56 |
m_xzone=0; |
- |
|
57 |
m_yzone=0; |
- |
|
58 |
} |
- |
|
59 |
|
- |
|
60 |
//======================================================================= |
- |
|
61 |
/** |
- |
|
62 |
@func Build a position string |
- |
|
63 |
@parm target. must be 30 characters or longer. |
- |
|
64 |
*/ |
- |
|
65 |
//======================================================================= |
- |
|
66 |
|
- |
|
67 |
void GetString(TCHAR *position) const; |
- |
|
68 |
|
- |
|
69 |
//======================================================================= |
- |
|
70 |
/** |
- |
|
71 |
@func get the position of a UTM point |
- |
|
72 |
@parm point out |
- |
|
73 |
*/ |
- |
|
74 |
//======================================================================= |
- |
|
75 |
|
- |
|
76 |
void ToPosition(CPosition &pos) const; |
19 |
void LatLonToUtmWGS84 (int* utmXZone, char* utmYZone, |
77 |
|
- |
|
78 |
//======================================================================= |
- |
|
79 |
/** |
- |
|
80 |
@func turn a position into a UTM point |
- |
|
81 |
@parm position |
- |
|
82 |
@rdesc true if it was in range |
- |
|
83 |
*/ |
- |
|
84 |
//======================================================================= |
- |
|
85 |
|
- |
|
86 |
bool FromPosition(const CPosition &pos); |
- |
|
87 |
|
- |
|
88 |
//======================================================================= |
- |
|
89 |
/** |
- |
|
90 |
range test |
- |
|
91 |
*/ |
- |
|
92 |
//======================================================================= |
- |
|
93 |
|
- |
|
94 |
static bool IsPositionInUtmSpace(const CPosition &pos) |
- |
|
95 |
{ return pos.GetLatitude()<=84 && pos.GetLatitude()>=-80;} |
20 |
double* easting, double* northing, double lat, double lon); |
96 |
|
- |
|
97 |
|
- |
|
98 |
|
- |
|
99 |
}; |
- |
|
100 |
|
- |
|
101 |
|
- |
|
102 |
|
21 |
|