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

Function find_via_node_path

src/extractor/extraction_containers.cpp:167–184  ·  view source on GitHub ↗

Via-node paths describe a relation between the two segments closest to the shared via-node on the from and to ways. from: [a, b, c, d, e] to: [f, g, h, i, j] The via node establishes the orientation of the from/to intersection when choosing the segments. via | node path a=f | b,a,g a=j | b,a,i e=f | d,e,g e=j | d,e,i

Source from the content-addressed store, hash-verified

165// e=f | d,e,g
166// e=j | d,e,i
167oe::ViaNodePath find_via_node_path(const std::string &turn_relation_type,
168 const oe::NodesOfWay &from_segment,
169 const oe::NodesOfWay &to_segment,
170 const OSMNodeID via_node,
171 const std::function<NodeID(OSMNodeID)> &to_internal_node)
172{
173
174 OSMNodeID from, via, to;
175 std::tie(from, via, to) = find_turn_nodes(from_segment, to_segment, via_node);
176 if (via == SPECIAL_OSM_NODEID)
177 {
178 // unconnected
179 osrm::util::Log(logDEBUG) << turn_relation_type
180 << " references unconnected way: " << from_segment.way_id;
181 return oe::ViaNodePath{SPECIAL_NODEID, SPECIAL_NODEID, SPECIAL_NODEID};
182 }
183 return oe::ViaNodePath{to_internal_node(from), to_internal_node(via), to_internal_node(to)};
184}
185
186// Via way paths are comprised of:
187// 1. The segment in the from way that intersects with the via ways

Callers 1

Calls 2

find_turn_nodesFunction · 0.85
LogClass · 0.85

Tested by

no test coverage detected