forked from Tristramg/osm4routing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse.i
67 lines (56 loc) · 1.15 KB
/
parse.i
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
%module osm4routing_xml
%include "std_vector.i"
%include "std_string.i"
%{
#include "parse.h"
%}
%template(Nodes) std::vector<Node>;
%template(Edges) std::vector<Edge>;
class Edge_property
{
public:
int car_direct;
int car_reverse;
int bike_direct;
int bike_reverse;
int foot;
Edge_property();
// Can at least one mean use that edge
bool accessible();
bool direct_accessible();
bool reverse_accessible();
// Update the properties given new information
bool update(const std::string & tag, const std::string & val);
// Infer unknown data
void normalize();
void reset();
};
struct Edge
{
unsigned long long edge_id;
unsigned long long source;
unsigned long long target;
float length;
char car;
char car_d;
char bike;
char bike_d;
char foot;
std::string geom;
};
struct Node
{
unsigned long id;
double lon;
double lat;
char uses;
};
struct Parser
{
Parser();
void read(char *, int, bool);
std::vector<Node> get_nodes() const;
std::vector<Edge> get_edges() const;
int get_osm_nodes() const;
int get_osm_ways() const;
};