Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Dec 8, 2013
1 parent b251291 commit e949677
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions profiles/car.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ speed_profile = {

take_minimum_of_speeds = false
obey_oneway = true
obey_bollards = true
use_restrictions = true
obey_bollards = true
use_turn_restrictions = true
ignore_areas = true -- future feature
traffic_signal_penalty = 2
u_turn_penalty = 20
Expand Down
6 changes: 3 additions & 3 deletions profiles/foot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function way_function (way)
then
return 0
end

-- don't route on ways that are still under construction
if highway=='construction' then
return 0
Expand All @@ -125,7 +125,7 @@ function way_function (way)
if access_tag_blacklist[access] then
return 0
end

local name = way.tags:Find("name")
local ref = way.tags:Find("ref")
local junction = way.tags:Find("junction")
Expand Down Expand Up @@ -179,7 +179,7 @@ function way_function (way)
-- unknown way, but valid access tag
way.speed = walking_speed
end

-- oneway
if onewayClass == "yes" or onewayClass == "1" or onewayClass == "true" then
way.direction = Way.oneway
Expand Down
18 changes: 9 additions & 9 deletions profiles/testbot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- Secondary road: 18km/h = 18000m/3600s = 100m/20s
-- Tertiary road: 12km/h = 12000m/3600s = 100m/30s

speed_profile = {
speed_profile = {
["primary"] = 36,
["secondary"] = 18,
["tertiary"] = 12,
Expand All @@ -17,8 +17,8 @@ speed_profile = {

take_minimum_of_speeds = true
obey_oneway = true
obey_bollards = true
use_restrictions = true
obey_barriers = true
use_turn_restrictions = true
ignore_areas = true -- future feature
traffic_signal_penalty = 7 -- seconds
u_turn_penalty = 20
Expand Down Expand Up @@ -55,7 +55,7 @@ function way_function (way)
local maxspeed = tonumber(way.tags:Find ( "maxspeed"))
local maxspeed_forward = tonumber(way.tags:Find( "maxspeed:forward"))
local maxspeed_backward = tonumber(way.tags:Find( "maxspeed:backward"))

way.name = name

if route ~= nil and durationIsValid(duration) then
Expand All @@ -69,29 +69,29 @@ function way_function (way)
speed_forw = temp_speed*1.5
speed_back = temp_speed/1.5
end

if maxspeed_forward ~= nil and maxspeed_forward > 0 then
speed_forw = maxspeed_forward
else
if maxspeed ~= nil and maxspeed > 0 and speed_forw > maxspeed then
speed_forw = maxspeed
end
end

if maxspeed_backward ~= nil and maxspeed_backward > 0 then
speed_back = maxspeed_backward
else
if maxspeed ~=nil and maxspeed > 0 and speed_back > maxspeed then
speed_back = maxspeed
end
end

way.speed = speed_forw
if speed_back ~= way_forw then
way.backward_speed = speed_back
end
end

if oneway == "no" or oneway == "0" or oneway == "false" then
way.direction = Way.bidirectional
elseif oneway == "-1" then
Expand All @@ -101,7 +101,7 @@ function way_function (way)
else
way.direction = Way.bidirectional
end

way.type = 1
return 1
end

0 comments on commit e949677

Please sign in to comment.