fixes #695 for bike profile

This commit is contained in:
Dennis Luxen 2013-08-12 18:00:56 +02:00
parent e50b5202b8
commit aeba3aa209
2 changed files with 46 additions and 29 deletions

View File

@ -68,3 +68,20 @@ Feature: Bike - Max speed restrictions
| 1 | 10 | | run | snail |
| 1 | | 10 | snail | run |
| 1 | 5 | 10 | walk | run |
Scenario: Bike - Maxspeed should not allow routing on unroutable ways
Then routability should be
| highway | railway | access | maxspeed | maxspeed:forward | maxspeed:backward | bothw |
| primary | | | | | | x |
| secondary | | no | | | | |
| secondary | | no | 100 | | | |
| secondary | | no | | 100 | | |
| secondary | | no | | | 100 | |
| (nil) | train | | | | | |
| (nil) | train | | 100 | | | |
| (nil) | train | | | 100 | | |
| (nil) | train | | | | 100 | |
| runway | | | | | | |
| runway | | | 100 | | | |
| runway | | | | 100 | | |
| runway | | | | | 100 | |

View File

@ -331,7 +331,7 @@ function way_function (way)
end
-- Override speed settings if explicit forward/backward maxspeeds are given
if maxspeed_forward ~= nil and maxspeed_forward > 0 then
if way.speed > 0 and maxspeed_forward ~= nil and maxspeed_forward > 0 then
if Way.bidirectional == way.direction then
way.backward_speed = way.speed
end