Skip to content

Commit

Permalink
Support snapping to multiple ways at an input location
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mjjbell committed Aug 21, 2022
1 parent 7f014bd commit f113add
Show file tree
Hide file tree
Showing 61 changed files with 2,753 additions and 1,926 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
- FIXED: Fixed Node docs generation check in CI. [#6058](https://github.com/Project-OSRM/osrm-backend/pull/6058)
- CHANGED: Docker build, enabled arm64 build layer [#6172](https://github.com/Project-OSRM/osrm-backend/pull/6172)
- CHANGED: Docker build, enabled apt-get update/install caching in separate layer for build phase [#6175](https://github.com/Project-OSRM/osrm-backend/pull/6175)
- Routing:
- ADDED: Support snapping to multiple ways at an input location. [#5953](https://github.com/Project-OSRM/osrm-backend/pull/5953)

# 5.26.0
- Changes from 5.25.0
Expand Down
6 changes: 3 additions & 3 deletions features/bicycle/alley.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Bicycle - Route around alleys

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

31 changes: 16 additions & 15 deletions features/car/destination.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Feature: Car - Destination only, no passing through
Scenario: Car - Destination only street
Given the node map
"""
a e
b c d
a e
b1 c 2d
x y
x y
"""

And the ways
Expand All @@ -23,21 +23,21 @@ Feature: Car - Destination only, no passing through
When I route I should get
| from | to | route |
| a | b | ab,ab |
| a | c | ab,bcd |
| a | d | ab,bcd,bcd |
| a | c | ab,bcd,bcd |
| a | 2 | ab,bcd,bcd |
| a | e | axye,axye |
| e | d | de,de |
| e | c | de,bcd |
| e | b | de,bcd,bcd |
| e | c | de,bcd,bcd |
| e | 1 | de,bcd,bcd |
| e | a | axye,axye |

Scenario: Car - Destination only street
Given the node map
"""
a e
b c d
a e
b1 c 2d
x y
x y
"""

And the ways
Expand All @@ -51,12 +51,12 @@ Feature: Car - Destination only, no passing through
When I route I should get
| from | to | route |
| a | b | ab,ab |
| a | c | ab,bc |
| a | d | ab,cd |
| a | c | ab,bc,bc |
| a | 2 | ab,bc,cd |
| a | e | axye,axye |
| e | d | de,de |
| e | c | de,cd |
| e | b | de,bc |
| e | c | de,cd,cd |
| e | 1 | de,cd,bc |
| e | a | axye,axye |

Scenario: Car - Routing inside a destination only area
Expand Down Expand Up @@ -117,6 +117,7 @@ Feature: Car - Destination only, no passing through
+ \
+ |
d |
1 |
\___e
"""

Expand All @@ -129,7 +130,7 @@ Feature: Car - Destination only, no passing through
When I route I should get
| from | to | route |
| e | a | acbe,acbe |
| d | a | de,acbe,acbe |
| 1 | a | de,acbe,acbe |
| c | d | cd,cd |

Scenario: Car - Routing through a parking lot tagged access=destination,service
Expand Down
4 changes: 2 additions & 2 deletions features/car/restrictions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ Feature: Car - Turn restrictions
y
i j f b x a e g h
c d
c1 d
"""

And the ways
Expand All @@ -438,7 +438,7 @@ Feature: Car - Turn restrictions
When I route I should get
| from | to | route |
| e | f | ae,xa,bx,fb,fb |
| c | f | dc,da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
| 1 | f | dc,da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |
| d | f | da,ae,ge,hg,hg,ge,ae,xa,bx,fb,fb |

@except
Expand Down
15 changes: 8 additions & 7 deletions features/guidance/merge-segregated-roads.feature
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,11 @@ Feature: Merge Segregated Roads
|
.b.
c h
1 |
| 4
| |
| |
1 2
| |
2 |
| 3
d g
'e'
|
Expand All @@ -354,13 +355,13 @@ Feature: Merge Segregated Roads
| hb | road | yes |

When I route I should get
| waypoints | turns | route | intersections |
| waypoints | turns | route | intersections |
| a,f | depart,arrive | road,road | true:180,false:0 true:180,false:0 true:180;true:0 |
| c,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
| 1,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
| 2,f | depart,arrive | bridge,road | true:180,false:0 true:180;true:0 |
| f,a | depart,arrive | road,road | true:0,true:0 false:180,true:0 false:180;true:180 |
| g,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
| 2,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
| 3,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |
| 4,a | depart,arrive | bridge,road | true:0,true:0 false:180;true:180 |

@negative
Scenario: Traffic Circle
Expand Down
12 changes: 6 additions & 6 deletions features/testbot/bearing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ Feature: Compass bearing
Scenario: Bearing in a roundabout
Given the node map
"""
k d c j
e b
f a
l g h i
k d 1c j
e b
f a
l g2 h i
"""

And the ways
Expand All @@ -94,8 +94,8 @@ Feature: Compass bearing

When I route I should get
| from | to | route | bearing |
| 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 |
| 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 |
| 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 |
| 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 |

Scenario: Bearing should stay constant when zig-zagging
Given the node map
Expand Down
18 changes: 9 additions & 9 deletions features/testbot/distance_matrix.feature
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,12 @@ Feature: Basic Distance Matrix

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


Scenario: Testbot - Filling in noroutes with estimates (defaults to input coordinate location)
Expand Down Expand Up @@ -720,10 +720,10 @@ Feature: Basic Distance Matrix
| 1 | 2 | abcdef,fghij,fghij | 1000.1m |
| 1 | 3 | abcdef,fghij,fghij | 1400.1m |
| 2 | 3 | fghij,fghij | 400m |


When I request a travel distance matrix I should get
| | 1 | 2 | 3 |
| | 1 | 2 | 3 |
| 1 | 0 | 1000.1 | 1400.1 |
| 2 | 1000.1 | 0 | 400 |
| 3 | 1400.1 | 400 | 0 |
| 3 | 1400.1 | 400 | 0 |
10 changes: 5 additions & 5 deletions features/testbot/duration_matrix.feature
Original file line number Diff line number Diff line change
Expand Up @@ -491,18 +491,18 @@ Feature: Basic Duration Matrix

When I route I should get
| from | to | route | distance | time | weight |
| a | c | ac,ac | 200m | 5s | 5 |
| a | c | ac,ac | 200m | 1s | 1 |

When I request a travel time matrix I should get
| | a | b | c | d |
| a | 0 | 1 | 5 | 10 |
| | a | b | c | d |
| a | 0 | 1 | 1 | 6 |

When I request a travel time matrix I should get
| | a |
| a | 0 |
| b | 1 |
| c | 15 |
| d | 10 |
| c | 1 |
| d | 6 |

Scenario: Testbot - OneToMany vs ManyToOne
Given the node map
Expand Down
2 changes: 1 addition & 1 deletion features/testbot/snap.feature
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ Feature: Snap start/end point to the nearest way
| x | m | xe,xe |
| x | n | xf,xf |
| x | o | xg,xg |
| x | p | xh,xh |
| x | p | xh,xh |
Loading

0 comments on commit f113add

Please sign in to comment.