-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgpx.h
79 lines (62 loc) · 1.59 KB
/
gpx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef _GPX_H_
#define _GPX_H_
struct gpx_latlon
{
double lat, lon;
};
struct gpx_segment;
struct gpx_point;
struct gpx_data
{
char *path;
char time[24];
struct { struct gpx_segment *head, **tail; } segments;
struct { struct gpx_point *head, **tail; } wpts;
int points_cnt, track_cnt;
};
struct gpx_segment
{
struct gpx_segment *next;
const char *src;
unsigned free_src:1;
struct { struct gpx_point *head, **tail; } points;
};
#define GPX_PT_LATLON (1 << 0)
#define GPX_PT_ELE (1 << 1)
#define GPX_PT_COURSE (1 << 2)
#define GPX_PT_SPEED (1 << 3)
#define GPX_PT_HDOP (1 << 4)
#define GPX_PT_VDOP (1 << 5)
#define GPX_PT_PDOP (1 << 6)
#define GPX_PT_SAT (1 << 7)
#define GPX_PT_TIME (1 << 8)
struct gpx_point
{
struct gpx_point *next;
unsigned flags;
struct gpx_latlon loc;
double speed;
int sat;
float ele, geoidheight;
float course;
float hdop, vdop, pdop;
char time[24];
// struct gpx_data *container;
// struct gpx_segment *seg;
// struct gpx_track *trk;
//int trk, seg;
};
extern const char GPX_SRC_GPS[];
extern const char GPX_SRC_NETWORK[];
extern const char GPX_SRC_WAYPOINT[];
extern const char GPX_SRC_UNKNOWN[];
struct gpx_point *new_trk_point(void);
void free_trk_point(struct gpx_point *);
void put_trk_point(struct gpx_segment *, struct gpx_point *);
struct gpx_segment *new_trk_segment(const char *src);
void free_trk_segment(struct gpx_segment *);
void put_trk_segment(struct gpx_data *, struct gpx_segment *);
struct gpx_data *gpx_read_file(const char *path);
void gpx_free(struct gpx_data *);
void gpx_libxml_cleanup(void);
#endif /* _GPX_H_ */