Fix pass through additional road types

This commit is contained in:
tatiana-kondakova 2017-12-07 10:13:54 +03:00 committed by Yuri Gorshenin
parent c4edae65cc
commit 9d00c071cd
2 changed files with 9 additions and 0 deletions

View file

@ -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);
}

View file

@ -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;
};