diff --git a/routing_common/bicycle_model.cpp b/routing_common/bicycle_model.cpp index c32d81286b..632f51d6f8 100644 --- a/routing_common/bicycle_model.cpp +++ b/routing_common/bicycle_model.cpp @@ -28,7 +28,7 @@ namespace // As result of such heuristic road is not totally the shortest, but it avoids non bicycle roads, which were // not marked as "hwtag=nobicycle" in OSM. -HighwayBasedFactors const kDefaultFactors{}; +HighwayBasedFactors const kDefaultFactors = GetOneFactorsForBicycleAndPedestrianModel(); HighwayBasedSpeeds const kDefaultSpeeds = { // {highway class : InOutCitySpeedKMpH(in city(weight, eta), out city(weight eta))} diff --git a/routing_common/pedestrian_model.cpp b/routing_common/pedestrian_model.cpp index 9814cecb30..82cc331662 100644 --- a/routing_common/pedestrian_model.cpp +++ b/routing_common/pedestrian_model.cpp @@ -28,7 +28,7 @@ namespace // As result of such heuristic road is not totally the shortest, but it avoids non pedestrian roads, which were // not marked as "foot=no" in OSM. -HighwayBasedFactors const kDefaultFactors{}; +HighwayBasedFactors const kDefaultFactors = GetOneFactorsForBicycleAndPedestrianModel(); HighwayBasedSpeeds const kDefaultSpeeds = { // {highway class : InOutCitySpeedKMpH(in city(weight, eta), out city(weight eta))} diff --git a/routing_common/vehicle_model.cpp b/routing_common/vehicle_model.cpp index 7cf7c0a988..6f0d3bc6e3 100644 --- a/routing_common/vehicle_model.cpp +++ b/routing_common/vehicle_model.cpp @@ -348,6 +348,35 @@ string VehicleModelFactory::GetParent(string const & country) const return m_countryParentNameGetterFn(country); } +HighwayBasedFactors GetOneFactorsForBicycleAndPedestrianModel() +{ + return HighwayBasedFactors{ + {HighwayType::HighwayTrunk, InOutCityFactor(1.0)}, + {HighwayType::HighwayTrunkLink, InOutCityFactor(1.0)}, + {HighwayType::HighwayPrimary, InOutCityFactor(1.0)}, + {HighwayType::HighwayPrimaryLink, InOutCityFactor(1.0)}, + {HighwayType::HighwaySecondary, InOutCityFactor(1.0)}, + {HighwayType::HighwaySecondaryLink, InOutCityFactor(1.0)}, + {HighwayType::HighwayTertiary, InOutCityFactor(1.0)}, + {HighwayType::HighwayTertiaryLink, InOutCityFactor(1.0)}, + {HighwayType::HighwayService, InOutCityFactor(1.0)}, + {HighwayType::HighwayUnclassified, InOutCityFactor(1.0)}, + {HighwayType::HighwayRoad, InOutCityFactor(1.0)}, + {HighwayType::HighwayTrack, InOutCityFactor(1.0)}, + {HighwayType::HighwayPath, InOutCityFactor(1.0)}, + {HighwayType::HighwayBridleway, InOutCityFactor(1.0)}, + {HighwayType::HighwayCycleway, InOutCityFactor(1.0)}, + {HighwayType::HighwayResidential, InOutCityFactor(1.0)}, + {HighwayType::HighwayLivingStreet, InOutCityFactor(1.0)}, + {HighwayType::HighwaySteps, InOutCityFactor(1.0)}, + {HighwayType::HighwayPedestrian, InOutCityFactor(1.0)}, + {HighwayType::HighwayFootway, InOutCityFactor(1.0)}, + {HighwayType::HighwayPlatform, InOutCityFactor(1.0)}, + {HighwayType::ManMadePier, InOutCityFactor(1.0)}, + {HighwayType::RouteFerry, InOutCityFactor(1.0)}, + }; +} + string DebugPrint(VehicleModelInterface::RoadAvailability const l) { switch (l) diff --git a/routing_common/vehicle_model.hpp b/routing_common/vehicle_model.hpp index e4561e0753..45c6de74f2 100644 --- a/routing_common/vehicle_model.hpp +++ b/routing_common/vehicle_model.hpp @@ -422,6 +422,8 @@ protected: CountryParentNameGetterFn m_countryParentNameGetterFn; }; +HighwayBasedFactors GetOneFactorsForBicycleAndPedestrianModel(); + std::string DebugPrint(VehicleModelInterface::RoadAvailability const l); std::string DebugPrint(SpeedKMpH const & speed); std::string DebugPrint(SpeedFactor const & speedFactor);