Skip to content

Commit 480287d

Browse files
committed
Support snapping to multiple ways at an input location
This PR improves routing results by adding support for snapping to multiple ways at input locations. This means all edges at the snapped location can act as source/target candidates for routing search, ensuring we always find the best route, and not the one dependent on the edge selected.
1 parent 869b3fa commit 480287d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2798
-1942
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
- CHANGED: Lazily generate optional route path data [#6045](https://github.com/Project-OSRM/osrm-backend/pull/6045)
4444
- FIXED: Completed support for no_entry and no_exit turn restrictions. [#5988](https://github.com/Project-OSRM/osrm-backend/pull/5988)
4545
- ADDED: Add support for non-round-trips with a single fixed endpoint. [#6050](https://github.com/Project-OSRM/osrm-backend/pull/6050)
46+
- ADDED: Support snapping to multiple ways at an input location. [#5953](https://github.com/Project-OSRM/osrm-backend/pull/5953)
4647

4748
# 5.26.0
4849
- Changes from 5.25.0

features/bicycle/alley.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Feature: Bicycle - Route around alleys
2828

2929
When I route I should get
3030
| from | to | a:nodes | weight | # |
31-
| a | f | 1:2:3:6 | 200.4 | Avoids d,e,f |
32-
| a | e | 1:2:5 | 176.4 | Take the alley b,e if neccessary |
33-
| d | f | 4:1:2:3:6 | 252.6 | Avoids the alley d,e,f |
31+
| a | f | 1:2:3:6 | 196.2 | Avoids d,e,f |
32+
| a | e | 1:2:5 | 172.2 | Take the alley b,e if neccessary |
33+
| d | f | 4:1:2:3:6 | 248.4 | Avoids the alley d,e,f |
3434

features/car/destination.feature

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Feature: Car - Destination only, no passing through
77
Scenario: Car - Destination only street
88
Given the node map
99
"""
10-
a e
11-
b c d
10+
a e
11+
b1 c 2d
1212
13-
x y
13+
x y
1414
"""
1515

1616
And the ways
@@ -23,21 +23,21 @@ Feature: Car - Destination only, no passing through
2323
When I route I should get
2424
| from | to | route |
2525
| a | b | ab,ab |
26-
| a | c | ab,bcd |
27-
| a | d | ab,bcd,bcd |
26+
| a | c | ab,bcd,bcd |
27+
| a | 2 | ab,bcd,bcd |
2828
| a | e | axye,axye |
2929
| e | d | de,de |
30-
| e | c | de,bcd |
31-
| e | b | de,bcd,bcd |
30+
| e | c | de,bcd,bcd |
31+
| e | 1 | de,bcd,bcd |
3232
| e | a | axye,axye |
3333

3434
Scenario: Car - Destination only street
3535
Given the node map
3636
"""
37-
a e
38-
b c d
37+
a e
38+
b1 c 2d
3939
40-
x y
40+
x y
4141
"""
4242

4343
And the ways
@@ -51,12 +51,12 @@ Feature: Car - Destination only, no passing through
5151
When I route I should get
5252
| from | to | route |
5353
| a | b | ab,ab |
54-
| a | c | ab,bc |
55-
| a | d | ab,cd |
54+
| a | c | ab,bc,bc |
55+
| a | 2 | ab,bc,cd |
5656
| a | e | axye,axye |
5757
| e | d | de,de |
58-
| e | c | de,cd |
59-
| e | b | de,bc |
58+
| e | c | de,cd,cd |
59+
| e | 1 | de,cd,bc |
6060
| e | a | axye,axye |
6161

6262
Scenario: Car - Routing inside a destination only area
@@ -117,6 +117,7 @@ Feature: Car - Destination only, no passing through
117117
+ \
118118
+ |
119119
d |
120+
1 |
120121
\___e
121122
"""
122123

@@ -129,7 +130,7 @@ Feature: Car - Destination only, no passing through
129130
When I route I should get
130131
| from | to | route |
131132
| e | a | acbe,acbe |
132-
| d | a | de,acbe,acbe |
133+
| 1 | a | de,acbe,acbe |
133134
| c | d | cd,cd |
134135

135136
Scenario: Car - Routing through a parking lot tagged access=destination,service

features/car/restrictions.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ Feature: Car - Turn restrictions
411411
y
412412
i j f b x a e g h
413413
414-
c d
414+
c1 d
415415
"""
416416

417417
And the ways
@@ -438,7 +438,7 @@ Feature: Car - Turn restrictions
438438
When I route I should get
439439
| from | to | route |
440440
| e | f | ae,xa,bx,fb,fb |
441-
| c | f | dc,da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
441+
| 1 | f | dc,da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
442442
| d | f | da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
443443

444444
@except

features/guidance/merge-segregated-roads.feature

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,11 @@ Feature: Merge Segregated Roads
332332
|
333333
.b.
334334
c h
335+
1 |
336+
| 4
335337
| |
336-
| |
337-
1 2
338-
| |
338+
2 |
339+
| 3
339340
d g
340341
'e'
341342
|
@@ -354,13 +355,13 @@ Feature: Merge Segregated Roads
354355
| hb | road | yes |
355356

356357
When I route I should get
357-
| waypoints | turns | route | intersections |
358+
| waypoints | turns | route | intersections |
358359
| a,f | depart,arrive | road,road | true:180,false:0 true:180,false:0 true:180;true:0 |
359-
| c,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
360360
| 1,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
361+
| 2,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
361362
| f,a | depart,arrive | road,road | true:0,true:0 false:180,true:0 false:180;true:180 |
362-
| g,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
363-
| 2,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
363+
| 3,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
364+
| 4,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
364365

365366
@negative
366367
Scenario: Traffic Circle

features/testbot/bearing.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ Feature: Compass bearing
6767
Scenario: Bearing in a roundabout
6868
Given the node map
6969
"""
70-
k d c j
71-
e b
72-
f a
73-
l g h i
70+
k d 1c j
71+
e b
72+
f a
73+
l g2 h i
7474
"""
7575

7676
And the ways
@@ -94,8 +94,8 @@ Feature: Compass bearing
9494

9595
When I route I should get
9696
| from | to | route | bearing |
97-
| c | b | cd,de,ef,fg,gh,ha,ab,ab | 0->270,270->225,225->180,180->135,135->90,90->45,45->0,0->0 |
98-
| g | f | gh,ha,ab,bc,cd,de,ef,ef | 0->90,90->45,45->0,0->315,315->270,270->225,225->180,180->0 |
97+
| 1 | b | cd,de,ef,fg,gh,ha,ab,ab | 0->270,270->225,225->180,180->135,135->90,90->45,45->0,0->0 |
98+
| 2 | f | gh,ha,ab,bc,cd,de,ef,ef | 0->90,90->45,45->0,0->315,315->270,270->225,225->180,180->0 |
9999

100100
Scenario: Bearing should stay constant when zig-zagging
101101
Given the node map

features/testbot/distance_matrix.feature

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,12 @@ Feature: Basic Distance Matrix
589589

590590
When I request a travel distance matrix I should get
591591
| | a | b | c | d | e | f |
592-
| a | 0 | 100 | 300 | 650 | 1934.5 | 1534.6 |
593-
| b | 760.6 | 0 | 200 | 550.1 | 1834.6 | 1434.6 |
594-
| c | 560.6 | 660.5 | 0 | 350 | 1634.6 | 1234.6 |
595-
| d | 1484.6 | 1584.5| 1784.5 | 0 | 1284.5 | 884.6 |
596-
| e | 200 | 300 | 500 | 710.6 | 0 | 1595.2 |
597-
| f | 600 | 699.9 | 899.9 | 1110.5 | 399.9 | 0 |
592+
| a | 0 | 100 | 300 | 650 | 660.5 | 1534.6 |
593+
| b | 760.6 | 0 | 200 | 550.1 | 560.6 | 1434.6 |
594+
| c | 560.6 | 660.5 | 0 | 350 | 360.5 | 1234.6 |
595+
| d | 1484.6 | 1584.5| 1645.1 | 0 | 1284.5 | 884.6 |
596+
| e | 200 | 300 | 360.5 | 710.6 | 0 | 1595.2 |
597+
| f | 600 | 699.9 | 760.5 | 884.6 | 399.9 | 0 |
598598

599599

600600
Scenario: Testbot - Filling in noroutes with estimates (defaults to input coordinate location)
@@ -720,11 +720,10 @@ Feature: Basic Distance Matrix
720720
| 1 | 2 | abcdef,fghij,fghij | 1000.1m |
721721
| 1 | 3 | abcdef,fghij,fghij | 1400.1m |
722722
| 2 | 3 | fghij,fghij | 400m |
723-
723+
724724

725725
When I request a travel distance matrix I should get
726-
| | 1 | 2 | 3 |
726+
| | 1 | 2 | 3 |
727727
| 1 | 0 | 1000.1 | 1400.1 |
728728
| 2 | 1000.1 | 0 | 400 |
729729
| 3 | 1400.1 | 400 | 0 |
730-

features/testbot/duration_matrix.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,18 +491,18 @@ Feature: Basic Duration Matrix
491491

492492
When I route I should get
493493
| from | to | route | distance | time | weight |
494-
| a | c | ac,ac | 200m | 5s | 5 |
494+
| a | c | ac,ac | 200m | 1s | 1 |
495495

496496
When I request a travel time matrix I should get
497-
| | a | b | c | d |
498-
| a | 0 | 1 | 5 | 10 |
497+
| | a | b | c | d |
498+
| a | 0 | 1 | 1 | 6 |
499499

500500
When I request a travel time matrix I should get
501501
| | a |
502502
| a | 0 |
503503
| b | 1 |
504-
| c | 15 |
505-
| d | 10 |
504+
| c | 1 |
505+
| d | 6 |
506506

507507
Scenario: Testbot - OneToMany vs ManyToOne
508508
Given the node map

0 commit comments

Comments
 (0)