Fast map matching
0.1.0
|
A graph containing dummy nodes and edges used in map matching. More...
#include <composite_graph.hpp>
Public Member Functions | |
DummyGraph () | |
Default constructor of dummy graph. | |
DummyGraph (const Traj_Candidates &traj_candidates) | |
Constructor of dummy graph from trajectory candidates. More... | |
NETWORK::Graph_T * | get_graph_ptr () |
Get the inner graph data. More... | |
const NETWORK::Graph_T & | get_boost_graph () const |
Get a const reference to the inner graph data. More... | |
int | get_num_vertices () const |
Get the number of vertices in the dummy graph. | |
bool | containNodeIndex (NETWORK::NodeIndex external_index) const |
Check if a node is contained in the dummy graph. More... | |
NETWORK::NodeIndex | get_external_index (DummyIndex inner_index) const |
Get the NodeIndex of a node according to the inner index of the dummy graph. More... | |
DummyIndex | get_internal_index (NETWORK::NodeIndex external_index) const |
Get the internal index of a node in dummy graph If the node is not contained in the dummy graph, an exception will be thrown. More... | |
int | get_edge_index (NETWORK::NodeIndex source, NETWORK::NodeIndex target, double cost) const |
Get the edge index in the original network graph. More... | |
void | print_node_index_map () const |
Print the mapping from dummy index to node index. | |
Protected Member Functions | |
void | add_edge (NETWORK::NodeIndex source, NETWORK::NodeIndex target, NETWORK::EdgeIndex edge_index, double cost) |
Add an edge to the dummy graph. More... | |
A graph containing dummy nodes and edges used in map matching.
It connects candidate node (dummy node) matched to GPS observations with the nodes in the original road network. The connected edges are dummy edges.
Definition at line 31 of file composite_graph.hpp.
DummyGraph::DummyGraph | ( | const Traj_Candidates & | traj_candidates | ) |
Constructor of dummy graph from trajectory candidates.
Each candidate will be connected with two end nodes of the matched edge.
traj_candidates | input information |
Definition at line 11 of file composite_graph.cpp.
|
protected |
Add an edge to the dummy graph.
source | source node index |
target | target node index |
edge_index | Edge index. It will be the same edge index where the dummy edge is located. |
cost | cost of the edge |
Definition at line 94 of file composite_graph.cpp.
bool DummyGraph::containNodeIndex | ( | NETWORK::NodeIndex | external_index | ) | const |
Check if a node is contained in the dummy graph.
A node is contained in the dummy graph if (a) it is a dummy node representing a candidate or (b) it is the end node of a matched candidate edge.
external_index | The NodeIndex of a node |
Definition at line 52 of file composite_graph.cpp.
const Graph_T & DummyGraph::get_boost_graph | ( | ) | const |
Get a const reference to the inner graph data.
Definition at line 44 of file composite_graph.cpp.
int DummyGraph::get_edge_index | ( | NETWORK::NodeIndex | source, |
NETWORK::NodeIndex | target, | ||
double | cost | ||
) | const |
Get the edge index in the original network graph.
source | source NodeIndex in the original network graph |
target | target NodeIndex in the original network graph |
cost | Cost value of the edge |
Definition at line 64 of file composite_graph.cpp.
NodeIndex DummyGraph::get_external_index | ( | DummyIndex | inner_index | ) | const |
Get the NodeIndex of a node according to the inner index of the dummy graph.
inner_index | an inner index of the dummy graph |
Definition at line 56 of file composite_graph.cpp.
Graph_T * DummyGraph::get_graph_ptr | ( | ) |
Get the inner graph data.
Definition at line 40 of file composite_graph.cpp.
DummyIndex DummyGraph::get_internal_index | ( | NETWORK::NodeIndex | external_index | ) | const |
Get the internal index of a node in dummy graph If the node is not contained in the dummy graph, an exception will be thrown.
Call the containNodeIndex before invoking this function.
external_index | The node index in original network graph |
Definition at line 60 of file composite_graph.cpp.