Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update maxspeed tests, remove maxspeed from foot profile

  • Loading branch information...
commit 97f1dc074928dea6d7fd6d478db7cdf1fb61eb7e 1 parent d67ac1a
@emiltin emiltin authored
View
55 features/bicycle/maxspeed.feature
@@ -3,31 +3,36 @@ Feature: Bike - Max speed restrictions
Background: Use specific speeds
Given the profile "bicycle"
-
- Scenario: Bike - Respect maxspeeds when lower that way type speed
- Given the node map
- | a | b | c |
- And the ways
- | nodes | highway | maxspeed |
- | ab | residential | |
- | bc | residential | 10 |
+ Scenario: Bicycle - Respect maxspeeds when lower that way type speed
+ Then routability should be
+ | highway | maxspeed | bothw |
+ | residential | | 40s ~10% |
+ | residential | 10 | 72s ~10% |
- When I route I should get
- | from | to | route | time |
- | a | b | ab | 20s ~5% |
- | b | c | bc | 36s ~5% |
+ Scenario: Bicycle - Ignore maxspeed when higher than way speed
+ Then routability should be
+ | highway | maxspeed | bothw |
+ | residential | | 40s ~10% |
+ | residential | 80 | 40s ~10% |
+
+ @todo
+ Scenario: Bicycle - Maxspeed formats
+ Then routability should be
+ | highway | maxspeed | bothw |
+ | residential | | 40s ~10% |
+ | residential | 5 | 144s ~10% |
+ | residential | 5mph | 90s ~10% |
+ | residential | 5 mph | 90s ~10% |
+ | residential | 5MPH | 90s ~10% |
+ | residential | 5 MPH | 90s ~10% |
+ | trunk | 5unknown | 40s ~10% |
+ | trunk | 5 unknown | 40s ~10% |
- Scenario: Bike - Do not use maxspeed when higher that way type speed
- Given the node map
- | a | b | c |
-
- And the ways
- | nodes | highway | maxspeed |
- | ab | residential | |
- | bc | residential | 80 |
-
- When I route I should get
- | from | to | route | time |
- | a | b | ab | 20s ~5% |
- | b | c | bc | 20s ~5% |
+ @todo
+ Scenario: Bicycle - Maxspeed special tags
+ Then routability should be
+ | highway | maxspeed | bothw |
+ | residential | | 40s ~10% |
+ | residential | none | 40s ~10% |
+ | residential | signals | 40s ~10% |
View
52 features/car/maxspeed.feature
@@ -3,32 +3,36 @@ Feature: Car - Max speed restrictions
Background: Use specific speeds
Given the profile "car"
- Given a grid size of 1000 meters
-
- Scenario: Car - Respect maxspeeds when lower that way type speed
- Given the node map
- | a | b | c |
-
- And the ways
- | nodes | highway | maxspeed |
- | ab | trunk | |
- | bc | trunk | 10 |
- When I route I should get
- | from | to | route | time |
- | a | b | ab | 42s ~10% |
- | b | c | bc | 360s ~10% |
+ Scenario: Car - Respect maxspeeds when lower that way type speed
+ Then routability should be
+ | highway | maxspeed | bothw |
+ | trunk | | 9s ~10% |
+ | trunk | 10 | 72s ~10% |
Scenario: Car - Ignore maxspeed when higher than way speed
- Given the node map
- | a | b | c |
+ Then routability should be
+ | highway | maxspeed | bothw |
+ | residential | | 29s ~10% |
+ | residential | 85 | 29s ~10% |
- And the ways
- | nodes | highway | maxspeed |
- | ab | residential | |
- | bc | residential | 85 |
+ @todo
+ Scenario: Car - Maxspeed formats
+ Then routability should be
+ | highway | maxspeed | bothw |
+ | trunk | | 9s ~10% |
+ | trunk | 10 | 73s ~10% |
+ | trunk | 10mph | 45s ~10% |
+ | trunk | 10 mph | 45s ~10% |
+ | trunk | 10MPH | 45s ~10% |
+ | trunk | 10 MPH | 45s ~10% |
+ | trunk | 10unknown | 9s ~10% |
+ | trunk | 10 unknown | 9s ~10% |
- When I route I should get
- | from | to | route | time |
- | a | b | ab | 144s ~10% |
- | b | c | bc | 144s ~10% |
+ @todo
+ Scenario: Car - Maxspeed special tags
+ Then routability should be
+ | highway | maxspeed | bothw |
+ | trunk | | 9s ~10% |
+ | trunk | none | 9s ~10% |
+ | trunk | signals | 9s ~10% |
View
20 features/foot/maxspeed.feature
@@ -0,0 +1,20 @@
+@routing @maxspeed @foot
+Feature: Foot - Ignore max speed restrictions
+
+Background: Use specific speeds
+ Given the profile "foot"
+
+@todo
+Scenario: Foot - Ignore maxspeed
+ Then routability should be
+ | highway | maxspeed | bothw |
+ | residential | | 145s ~10% |
+ | residential | 1 | 145s ~10% |
+ | residential | 100 | 145s ~10% |
+ | residential | 1 | 145s ~10% |
+ | residential | 1mph | 145s ~10% |
+ | residential | 1 mph | 145s ~10% |
+ | residential | 1unknown | 145s ~10% |
+ | residential | 1 unknown | 145s ~10% |
+ | residential | none | 145s ~10% |
+ | residential | signals | 145s ~10% |
View
3  features/support/shortcuts.rb
@@ -0,0 +1,3 @@
+def shortcuts_hash
+ @shortcuts_hash ||= {}
+end
View
5 profiles/foot.lua
@@ -152,10 +152,7 @@ function way_function (way, numberOfNodesInWay)
-- Set the avg speed on the way if it is accessible by road class
if (speed_profile[highway] ~= nil and way.speed == -1 ) then
- if (0 < maxspeed and not take_minimum_of_speeds) or (maxspeed == 0) then
- maxspeed = math.huge
- end
- way.speed = math.min(speed_profile[highway], maxspeed)
+ way.speed = speed_profile[highway]
end
-- Set the avg speed on ways that are marked accessible
Please sign in to comment.
Something went wrong with that request. Please try again.