Skip to content

Commit

Permalink
first conditional turn restrictions test
Browse files Browse the repository at this point in the history
  • Loading branch information
karenzshea committed Apr 13, 2017
1 parent d5df329 commit 98cf68d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions features/car/conditional_restrictions.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@routing @car @restrictions
Feature: Car - Turn restrictions
# Handle turn restrictions as defined by http://wiki.openstreetmap.org/wiki/Relation:restriction
# Note that if u-turns are allowed, turn restrictions can lead to suprising, but correct, routes.

Background: Use car routing
Given the profile "car"
Given a grid size of 200 meters

@no_turning
Scenario: Car - No left turn
Given the extract extra arguments "--parse-conditional-restrictions=1"
Given the contract extra arguments "--time-zone-file=world/tz_world.shp"
Given the node map
"""
n
j e
s
"""

And the ways
| nodes | oneway |
| nj | no |
| js | no |
| ej | yes |

And the relations
| type | way:from | way:to | node:via | restriction:conditional |
| restriction | ej | nj | j | only_right_turn @ (Mo-Su 00:00-23:59) |

When I route I should get
| from | to | route |
| e | s | ej,nj,nj,js,js |
| e | n | ej,nj,nj |
1 change: 1 addition & 0 deletions src/tools/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ return_code parseArguments(int argc, char *argv[], extractor::ExtractorConfig &e
"Use metadata during osm parsing (This can affect the extraction performance).")(
"parse-conditional-restrictions",
boost::program_options::value<bool>(&extractor_config.parse_conditionals)
->implicit_value(true)
->default_value(false),
"Save conditional restrictions found during extraction to disk for use "
"during contraction");
Expand Down

0 comments on commit 98cf68d

Please sign in to comment.