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
| 165 | // e=f | d,e,g |
| 166 | // e=j | d,e,i |
| 167 | oe::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 |
no test coverage detected