From 54c5830252d444f57582eccf48970929da3c9434 Mon Sep 17 00:00:00 2001 From: Max Langer Date: Thu, 5 Oct 2023 08:44:41 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20route=20on=20motorroads=20by=20?= =?UTF-8?q?foot=20or=20bicycle=20(#6697)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + features/bicycle/way.feature | 6 ++++++ features/foot/way.feature | 6 ++++++ profiles/bicycle.lua | 3 ++- profiles/foot.lua | 3 ++- profiles/lib/way_handlers.lua | 5 +++++ 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4f432653..a5ee36b57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - FIXED: Correct HTTP docs to reflect summary output dependency on steps parameter. [#6655](https://github.com/Project-OSRM/osrm-backend/pull/6655) - Profiles: - FIXED: Bicycle and foot profiles now don't route on proposed ways [#6615](https://github.com/Project-OSRM/osrm-backend/pull/6615) + - FIXED: Bicycle and foot profiles now don't route on motor roads [#6697](https://github.com/Project-OSRM/osrm-backend/pull/6697) - Routing: - FIXED: Fix adding traffic signal penalties during compression [#6419](https://github.com/Project-OSRM/osrm-backend/pull/6419) # 5.27.1 diff --git a/features/bicycle/way.feature b/features/bicycle/way.feature index b9beb5f0f..4f8c5d4ce 100644 --- a/features/bicycle/way.feature +++ b/features/bicycle/way.feature @@ -40,3 +40,9 @@ Feature: Bike - Accessability of different way types | highway | man_made | bothw | | (nil) | (nil) | | | (nil) | pier | x | + + Scenario: Bike - Motorroad + Then routability should be + | highway | motorroad | bothw | + | (nil) | (nil) | x | + | (nil) | yes | | \ No newline at end of file diff --git a/features/foot/way.feature b/features/foot/way.feature index 6916adece..24cf453b0 100644 --- a/features/foot/way.feature +++ b/features/foot/way.feature @@ -42,3 +42,9 @@ Feature: Foot - Accessability of different way types | footway | | | x | | proposed | | | | | proposed | yes | yes | | + + Scenario: Foot - Motorroad + Then routability should be + | highway | motorroad | forw | + | (nil) | (nil) | x | + | (nil) | yes | | \ No newline at end of file diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index 19202768e..00038c1dc 100644 --- a/profiles/bicycle.lua +++ b/profiles/bicycle.lua @@ -217,7 +217,8 @@ function setup() avoid = Set { 'impassable', 'construction', - 'proposed' + 'proposed', + 'motorroad' } } end diff --git a/profiles/foot.lua b/profiles/foot.lua index 1b16e092c..e02b97de9 100644 --- a/profiles/foot.lua +++ b/profiles/foot.lua @@ -70,7 +70,8 @@ function setup() avoid = Set { 'impassable', - 'proposed' + 'proposed', + 'motorroad' }, speeds = Sequence { diff --git a/profiles/lib/way_handlers.lua b/profiles/lib/way_handlers.lua index b13410235..d6c931165 100644 --- a/profiles/lib/way_handlers.lua +++ b/profiles/lib/way_handlers.lua @@ -634,6 +634,11 @@ function WayHandlers.blocked_ways(profile,way,result,data) return false end + -- motorroad + if profile.avoid.motorroad and way:get_value_by_key("motorroad") == "yes" then + return false + end + -- In addition to the highway=construction tag above handle the construction=* tag -- http://wiki.openstreetmap.org/wiki/Key:construction -- https://taginfo.openstreetmap.org/keys/construction#values