diff options
author | Constantin Shalnev <c.shalnev@corp.mail.ru> | 2015-07-09 15:35:33 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:55:28 +0300 |
commit | 68b6e0fd9401a020795e88c499ece2012e43db8a (patch) | |
tree | 5c71f9f766dd64fb6191cb786422073f67ee89be /routing/pedestrian_model.cpp | |
parent | 237bc9d444ed38ea7373ff866b0a848164ac4694 (diff) |
Added handling for yesfoot tag
Diffstat (limited to 'routing/pedestrian_model.cpp')
-rw-r--r-- | routing/pedestrian_model.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/routing/pedestrian_model.cpp b/routing/pedestrian_model.cpp index 57d21734d3..f8b92afdbe 100644 --- a/routing/pedestrian_model.cpp +++ b/routing/pedestrian_model.cpp @@ -63,7 +63,6 @@ routing::VehicleModel::InitListT const s_pedestrianLimits_Default = { {"highway", "road"}, kSpeedRoadKMpH }, { {"highway", "track"}, kSpeedTrackKMpH }, // * { {"highway", "path"}, kSpeedPathKMpH }, - { {"highway", "cycleway"}, kSpeedCyclewayKMpH }, // * { {"highway", "residential"}, kSpeedResidentialKMpH }, { {"highway", "living_street"}, kSpeedLivingStreetKMpH }, { {"highway", "steps"}, kSpeedStepsKMpH }, // * @@ -572,6 +571,7 @@ PedestrianModel::PedestrianModel(VehicleModel::InitListT const & speedLimits) void PedestrianModel::Init() { m_noFootType = classif().GetTypeByPath({ "hwtag", "nofoot" }); + m_yesFootType = classif().GetTypeByPath({ "hwtag", "yesfoot" }); initializer_list<char const *> arr[] = { @@ -582,16 +582,23 @@ void PedestrianModel::Init() SetAdditionalRoadTypes(classif(), arr, ARRAY_SIZE(arr)); } -bool PedestrianModel::IsFoot(feature::TypesHolder const & types) const +bool PedestrianModel::IsNoFoot(feature::TypesHolder const & types) const { - return find(types.begin(), types.end(), m_noFootType) == types.end(); + return find(types.begin(), types.end(), m_noFootType) != types.end(); +} + +bool PedestrianModel::IsYesFoot(feature::TypesHolder const & types) const +{ + return find(types.begin(), types.end(), m_yesFootType) != types.end(); } double PedestrianModel::GetSpeed(FeatureType const & f) const { feature::TypesHolder types(f); - if (IsFoot(types) && IsRoad(types)) + if (IsYesFoot(types)) + return VehicleModel::GetMaxSpeed(); + if (!IsNoFoot(types) && IsRoad(types)) return VehicleModel::GetSpeed(types); return 0.0; |