MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / loadGraph

Function loadGraph

src/tools/components.cpp:33–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31using TarjanEdge = util::static_graph_details::SortableEdgeWithData<void>;
32
33std::size_t loadGraph(const std::string &path,
34 std::vector<util::Coordinate> &coordinate_list,
35 extractor::PackedOSMIDs &osm_node_ids,
36 std::vector<TarjanEdge> &graph_edge_list)
37{
38 std::vector<extractor::NodeBasedEdge> edge_list;
39
40 extractor::files::readRawNBGraph(path, coordinate_list, osm_node_ids, edge_list);
41
42 // Building a node-based graph
43 for (const auto &input_edge : edge_list)
44 {
45 if (input_edge.source == input_edge.target)
46 {
47 continue;
48 }
49
50 if (input_edge.flags.forward)
51 {
52 graph_edge_list.emplace_back(input_edge.source, input_edge.target);
53 }
54
55 if (input_edge.flags.backward)
56 {
57 graph_edge_list.emplace_back(input_edge.target, input_edge.source);
58 }
59 }
60
61 return osm_node_ids.size();
62}
63
64struct FeatureWriter
65{

Callers 1

mainFunction · 0.85

Calls 3

readRawNBGraphFunction · 0.85
emplace_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected