Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds cucumber scenario for u turn restrictions at intersection #4484

Merged
merged 3 commits into from
Oct 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions features/car/restrictions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,36 @@ Feature: Car - Turn restrictions
| c | a | cj,aj,aj |
| c | b | cj,bj,bj |

@no_turning
Scenario: Car - No u-turn
# https://www.openstreetmap.org/edit?node=54878482#map=19/34.05242/-117.19067
Given the node map
"""
c
3
a 1 x 2 b
4
d
"""

And the ways
| nodes |
| ax |
| xb |
| cx |
| xd |

And the relations
| type | way:from | way:to | node:via | restriction |
| restriction | ax | ax | x | no_u_turn |
| restriction | bx | bx | x | no_u_turn |
| restriction | cx | cx | x | no_u_turn |
| restriction | dx | dx | x | no_u_turn |

When I route I should get
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjjbell as you worked on PR closing #4465 and this PR was blocked by it could you take a look? This test currently failing on master:

2022-10-06T14:33:17.0903046Z    Message:
2022-10-06T14:33:17.0903377Z      �[31mTables were not identical:
2022-10-06T14:33:17.0903835Z      | waypoints |     route             |
2022-10-06T14:33:17.0904218Z      | a,x,a     | (-) ax,ax,xb,xb,ax,ax |
2022-10-06T14:33:17.0904606Z      | a,x,a     | (+) ax,xb,xb,xb,ax,ax |�[39m

But it seems in this context ax,ax,xb,xb,ax,ax is the same as ax,xb,xb,xb,ax,ax, or not? Asking because tbh I don't have enough knowledge yet to now for sure if we can merge it or not(but probably would be great to merge it if it is ready) :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Short answer: yes

Longer answer:
Adding the turns to see what's going on.

| a,x,a     | (-) ax,ax,xb,xb,ax,ax | (-) |
| a,x,a     | (+) ax,xb,xb,xb,ax,ax | (+) depart,new name straight,continue uturn,arrive,depart,arrive |

So the response is splitting the route into two as a->x->b(uturn)->x , x->a
whereas the test wants a->x , x->b(uturn)->x->a

They will have equivalent weight, so it's just whichever OSRM happens to select out of the two.

This wouldn't have worked in the past because the mid journey stop might have been on cx or somewhere else that wasn't optimal.

| waypoints | route | turns |
| a,x,a | ax,xb,xb,xb,ax,ax | depart,new name straight,continue uturn,arrive,depart,arrive |

@no_turning
Scenario: Car - Handle any no_* relation
Given the node map
Expand Down