From 9d00c071cd24ba0db0f780a12706d7c276c8ecb5 Mon Sep 17 00:00:00 2001 From: tatiana-kondakova Date: Thu, 7 Dec 2017 10:13:54 +0300 Subject: [PATCH] Fix pass through additional road types --- routing_common/vehicle_model.cpp | 7 +++++++ routing_common/vehicle_model.hpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/routing_common/vehicle_model.cpp b/routing_common/vehicle_model.cpp index 00c6645880..f666902aeb 100644 --- a/routing_common/vehicle_model.cpp +++ b/routing_common/vehicle_model.cpp @@ -114,6 +114,13 @@ bool VehicleModel::IsRoad(FeatureType const & f) const bool VehicleModel::IsPassThroughAllowed(FeatureType const & f) const { feature::TypesHolder const types(f); + // Allow pass through additional road types e.g. peer, ferry. + for (uint32_t t : types) + { + auto const addRoadInfoIter = FindRoadType(t); + if (addRoadInfoIter != m_addRoadTypes.cend()) + return true; + } return HasPassThroughType(types); } diff --git a/routing_common/vehicle_model.hpp b/routing_common/vehicle_model.hpp index ece3f0985b..75066e6b89 100644 --- a/routing_common/vehicle_model.hpp +++ b/routing_common/vehicle_model.hpp @@ -47,6 +47,8 @@ public: /// e.g. in Russia roads tagged "highway = service" are not allowed for through passage; /// however, road with this tag can be be used if it is close enough to the start or destination /// point of the route. + /// Roads with additional types e.g. "path = ferry", "vehicle_type = yes" considered as allowed + /// to pass through. virtual bool IsPassThroughAllowed(FeatureType const & f) const = 0; };