fix false positives in sliproads

This commit is contained in:
Moritz Kobitzsch
2016-09-13 13:17:18 +02:00
parent 64a72f574d
commit 092e77e89b
3 changed files with 65 additions and 1 deletions
+15 -1
View File
@@ -139,7 +139,6 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection)
return intersection;
const auto source_edge_data = node_based_graph.GetEdgeData(source_edge_id);
// check whether the continue road is valid
const auto check_valid = [this, source_edge_data](const ConnectedRoad &road) {
const auto road_edge_data = node_based_graph.GetEdgeData(road.turn.eid);
@@ -192,6 +191,21 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection)
return intersection;
}(intersection_node_id);
const auto link_data = node_based_graph.GetEdgeData(road.turn.eid);
// Check if the road continues here
const bool is_through_street =
target_intersection.end() !=
std::find_if(target_intersection.begin() + 1,
target_intersection.end(),
[this, &link_data](const ConnectedRoad &road) {
return node_based_graph.GetEdgeData(road.turn.eid).name_id ==
link_data.name_id;
});
// if the sliproad candidate is a through street, we cannot handle it as a sliproad
if (is_through_street)
continue;
for (const auto &candidate_road : target_intersection)
{
const auto &candidate_data = node_based_graph.GetEdgeData(candidate_road.turn.eid);