-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Allow excluding ferries on bicycle profile #5054
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
@routing @bicycle @mode | ||
Feature: Bicycle - Mode flag | ||
Background: | ||
Given the profile "bicycle" | ||
|
||
Scenario: Bicycle - We tag ferries with a class | ||
Given the node map | ||
""" | ||
a b | ||
c d | ||
""" | ||
|
||
And the ways | ||
| nodes | highway | route | | ||
| ab | primary | | | ||
| bc | | ferry | | ||
| cd | primary | | | ||
|
||
When I route I should get | ||
| from | to | route | turns | classes | | ||
| a | d | ab,bc,cd,cd | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] | | ||
| d | a | cd,bc,ab,ab | depart,notification right,notification left,arrive | [()],[(ferry)],[()],[()] | | ||
| c | a | bc,ab,ab | depart,notification left,arrive | [(ferry)],[()],[()] | | ||
| d | b | cd,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] | | ||
| a | c | ab,bc,bc | depart,notification right,arrive | [()],[(ferry)],[()] | | ||
| b | d | bc,cd,cd | depart,notification left,arrive | [(ferry)],[()],[()] | | ||
|
||
Scenario: Bicycle - We tag tunnel with a class | ||
Background: | ||
Given a grid size of 200 meters | ||
|
||
Given the node map | ||
""" | ||
a b | ||
c d | ||
""" | ||
|
||
And the ways | ||
| nodes | tunnel | | ||
| ab | no | | ||
| bc | yes | | ||
| cd | | | ||
|
||
When I route I should get | ||
| from | to | route | turns | classes | | ||
| a | d | ab,bc,cd,cd | depart,new name right,new name left,arrive | [()],[(tunnel)],[()],[()] | | ||
|
||
Scenario: Bicycle - We tag classes without intersections | ||
Background: | ||
Given a grid size of 200 meters | ||
|
||
Given the node map | ||
""" | ||
a b c d | ||
""" | ||
|
||
And the ways | ||
| nodes | name | tunnel | | ||
| ab | road | | | ||
| bc | road | yes | | ||
| cd | road | | | ||
|
||
When I route I should get | ||
| from | to | route | turns | classes | | ||
| a | d | road,road | depart,arrive | [(),(tunnel),()],[()] | | ||
|
||
Scenario: Bicycle - From roundabout on ferry | ||
Given the node map | ||
""" | ||
c | ||
/ \ | ||
a---b d---f--h | ||
\ / | ||
e | ||
| | ||
g | ||
""" | ||
|
||
And the ways | ||
| nodes | oneway | highway | junction | route | | ||
| ab | yes | service | | | | ||
| cb | yes | service | roundabout | | | ||
| dc | yes | service | roundabout | | | ||
| be | yes | service | roundabout | | | ||
| ed | yes | service | roundabout | | | ||
| eg | yes | service | | | | ||
| df | | | | ferry | | ||
| fh | yes | service | | | | ||
|
||
When I route I should get | ||
| from | to | route | turns | classes | | ||
| a | h | ab,df,df,fh,fh | depart,roundabout-exit-2,exit roundabout slight right,notification straight,arrive | [()],[(),()],[(ferry)],[()],[()] | | ||
This comment was marked as resolved.
Sorry, something went wrong. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@routing @bicycle @exclude | ||
Feature: Bicycle - Exclude flags | ||
Background: | ||
Given the profile file "bicycle" initialized with | ||
""" | ||
profile.excludable = Sequence { Set { 'ferry' } } | ||
""" | ||
Given the node map | ||
""" | ||
a....b~~~~~c...f | ||
: : | ||
d.....e | ||
""" | ||
|
||
And the ways | ||
| nodes | highway | route | duration | # | | ||
| ab | service | | | always drivable | | ||
| bc | | ferry | 00:00:01 | not drivable for exclude=ferry, but fast. | | ||
| bd | service | | | always drivable | | ||
| de | service | | | always drivable | | ||
| ec | service | | | always drivable | | ||
| cf | service | | | always drivable | | ||
|
||
Scenario: Bicycle - exclude nothing | ||
When I route I should get | ||
| from | to | route | | ||
| a | f | ab,bc,cf,cf | | ||
|
||
When I match I should get | ||
| trace | matchings | duration | | ||
| abcf | abcf | 109 | | ||
|
||
When I request a travel time matrix I should get | ||
| | a | f | | ||
| a | 0 | 109 | | ||
| f | 109 | 0 | | ||
|
||
Scenario: Bicycle - exclude ferry | ||
Given the query options | ||
| exclude | ferry | | ||
|
||
When I route I should get | ||
| from | to | route | | ||
| a | f | ab,bd,de,ec,cf,cf | | ||
|
||
When I match I should get | ||
| trace | matchings | duration | | ||
| abcf | abcf | 301.2 | | ||
|
||
When I request a travel time matrix I should get | ||
| | a | f | | ||
| a | 0 | 301 +- 1 | | ||
| f | 301.2 +- 1 | 0 | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as resolved.
Sorry, something went wrong.