From 86b70f26320c94b291defffd7d56569eb4b57cff Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Mon, 24 Oct 2016 23:07:32 +0200 Subject: [PATCH] Don't fail on incorrect lane tags '1; 2' --- features/guidance/bugs.feature | 15 +++++++++++++++ profiles/lib/guidance.lua | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/features/guidance/bugs.feature b/features/guidance/bugs.feature index 0eed6c86e..d07d2fc9a 100644 --- a/features/guidance/bugs.feature +++ b/features/guidance/bugs.feature @@ -35,3 +35,18 @@ Feature: Features related to bugs When I route I should get | waypoints | route | turns | | 1,2 | top,right,right | depart,new name right,arrive | + + @3156 + Scenario: Incorrect lanes tag + Given the node map + """ + a b + """ + + And the ways + | nodes | lanes | + | ab | 1; 2 | + + And the data has been saved to disk + When I try to run "osrm-extract {osm_file} --profile {profile_file}" + Then it should exit successfully diff --git a/profiles/lib/guidance.lua b/profiles/lib/guidance.lua index d867fd56e..4935c0120 100644 --- a/profiles/lib/guidance.lua +++ b/profiles/lib/guidance.lua @@ -63,7 +63,7 @@ function Guidance.set_classification (highway, result, input_way) local lane_count = input_way:get_value_by_key("lanes") if lane_count and lane_count ~= "" then local lc = tonumber(lane_count) - if lane_count ~= nil then + if lc ~= nil then result.road_classification.num_lanes = lc end else