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 Feb 5, 2021
1 parent 9d81eb3 commit d34f21e
Show file tree
Hide file tree
Showing 61 changed files with 2,756 additions and 1,926 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Unreleased
- Changes from 5.24.0
- Features
- ADDED: Support snapping to multiple ways at an input location. [#5953](https://github.com/Project-OSRM/osrm-backend/pull/5953)
- CHANGED: Breaking change to libosrm `hints` parameter. It now takes a vector of `Hint` objects for each request coordinate. [#5953](https://github.com/Project-OSRM/osrm-backend/pull/5953)

# 5.24.0
- Changes from 5.23.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
14 changes: 7 additions & 7 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.1 | 300.2 | 650.5 | 1930.6 | 1533 |
| b | 759 | 0 | 200.1 | 550.4 | 1830.5 | 1432.9 |
| c | 558.8 | 658.9 | 0 | 350.3 | 1630.4 | 1232.8 |
| d | 1478.9 | 1579 | 1779.1 | 0 | 1280.1 | 882.5 |
| e | 198.8 | 298.9 | 499 | 710.3 | 0 | 1592.8 |
| f | 596.4 | 696.5 | 896.6 | 1107.9 | 397.6 | 0 |
| a | 0 | 100.1 | 300.2 | 650.5 | 660.2 | 1533 |
| b | 759 | 0 | 200.1 | 550.4 | 560.2 | 1432.9 |
| c | 558.8 | 658.9 | 0 | 350.3 | 360 | 1232.8 |
| d | 1478.9 | 1579 | 1640.1 | 0 | 1280.1 | 882.5 |
| e | 198.8 | 298.9 | 360 | 710.3 | 0 | 1592.8 |
| f | 596.4 | 696.5 | 757.6 | 882.5 | 397.6 | 0 |

Scenario: Testbot - Filling in noroutes with estimates (defaults to input coordinate location)
Given a grid size of 300 meters
Expand Down Expand Up @@ -722,4 +722,4 @@ Feature: Basic Distance Matrix
When I request a travel distance matrix I should get
| | 1 | 2 |
| 1 | 0 | 1000.7 |
| 2 | 1000.7 | 0 |
| 2 | 1000.7 | 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 d34f21e

Please sign in to comment.