From 8e61f432660907e06ccc457585b9013182cfb92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Mon, 3 Jun 2024 17:21:21 +0200 Subject: [PATCH 1/2] bike: fix access check, foot: allow to use bike paths --- include/osr/routing/profiles/bike.h | 4 ++-- include/osr/routing/profiles/foot.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/osr/routing/profiles/bike.h b/include/osr/routing/profiles/bike.h index 9950a46..19de22b 100644 --- a/include/osr/routing/profiles/bike.h +++ b/include/osr/routing/profiles/bike.h @@ -119,7 +119,7 @@ struct bike { static constexpr cost_t way_cost(way_properties const e, direction, std::uint16_t const dist) { - if (e.is_foot_accessible()) { + if (e.is_bike_accessible()) { return static_cast(std::round(dist / 1.2F)); } else { return kInfeasible; @@ -127,7 +127,7 @@ struct bike { } static constexpr cost_t node_cost(node_properties const n) { - return (n.is_walk_accessible() ? (n.is_elevator_ ? 90U : 0U) : kInfeasible); + return n.is_bike_accessible() ? 0U : kInfeasible; } }; diff --git a/include/osr/routing/profiles/foot.h b/include/osr/routing/profiles/foot.h index 3009f35..f078c0c 100644 --- a/include/osr/routing/profiles/foot.h +++ b/include/osr/routing/profiles/foot.h @@ -262,7 +262,8 @@ struct foot { static constexpr cost_t way_cost(way_properties const e, direction, std::uint16_t const dist) { - if (e.is_foot_accessible() && (!IsWheelchair || !e.is_steps())) { + if ((e.is_foot_accessible() || e.is_bike_accessible()) && + (!IsWheelchair || !e.is_steps())) { return static_cast(std::round(dist / 1.2F)); } else { return kInfeasible; From a913b4a46c703545613832568933c1b0d4851001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Thu, 6 Jun 2024 12:57:24 +0200 Subject: [PATCH 2/2] sort elevators (#13) --- src/extract.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/extract.cc b/src/extract.cc index 79d98b5..1892551 100644 --- a/src/extract.cc +++ b/src/extract.cc @@ -503,6 +503,8 @@ void extract(fs::path const& in, fs::path const& out) { w.add_restriction(r); + utl::sort(w.r_->multi_level_elevators_); + w.r_->write(out); }