Skip to content

Commit d53c267

Browse files
daniel-j-hTheMarex
authored andcommitted
Be more aggresive classifying Roundabout Intersections.
Roundabout Intersections are roundabouts with up to four ways and turn angles which makes the turns obvious, e.g. as in: ``` * * * * * * * * ``` but not ``` * * * * * * * * * ``` For Roundabout Intersections we issue instructions such as "turn <direction>" instead of "take the <nth> exit". At the moment we have a limit on the radius for these Roundabout Intersections of 5 meters. Which fails to classify a wide range of Roundabout Intersections in the US (with the US-wide streets). This changeset removes the Roundabout Intersection radius limit: - if the roundabout is larger than a threshold and is named we classify it as a rotary - if the roundabout matches our criteria for Roundabout Intersections we classify it as a Roundabout Intersection - else fallback to plain old Roundabout There is a second issue with determining a roundabout's radius. But that's for another pull request (tracking in #2716). References: - #2716
1 parent 2f6de61 commit d53c267

File tree

8 files changed

+169
-219
lines changed

8 files changed

+169
-219
lines changed

features/guidance/anticipate-lanes.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ Feature: Turn Lane Guidance
477477
| gh | | primary | | gh |
478478

479479
When I route I should get
480-
| waypoints | route | turns | lanes |
480+
| waypoints | route | turns | lanes |
481481
| a,h | abx,bc,fg,gh,gh | depart,turn right,cdefc-exit-2,turn right,arrive | ,straight:false right:false right:false right:false right:true,,straight:false right:true, |
482482

483483
@anticipate @bug @todo

features/guidance/roundabout-bike.feature

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,6 @@ Feature: Basic Roundabout
55
Given the profile "bicycle"
66
Given a grid size of 10 meters
77

8-
Scenario: Enter and Exit
9-
Given the node map
10-
| | | a | | |
11-
| | | b | | |
12-
| h | g | | c | d |
13-
| | | e | | |
14-
| | | f | | |
15-
16-
And the ways
17-
| nodes | junction |
18-
| ab | |
19-
| cd | |
20-
| ef | |
21-
| gh | |
22-
| bgecb | roundabout |
23-
24-
When I route I should get
25-
| waypoints | route | turns |
26-
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
27-
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
28-
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
29-
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
30-
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
31-
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
32-
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
33-
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
34-
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
35-
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
36-
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
37-
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
38-
398
Scenario: Only Enter
409
Given the node map
4110
| | | a | | |
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@routing @guidance
2+
Feature: Basic Roundabout
3+
4+
Background:
5+
Given the profile "bicycle"
6+
Given a grid size of 10 meters
7+
8+
Scenario: Enter and Exit
9+
Given the node map
10+
| | | a | | |
11+
| | | b | | |
12+
| h | g | | c | d |
13+
| | | e | | |
14+
| | | f | | |
15+
16+
And the ways
17+
| nodes | junction |
18+
| ab | |
19+
| cd | |
20+
| ef | |
21+
| gh | |
22+
| bgecb | roundabout |
23+
24+
When I route I should get
25+
| waypoints | route | turns |
26+
| a,d | ab,cd,cd | depart,roundabout turn left exit-3,arrive |
27+
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
28+
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive |
29+
| d,f | cd,ef,ef | depart,roundabout turn left exit-3,arrive |
30+
| d,h | cd,gh,gh | depart,roundabout turn straight exit-2,arrive |
31+
| d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive |
32+
| f,h | ef,gh,gh | depart,roundabout turn left exit-3,arrive |
33+
| f,a | ef,ab,ab | depart,roundabout turn straight exit-2,arrive |
34+
| f,d | ef,cd,cd | depart,roundabout turn right exit-1,arrive |
35+
| h,a | gh,ab,ab | depart,roundabout turn left exit-3,arrive |
36+
| h,d | gh,cd,cd | depart,roundabout turn straight exit-2,arrive |
37+
| h,f | gh,ef,ef | depart,roundabout turn right exit-1,arrive |

features/guidance/roundabout-turn.feature

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,3 +389,105 @@ Feature: Basic Roundabout
389389
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive | 0->180,180->224,180->0 |
390390
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive | 0->180,180->224,270->0 |
391391

392+
Scenario: Enter and Exit - Bearings
393+
Given the node map
394+
| | | | a | | | |
395+
| | | | | | | |
396+
| | | i | b | l | | |
397+
| h | | g | | c | | d |
398+
| | | j | e | k | | |
399+
| | | | | | | |
400+
| | | | f | | | |
401+
402+
And the ways
403+
| nodes | junction |
404+
| ab | |
405+
| cd | |
406+
| ef | |
407+
| gh | |
408+
| bigjekclb | roundabout |
409+
410+
When I route I should get
411+
| waypoints | route | turns | bearing |
412+
| a,d | ab,cd,cd | depart,roundabout turn left exit-3,arrive | 0->180,180->270,90->0 |
413+
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive | 0->180,180->270,180->0 |
414+
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive | 0->180,180->270,270->0 |
415+
416+
Scenario: Large radius Roundabout Intersection and ways modelled out: East Mission St, North 7th St
417+
# http://www.openstreetmap.org/way/348812150
418+
# Note: grid size is 3 meter, this roundabout is more like 5-10 meters in radius
419+
Given the node map
420+
| | | | a | | | | | |
421+
| | | | | | | | | |
422+
| | | | b | | n | | | |
423+
| | | | | | | | | |
424+
| | | c | | | | m | | |
425+
| | | | | | | | | |
426+
| e | | d | | | | k | | l |
427+
| | | | | | | | | |
428+
| | | f | | | | j | | |
429+
| | | | | | | | | |
430+
| | | | g | | i | | | |
431+
| | | | | | | | | |
432+
| | | | h | | | | | |
433+
434+
And the ways
435+
| nodes | junction | highway | name |
436+
| ab | | tertiary | North 7th St |
437+
| ed | | tertiary | East Mission St |
438+
| hg | | tertiary | North 7th St |
439+
| lk | | tertiary | East Mission St |
440+
| bcdfgijkmnb | roundabout | tertiary | Roundabout |
441+
442+
When I route I should get
443+
| waypoints | route | turns |
444+
| a,e | North 7th St,East Mission St,East Mission St | depart,roundabout turn right exit-1,arrive |
445+
| a,h | North 7th St,North 7th St,North 7th St | depart,roundabout turn straight exit-2,arrive |
446+
| a,l | North 7th St,East Mission St,East Mission St | depart,roundabout turn left exit-3,arrive |
447+
| h,l | North 7th St,East Mission St,East Mission St | depart,roundabout turn right exit-1,arrive |
448+
| h,a | North 7th St,North 7th St,North 7th St | depart,roundabout turn straight exit-2,arrive |
449+
| h,e | North 7th St,East Mission St,East Mission St | depart,roundabout turn left exit-3,arrive |
450+
| e,h | East Mission St,North 7th St,North 7th St | depart,roundabout turn right exit-1,arrive |
451+
| e,l | East Mission St,East Mission St,East Mission St | depart,roundabout turn straight exit-2,arrive |
452+
| e,a | East Mission St,North 7th St,North 7th St | depart,roundabout turn left exit-3,arrive |
453+
| l,a | East Mission St,North 7th St,North 7th St | depart,roundabout turn right exit-1,arrive |
454+
| l,e | East Mission St,East Mission St,East Mission St | depart,roundabout turn straight exit-2,arrive |
455+
| l,h | East Mission St,North 7th St,North 7th St | depart,roundabout turn left exit-3,arrive |
456+
457+
Scenario: Enter and Exit - Traffic Signals
458+
Given the node map
459+
| | | a | | |
460+
| | i | b | l | |
461+
| h | g | | c | d |
462+
| | j | e | k | |
463+
| | | f | | |
464+
465+
And the nodes
466+
| node | highway |
467+
| i | traffic_signals |
468+
| j | traffic_signals |
469+
| k | traffic_signals |
470+
| l | traffic_signals |
471+
472+
And the ways
473+
| nodes | junction |
474+
| ab | |
475+
| cd | |
476+
| ef | |
477+
| gh | |
478+
| bigjekclb | roundabout |
479+
480+
When I route I should get
481+
| waypoints | route | turns |
482+
| a,d | ab,cd,cd | depart,roundabout turn left exit-3,arrive |
483+
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
484+
| a,h | ab,gh,gh | depart,roundabout turn right exit-1,arrive |
485+
| d,f | cd,ef,ef | depart,roundabout turn left exit-3,arrive |
486+
| d,h | cd,gh,gh | depart,roundabout turn straight exit-2,arrive |
487+
| d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive |
488+
| f,h | ef,gh,gh | depart,roundabout turn left exit-3,arrive |
489+
| f,a | ef,ab,ab | depart,roundabout turn straight exit-2,arrive |
490+
| f,d | ef,cd,cd | depart,roundabout turn right exit-1,arrive |
491+
| h,a | gh,ab,ab | depart,roundabout turn left exit-3,arrive |
492+
| h,d | gh,cd,cd | depart,roundabout turn straight exit-2,arrive |
493+
| h,f | gh,ef,ef | depart,roundabout turn right exit-1,arrive |

features/guidance/roundabout.feature

Lines changed: 0 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,6 @@ Feature: Basic Roundabout
55
Given the profile "car"
66
Given a grid size of 10 meters
77

8-
Scenario: Enter and Exit
9-
Given the node map
10-
| | | a | | |
11-
| | | b | | |
12-
| h | g | | c | d |
13-
| | | e | | |
14-
| | | f | | |
15-
16-
And the ways
17-
| nodes | junction |
18-
| ab | |
19-
| cd | |
20-
| ef | |
21-
| gh | |
22-
| bgecb | roundabout |
23-
24-
When I route I should get
25-
| waypoints | route | turns |
26-
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
27-
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
28-
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
29-
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
30-
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
31-
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
32-
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
33-
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
34-
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
35-
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
36-
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
37-
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
38-
398
Scenario: Only Enter
409
Given the node map
4110
| | | a | | |
@@ -280,87 +249,6 @@ Feature: Basic Roundabout
280249
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
281250
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
282251

283-
Scenario: Collinear in X,Y
284-
Given the node map
285-
| a | | |
286-
| b | | |
287-
| c | d | f |
288-
| e | | |
289-
290-
And the ways
291-
| nodes | junction |
292-
| ab | |
293-
| bcdb | roundabout |
294-
| ce | |
295-
| df | |
296-
297-
When I route I should get
298-
| waypoints | route | turns |
299-
| a,e | ab,ce,ce | depart,roundabout-exit-1,arrive |
300-
| a,f | ab,df,df | depart,roundabout-exit-2,arrive |
301-
302-
Scenario: Collinear in X,Y
303-
Given the node map
304-
| a | | |
305-
| d | | |
306-
| b | c | f |
307-
| e | | |
308-
309-
And the ways
310-
| nodes | junction |
311-
| ad | |
312-
| bcdb | roundabout |
313-
| be | |
314-
| cf | |
315-
316-
When I route I should get
317-
| waypoints | route | turns |
318-
| a,e | ad,be,be | depart,roundabout-exit-1,arrive |
319-
| a,f | ad,cf,cf | depart,roundabout-exit-2,arrive |
320-
321-
Scenario: Collinear in X,Y
322-
Given the node map
323-
| a | | |
324-
| c | | |
325-
| d | b | f |
326-
| e | | |
327-
328-
And the ways
329-
| nodes | junction |
330-
| ac | |
331-
| bcdb | roundabout |
332-
| de | |
333-
| bf | |
334-
335-
When I route I should get
336-
| waypoints | route | turns |
337-
| a,e | ac,de,de | depart,roundabout-exit-1,arrive |
338-
| a,f | ac,bf,bf | depart,roundabout-exit-2,arrive |
339-
340-
Scenario: Enter and Exit - Bearings
341-
Given the node map
342-
| | | | a | | | |
343-
| | | | | | | |
344-
| | | i | b | l | | |
345-
| h | | g | | c | | d |
346-
| | | j | e | k | | |
347-
| | | | | | | |
348-
| | | | f | | | |
349-
350-
And the ways
351-
| nodes | junction |
352-
| ab | |
353-
| cd | |
354-
| ef | |
355-
| gh | |
356-
| bigjekclb | roundabout |
357-
358-
When I route I should get
359-
| waypoints | route | turns | bearing |
360-
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive | 0->180,180->270,90->0 |
361-
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive | 0->180,180->270,180->0 |
362-
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive | 0->180,180->270,270->0 |
363-
364252
Scenario: Motorway Roundabout
365253
#See 39.933742 -75.082345
366254
Given the node map
@@ -437,42 +325,3 @@ Feature: Basic Roundabout
437325
When I route I should get
438326
| waypoints | route | turns |
439327
| a,k | massachusetts,massachusetts,massachusetts,massachusetts | depart,sheridan circle-exit-2,dupont circle-exit-1,arrive |
440-
441-
Scenario: Enter and Exit - Traffic Signals
442-
Given the node map
443-
| | | a | | |
444-
| | i | b | l | |
445-
| h | g | | c | d |
446-
| | j | e | k | |
447-
| | | f | | |
448-
449-
And the nodes
450-
| node | highway |
451-
| i | traffic_signals |
452-
| j | traffic_signals |
453-
| k | traffic_signals |
454-
| l | traffic_signals |
455-
456-
And the ways
457-
| nodes | junction |
458-
| ab | |
459-
| cd | |
460-
| ef | |
461-
| gh | |
462-
| bigjekclb | roundabout |
463-
464-
When I route I should get
465-
| waypoints | route | turns |
466-
| a,d | ab,cd,cd | depart,roundabout-exit-3,arrive |
467-
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
468-
| a,h | ab,gh,gh | depart,roundabout-exit-1,arrive |
469-
| d,f | cd,ef,ef | depart,roundabout-exit-3,arrive |
470-
| d,h | cd,gh,gh | depart,roundabout-exit-2,arrive |
471-
| d,a | cd,ab,ab | depart,roundabout-exit-1,arrive |
472-
| f,h | ef,gh,gh | depart,roundabout-exit-3,arrive |
473-
| f,a | ef,ab,ab | depart,roundabout-exit-2,arrive |
474-
| f,d | ef,cd,cd | depart,roundabout-exit-1,arrive |
475-
| h,a | gh,ab,ab | depart,roundabout-exit-3,arrive |
476-
| h,d | gh,cd,cd | depart,roundabout-exit-2,arrive |
477-
| h,f | gh,ef,ef | depart,roundabout-exit-1,arrive |
478-

features/testbot/side_bias.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ Feature: Testbot - side bias
5353
| bcegb | roundabout |
5454

5555
When I route I should get
56-
| waypoints | route | turns |
57-
| a,d | ab,cd,cd | depart,roundabout-exit-1,arrive |
58-
| a,f | ab,ef,ef | depart,roundabout-exit-2,arrive |
59-
| a,h | ab,gh,gh | depart,roundabout-exit-3,arrive |
56+
| waypoints | route | turns |
57+
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
58+
| a,f | ab,ef,ef | depart,roundabout turn straight exit-2,arrive |
59+
| a,h | ab,gh,gh | depart,roundabout turn right exit-3,arrive |
6060

6161
Scenario: Mixed Entry and Exit
6262
Given the profile "lhs"

include/extractor/guidance/constants.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ const double constexpr GROUP_ANGLE = 60;
2121
const double constexpr FUZZY_ANGLE_DIFFERENCE = 25.;
2222
const double constexpr DISTINCTION_RATIO = 2;
2323

24-
const double constexpr MAX_ROUNDABOUT_INTERSECTION_RADIUS = 5;
25-
const double constexpr MAX_ROUNDABOUT_RADIUS = 15; // 30 m diameter as final distinction
24+
// Named roundabouts with radii larger then than this are seen as rotary
25+
const double constexpr MAX_ROUNDABOUT_RADIUS = 15;
26+
// Unnamed small roundabouts that look like intersections are announced as turns,
27+
// guard against data issues or such roundabout intersections getting too large.
28+
const double constexpr MAX_ROUNDABOUT_INTERSECTION_RADIUS = 25;
29+
2630
const double constexpr INCREASES_BY_FOURTY_PERCENT = 1.4;
2731

2832
const int constexpr MAX_SLIPROAD_THRESHOLD = 250;

0 commit comments

Comments
 (0)