make circular detection covered again

This commit is contained in:
Moritz Kobitzsch 2017-10-23 05:31:10 +02:00 committed by Michael Krasnyk
parent 704cf314d4
commit 910ee0829f
2 changed files with 17 additions and 25 deletions

View File

@ -529,24 +529,21 @@ Feature: Merge Segregated Roads
Given a grid size of 2 meters Given a grid size of 2 meters
Given the node map Given the node map
""" """
i i
/ b `
/ ` ` p .
/ a ` g` ` \ f
b---- g . \ / o /
/ p . \ / \ /
a / \ f h - - c n /
\ / o / \ \/
\ / \ / k e
c n / \ /
/ \ \/ l /
/ k e
/ \ /
h l /
\ / \ /
m . d m . d
/ /
j j
""" """
And the ways And the ways
@ -560,8 +557,8 @@ Feature: Merge Segregated Roads
| jd | Hubertusallee | yes | | jd | Hubertusallee | yes |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| i,h | Kurfürstendamm,Hubertusallee,Hubertusallee | depart,turn straight,arrive | | i,h | Kurfürstendamm,Rathenauplatz,Hubertusallee,Hubertusallee | depart,turn right,turn right,arrive |
# https://www.openstreetmap.org/#map=19/52.46339/13.40272 # https://www.openstreetmap.org/#map=19/52.46339/13.40272
Scenario: Do not merge links between segregated roads Scenario: Do not merge links between segregated roads

View File

@ -109,13 +109,8 @@ bool MergableRoadDetector::CanMergeRoad(const NodeID intersection_node,
return true; return true;
// finally check if two roads describe the direction // finally check if two roads describe the direction
if (HaveSameDirection(intersection_node, lhs, rhs)) return HaveSameDirection(intersection_node, lhs, rhs) &&
{ !IsCircularShape(intersection_node, lhs, rhs);
// do not merge traffic circles and similar
return !IsCircularShape(intersection_node, lhs, rhs);
}
else
return false;
} }
bool MergableRoadDetector::HaveIdenticalNames(const NameID lhs, const NameID rhs) const bool MergableRoadDetector::HaveIdenticalNames(const NameID lhs, const NameID rhs) const