Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-06-03 19:17:14 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-06-17 19:36:50 +0300
commitafea24bc7f403e40cea7f3f067b6cced9dbfd7f9 (patch)
treeb190be76f6a9a8256dc87c4312efa8b3363d54e9 /routing/pedestrian_model.cpp
parent0b8e94adccd2da6019b6ff5512156e8b1d570123 (diff)
[bicycle routing] Using attr bicycle=yes or no and oneway:bicycle for bicycle routing.
Diffstat (limited to 'routing/pedestrian_model.cpp')
-rw-r--r--routing/pedestrian_model.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/routing/pedestrian_model.cpp b/routing/pedestrian_model.cpp
index af22fa59f3..e2a305a147 100644
--- a/routing/pedestrian_model.cpp
+++ b/routing/pedestrian_model.cpp
@@ -621,11 +621,14 @@ PedestrianModel::PedestrianModel(VehicleModel::InitListT const & speedLimits)
void PedestrianModel::Init()
{
+ initializer_list<char const *> hwtagYesfoot = { "hwtag", "yesfoot" };
+
m_noFootType = classif().GetTypeByPath({ "hwtag", "nofoot" });
- m_yesFootType = classif().GetTypeByPath({ "hwtag", "yesfoot" });
+ m_yesFootType = classif().GetTypeByPath(hwtagYesfoot);
initializer_list<char const *> arr[] =
{
+ hwtagYesfoot,
{ "route", "ferry" },
{ "man_made", "pier" },
};
@@ -649,12 +652,23 @@ double PedestrianModel::GetSpeed(FeatureType const & f) const
if (IsYesFoot(types))
return VehicleModel::GetMaxSpeed();
- if (!IsNoFoot(types) && IsRoad(types))
- return VehicleModel::GetSpeed(types);
+ if (!IsNoFoot(types) && HasRoadType(types))
+ return VehicleModel::GetMinTypeSpeed(types);
return 0.0;
}
+bool PedestrianModel::IsRoad(FeatureType const & f) const
+{
+ if (f.GetFeatureType() != feature::GEOM_LINE)
+ return false;
+
+ feature::TypesHolder types(f);
+
+ if (IsNoFoot(types))
+ return false;
+ return VehicleModel::HasRoadType(types);
+}
PedestrianModelFactory::PedestrianModelFactory()
{