Skip to content

Commit

Permalink
Bump api_version to 3 in car.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase committed Sep 21, 2017
1 parent 456c302 commit 480bc4a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions features/options/extract/lua.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Feature: osrm-extract lua ways:get_nodes()
"""
functions = require('testbot')
function way_function(profile, way, result, location_data)
function way_function(profile, way, result, relations, location_data)
assert(location_data)
for k, v in pairs(location_data) do print (k .. ' ' .. tostring(v)) end
result.forward_mode = mode.driving
Expand Down Expand Up @@ -83,7 +83,7 @@ Feature: osrm-extract lua ways:get_nodes()
"""
functions = require('testbot')
function way_function(profile, way, result, location_data)
function way_function(profile, way, result, relations, location_data)
assert(location_data)
print('ISO3166-1 ' .. (location_data['ISO3166-1'] or 'none'))
result.forward_mode = mode.driving
Expand Down
7 changes: 4 additions & 3 deletions profiles/car.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Car profile

api_version = 2
api_version = 3

Set = require('lib/set')
Sequence = require('lib/sequence')
Expand Down Expand Up @@ -302,7 +302,7 @@ function process_node(profile, node, result)
end
end

function process_way(profile, way, result, location_data)
function process_way(profile, way, result, relations, location_data)
-- the intial filtering of ways based on presence of tags
-- affects processing times significantly, because all ways
-- have to be checked.
Expand Down Expand Up @@ -386,7 +386,8 @@ function process_way(profile, way, result, location_data)
WayHandlers.weights
}

WayHandlers.run(profile, way, result, data, handlers, location_data)
print (profile, way, result, data, handlers, relations, location_data)
WayHandlers.run(profile, way, result, data, handlers, relations, location_data)
end

function process_turn(profile, turn)
Expand Down
6 changes: 3 additions & 3 deletions profiles/lib/way_handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ function WayHandlers.blocked_ways(profile,way,result,data)
end
end

function WayHandlers.driving_side(profile, way, result, data, location_data)
function WayHandlers.driving_side(profile, way, result, data, relations, location_data)
local driving_side = way:get_value_by_key("driving_side")
if driving_side == 'left' then
result.is_left_hand_driving = true
Expand Down Expand Up @@ -584,9 +584,9 @@ end
-- if the handler chain should be aborted.
-- To ensure the correct order of method calls, use a Sequence of handler names.

function WayHandlers.run(profile, way, result, data, handlers, location_data)
function WayHandlers.run(profile, way, result, data, handlers, relatons, location_data)
for i,handler in ipairs(handlers) do
if handler(profile, way, result, data, location_data) == false then
if handler(profile, way, result, data, relatons, location_data) == false then
return false
end
end
Expand Down
2 changes: 1 addition & 1 deletion profiles/testbot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-- Secondary road: 18km/h = 18000m/3600s = 100m/20s
-- Tertiary road: 12km/h = 12000m/3600s = 100m/30s

api_version = 2
api_version = 3

function setup()
return {
Expand Down

0 comments on commit 480bc4a

Please sign in to comment.