diff --git a/routing/routing_integration_tests/bicycle_route_test.cpp b/routing/routing_integration_tests/bicycle_route_test.cpp index 4ee90b7654..a434fbcc7a 100644 --- a/routing/routing_integration_tests/bicycle_route_test.cpp +++ b/routing/routing_integration_tests/bicycle_route_test.cpp @@ -188,4 +188,20 @@ UNIT_TEST(London_GreenwichTunnel) mercator::FromLatLon(51.4817397, -0.0100070258), {0.0, 0.0}, mercator::FromLatLon(51.4883739, -0.00809729298), 1332.8 /* expectedRouteMeters */); } + +UNIT_TEST(Batumi_AvoidServiceDetour) +{ + integration::CalculateRouteAndTestRouteLength( + integration::GetVehicleComponents(VehicleType::Bicycle), + mercator::FromLatLon(41.6380014, 41.6269446), {0.0, 0.0}, + mercator::FromLatLon(41.6392113, 41.6260084), 156.465 /* expectedRouteMeters */); +} + +UNIT_TEST(Gdansk_AvoidLongCyclewayDetour) +{ + integration::CalculateRouteAndTestRouteLength( + integration::GetVehicleComponents(VehicleType::Bicycle), + mercator::FromLatLon(54.2632738, 18.6771661), {0.0, 0.0}, + mercator::FromLatLon(54.2698882, 18.6765837), 753.837 /* expectedRouteMeters */); +} } // namespace bicycle_route_test diff --git a/routing_common/bicycle_model.cpp b/routing_common/bicycle_model.cpp index ea365210b8..ecc89c38a7 100644 --- a/routing_common/bicycle_model.cpp +++ b/routing_common/bicycle_model.cpp @@ -39,14 +39,18 @@ HighwayBasedSpeeds const kDefaultSpeeds = { {HighwayType::HighwaySecondaryLink, InOutCitySpeedKMpH(SpeedKMpH(15.0, 18.0), SpeedKMpH(20.0, 18.0))}, {HighwayType::HighwayTertiary, InOutCitySpeedKMpH(SpeedKMpH(15.0, 18.0), SpeedKMpH(20.0, 18.0))}, {HighwayType::HighwayTertiaryLink, InOutCitySpeedKMpH(SpeedKMpH(15.0, 18.0), SpeedKMpH(20.0, 18.0))}, - {HighwayType::HighwayService, InOutCitySpeedKMpH(SpeedKMpH(12.0, 18.0))}, {HighwayType::HighwayUnclassified, InOutCitySpeedKMpH(SpeedKMpH(12.0, 18.0))}, + + // https://github.com/organicmaps/organicmaps/issues/3881 + // Set equal speeds here to avoid useless detours via service roads (Batumi_AvoidServiceDetour test). + {HighwayType::HighwayService, InOutCitySpeedKMpH(SpeedKMpH(10.0, 14.0))}, + {HighwayType::HighwayResidential, InOutCitySpeedKMpH(SpeedKMpH(10.0, 14.0))}, + {HighwayType::HighwayRoad, InOutCitySpeedKMpH(SpeedKMpH(10.0, 12.0))}, {HighwayType::HighwayTrack, InOutCitySpeedKMpH(SpeedKMpH(8.0, 12.0))}, {HighwayType::HighwayPath, InOutCitySpeedKMpH(SpeedKMpH(6.0, 12.0))}, {HighwayType::HighwayBridleway, InOutCitySpeedKMpH(SpeedKMpH(4.0, 12.0))}, {HighwayType::HighwayCycleway, InOutCitySpeedKMpH(SpeedKMpH(30.0, 20.0))}, - {HighwayType::HighwayResidential, InOutCitySpeedKMpH(SpeedKMpH(8.0, 10.0))}, {HighwayType::HighwayLivingStreet, InOutCitySpeedKMpH(SpeedKMpH(7.0, 8.0))}, // Steps have obvious inconvenience of a bike in hands. {HighwayType::HighwaySteps, InOutCitySpeedKMpH(SpeedKMpH(1.0, 1.0))},