-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodes.h
67 lines (55 loc) · 1.45 KB
/
nodes.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
/*nodes.h*/
//
// A collection of nodes in the Open Street Map.
//
// References:
//
// TinyXML:
// files: https://github.com/leethomason/tinyxml2
// docs: http://leethomason.github.io/tinyxml2/
//
// OpenStreetMap: https://www.openstreetmap.org
// OpenStreetMap docs:
// https://wiki.openstreetmap.org/wiki/Main_Page
// https://wiki.openstreetmap.org/wiki/Map_Features
// https://wiki.openstreetmap.org/wiki/Node
// https://wiki.openstreetmap.org/wiki/Way
// https://wiki.openstreetmap.org/wiki/Relation
//
#pragma once
#include <map>
#include "node.h"
#include "tinyxml2.h"
using namespace std;
using namespace tinyxml2;
//
// Keeps track of all the nodes in the map.
//
class Nodes
{
private:
map<long long, Node> MapNodes;
public:
//
// readMapNodes
//
// Given an XML document, reads through the document and
// stores all the nodes into the given vector. Each node
// is a point on the map, with a unique id along with
// (lat, lon) position. Some nodes are entrances to buildings,
// which we capture as well.
//
void readMapNodes(XMLDocument &xmldoc);
//
// find
//
// Searches the nodes for the one with the matching ID, returning
// true if found and false if not. If found, the node's Lat, Lon,
// and IsEntrance data are returned via the reference parameters.
//
bool find(long long id, double& lat, double& lon, bool& isEntrance) const;
//
// accessors / getters
//
int getNumMapNodes();
};