From fec2b602a2e5cac4f3af00df91836cc7061a43f9 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Thu, 21 Sep 2017 15:18:11 +0200 Subject: [PATCH] Bump api_version to 3 in car.lua --- features/options/extract/lua.feature | 4 ++-- profiles/car.lua | 7 ++++--- profiles/lib/way_handlers.lua | 6 +++--- profiles/testbot.lua | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/features/options/extract/lua.feature b/features/options/extract/lua.feature index a1e893adc..6d0b07f49 100644 --- a/features/options/extract/lua.feature +++ b/features/options/extract/lua.feature @@ -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 @@ -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 diff --git a/profiles/car.lua b/profiles/car.lua index 916bdfb6b..6febb4607 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -1,6 +1,6 @@ -- Car profile -api_version = 2 +api_version = 3 Set = require('lib/set') Sequence = require('lib/sequence') @@ -303,7 +303,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. @@ -387,7 +387,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) diff --git a/profiles/lib/way_handlers.lua b/profiles/lib/way_handlers.lua index 88de8f3d4..2ea4e1d07 100644 --- a/profiles/lib/way_handlers.lua +++ b/profiles/lib/way_handlers.lua @@ -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 @@ -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 diff --git a/profiles/testbot.lua b/profiles/testbot.lua index 57292bbd8..d4288bd81 100644 --- a/profiles/testbot.lua +++ b/profiles/testbot.lua @@ -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 {