diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2018-08-29 17:47:15 +0300 |
---|---|---|
committer | Vlad Mihaylenko <vxmihaylenko@gmail.com> | 2018-09-20 18:05:43 +0300 |
commit | 00d7fb87185b345b460bb34773081bad6e30b8d3 (patch) | |
tree | ccab436f4a18785ec245a45a6dad2d7344f2b9d9 /routing_common | |
parent | f6f95346db175f64f31f59c5f7b108b1f222efbd (diff) |
Using in city and out city speeds in vehicle models.
Diffstat (limited to 'routing_common')
-rw-r--r-- | routing_common/bicycle_model.cpp | 492 | ||||
-rw-r--r-- | routing_common/car_model.cpp | 176 | ||||
-rw-r--r-- | routing_common/pedestrian_model.cpp | 242 | ||||
-rw-r--r-- | routing_common/routing_common_tests/vehicle_model_test.cpp | 25 | ||||
-rw-r--r-- | routing_common/vehicle_model.cpp | 15 | ||||
-rw-r--r-- | routing_common/vehicle_model.hpp | 28 |
6 files changed, 498 insertions, 480 deletions
diff --git a/routing_common/bicycle_model.cpp b/routing_common/bicycle_model.cpp index e8ea9bbe71..558797d363 100644 --- a/routing_common/bicycle_model.cpp +++ b/routing_common/bicycle_model.cpp @@ -51,7 +51,6 @@ double constexpr kOutCitySpeedPedestrianKMpH = 5.0; double constexpr kOutCitySpeedFootwayKMpH = 7.0; double constexpr kOutCitySpeedPlatformKMpH = 3.0; double constexpr kOutCitySpeedPierKMpH = 7.0; -double constexpr kOutCitySpeedOffroadKMpH = 3.0; double constexpr kOutCitySpeedFerryKMpH = 3.0; // Speed of road features located inside cities and towns polygons in km per hour. @@ -77,126 +76,127 @@ double constexpr kInCitySpeedPedestrianKMpH = kOutCitySpeedPedestrianKMpH; double constexpr kInCitySpeedFootwayKMpH = kOutCitySpeedFootwayKMpH; double constexpr kInCitySpeedPlatformKMpH = kOutCitySpeedPlatformKMpH; double constexpr kInCitySpeedPierKMpH = kOutCitySpeedPierKMpH; -double constexpr kInCitySpeedOffroadKMpH = kOutCitySpeedOffroadKMpH; double constexpr kInCitySpeedFerryKMpH = kOutCitySpeedFerryKMpH; +double constexpr kSpeedOffroadKMpH = 3.0; + // Default VehicleModel::LimitsInitList const g_bicycleLimitsDefault = { // {{roadType, roadType} {weightSpeedKMpH, etSpeedKMpH} passThroughAllowed} - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // All options available. VehicleModel::LimitsInitList const g_bicycleLimitsAll = { - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, kInCitySpeedBridlewayKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Same as defaults except trunk and trunk_link are not allowed VehicleModel::LimitsInitList const g_bicycleLimitsNoTrunk = { - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Same as defaults except pedestrian is allowed VehicleModel::LimitsInitList const g_bicycleLimitsPedestrianAllowed = { - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Same as defaults except bridleway is allowed VehicleModel::LimitsInitList const g_bicycleLimitsBridlewayAllowed = { - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, kInCitySpeedBridlewayKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Australia @@ -206,47 +206,47 @@ VehicleModel::LimitsInitList const g_bicycleLimitsAustralia = g_bicycleLimitsAll VehicleModel::LimitsInitList const g_bicycleLimitsAustria = { // No trunk, trunk_link, path - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Belarus VehicleModel::LimitsInitList const g_bicycleLimitsBelarus = { // Footway and pedestrian are allowed - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Belgium @@ -254,49 +254,49 @@ VehicleModel::LimitsInitList const g_bicycleLimitsBelgium = { // No trunk, trunk_link // Pedestrian is allowed - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Brazil VehicleModel::LimitsInitList const g_bicycleLimitsBrazil = { // Bridleway and fotway are allowed - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, kInCitySpeedBridlewayKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Denmark @@ -307,23 +307,23 @@ VehicleModel::LimitsInitList const g_bicycleLimitsFrance = { // No trunk, trunk_link // Pedestrian is allowed - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Finland @@ -358,26 +358,26 @@ VehicleModel::LimitsInitList const g_bicycleLimitsRussia = { // Footway and pedestrian are allowed // No pass through service and living_street - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, false}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, false}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, false}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, false}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Slovakia @@ -398,24 +398,24 @@ VehicleModel::LimitsInitList const g_bicycleLimitsUkraine = // No trunk // Footway and perestrian are allowed // No pass through living_street and service - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, false}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, false}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, false}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, false}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // United Kingdom @@ -425,26 +425,26 @@ VehicleModel::LimitsInitList const g_bicycleLimitsUK = g_bicycleLimitsBridlewayA VehicleModel::LimitsInitList const g_bicycleLimitsUS = { // Bridleway and pedesprian are allowed - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, kInCitySpeedBridlewayKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; VehicleModel::SurfaceInitList const g_bicycleSurface = { @@ -478,9 +478,9 @@ void BicycleModel::Init() m_bidirBicycleType = classif().GetTypeByPath({"hwtag", "bidir_bicycle"}); vector<AdditionalRoadTags> const additionalTags = { - {hwtagYesBicycle, m_maxSpeed}, - {{"route", "ferry"}, kOutCitySpeedFerryKMpH}, - {{"man_made", "pier"}, kOutCitySpeedPierKMpH} + {hwtagYesBicycle, m_maxSpeed, m_maxSpeed}, + {{"route", "ferry"}, kOutCitySpeedFerryKMpH, kInCitySpeedFerryKMpH}, + {{"man_made", "pier"}, kOutCitySpeedPierKMpH, kInCitySpeedPierKMpH} }; SetAdditionalRoadTypes(classif(), additionalTags); @@ -510,7 +510,7 @@ bool BicycleModel::IsOneWay(FeatureType & f) const return VehicleModel::IsOneWay(f); } -double BicycleModel::GetOffroadSpeed() const { return kOutCitySpeedOffroadKMpH; } +double BicycleModel::GetOffroadSpeed() const { return kSpeedOffroadKMpH; } // If one of feature types will be disabled for bicycles, features of this type will be simplyfied // in generator. Look FeatureBuilder1::IsRoad() for more details. diff --git a/routing_common/car_model.cpp b/routing_common/car_model.cpp index e6def15ebc..fa0af224a7 100644 --- a/routing_common/car_model.cpp +++ b/routing_common/car_model.cpp @@ -39,7 +39,6 @@ double constexpr kOutCitySpeedFerryMotorcarVehicleKMpH = 15.0; double constexpr kOutCitySpeedRailMotorcarVehicleKMpH = 25.0; double constexpr kOutCitySpeedShuttleTrainKMpH = 25.0; double constexpr kOutCitySpeedPierKMpH = 10.0; -double constexpr kOutCitySpeedOffroadKMpH = 10.0; // Speed of road features located inside cities and towns polygons in km per hour. double constexpr kInCitySpeedMotorwayKMpH = kOutCitySpeedMotorwayKMpH; @@ -63,27 +62,28 @@ double constexpr kInCitySpeedFerryMotorcarVehicleKMpH = kOutCitySpeedFerryMotorc double constexpr kInCitySpeedRailMotorcarVehicleKMpH = kOutCitySpeedRailMotorcarVehicleKMpH; double constexpr kInCitySpeedShuttleTrainKMpH = kOutCitySpeedShuttleTrainKMpH; double constexpr kInCitySpeedPierKMpH = kOutCitySpeedPierKMpH; -double constexpr kInCitySpeedOffroadKMpH = kOutCitySpeedOffroadKMpH; + +double constexpr kSpeedOffroadKMpH = 10.0; VehicleModel::LimitsInitList const g_carLimitsDefault = { // {{roadType, roadType} {weightSpeedKMpH, etSpeedKMpH} passThroughAllowed} - {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, true}, - {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, true}, - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true} + {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, kInCitySpeedMotorwayKMpH, true}, + {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, kInCitySpeedMotorwayLinkKMpH, true}, + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true} /// @todo: Add to classificator //{ {"highway", "shuttle_train"}, 10 }, //{ {"highway", "ferry"}, 5 }, @@ -94,42 +94,42 @@ VehicleModel::LimitsInitList const g_carLimitsDefault = VehicleModel::LimitsInitList const g_carLimitsNoPassThroughLivingStreet = { - {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, true}, - {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, true}, - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, false}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true} + {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, kInCitySpeedMotorwayKMpH, true}, + {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, kInCitySpeedMotorwayLinkKMpH, true}, + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, false}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true} }; VehicleModel::LimitsInitList const g_carLimitsNoPassThroughLivingStreetAndService = { - {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, true}, - {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, true}, - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, false}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, false}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true} + {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, kInCitySpeedMotorwayKMpH, true}, + {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, kInCitySpeedMotorwayLinkKMpH, true}, + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, false}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, false}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true} }; VehicleModel::LimitsInitList const g_carLimitsAustralia = g_carLimitsDefault; @@ -145,21 +145,21 @@ VehicleModel::LimitsInitList const g_carLimitsBrazil = g_carLimitsDefault; VehicleModel::LimitsInitList const g_carLimitsDenmark = { // No track - {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, true}, - {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, true}, - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true} + {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, kInCitySpeedMotorwayKMpH, true}, + {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, kInCitySpeedMotorwayLinkKMpH, true}, + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true} }; VehicleModel::LimitsInitList const g_carLimitsFrance = g_carLimitsDefault; @@ -169,22 +169,22 @@ VehicleModel::LimitsInitList const g_carLimitsFinland = g_carLimitsDefault; VehicleModel::LimitsInitList const g_carLimitsGermany = { // No pass through track - {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, true}, - {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, true}, - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, false} + {{"highway", "motorway"}, kOutCitySpeedMotorwayKMpH, kInCitySpeedMotorwayKMpH, true}, + {{"highway", "motorway_link"}, kOutCitySpeedMotorwayLinkKMpH, kInCitySpeedMotorwayLinkKMpH, true}, + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, false} }; VehicleModel::LimitsInitList const g_carLimitsHungary = g_carLimitsNoPassThroughLivingStreet; @@ -219,12 +219,12 @@ VehicleModel::LimitsInitList const g_carLimitsUS = g_carLimitsDefault; vector<VehicleModel::AdditionalRoadTags> const kAdditionalTags = { // {{highway tags}, {weightSpeed, etaSpeed}} - {{"route", "ferry", "motorcar"}, kOutCitySpeedFerryMotorcarKMpH}, - {{"route", "ferry", "motor_vehicle"}, kOutCitySpeedFerryMotorcarVehicleKMpH}, - {{"railway", "rail", "motor_vehicle"}, kOutCitySpeedRailMotorcarVehicleKMpH}, - {{"route", "shuttle_train"}, kOutCitySpeedShuttleTrainKMpH}, - {{"route", "ferry"}, kOutCitySpeedFerryMotorcarKMpH}, - {{"man_made", "pier"}, kOutCitySpeedPierKMpH} + {{"route", "ferry", "motorcar"}, kOutCitySpeedFerryMotorcarKMpH, kInCitySpeedFerryMotorcarKMpH}, + {{"route", "ferry", "motor_vehicle"}, kOutCitySpeedFerryMotorcarVehicleKMpH, kInCitySpeedFerryMotorcarVehicleKMpH}, + {{"railway", "rail", "motor_vehicle"}, kOutCitySpeedRailMotorcarVehicleKMpH, kInCitySpeedRailMotorcarVehicleKMpH}, + {{"route", "shuttle_train"}, kOutCitySpeedShuttleTrainKMpH, kInCitySpeedShuttleTrainKMpH}, + {{"route", "ferry"}, kOutCitySpeedFerryMotorcarKMpH, kInCitySpeedFerryMotorcarKMpH}, + {{"man_made", "pier"}, kOutCitySpeedPierKMpH, kInCitySpeedPierKMpH} }; VehicleModel::SurfaceInitList const g_carSurface = { @@ -251,7 +251,7 @@ CarModel::CarModel(VehicleModel::LimitsInitList const & roadLimits) InitAdditionalRoadTypes(); } -double CarModel::GetOffroadSpeed() const { return kOutCitySpeedOffroadKMpH; } +double CarModel::GetOffroadSpeed() const { return kSpeedOffroadKMpH; } void CarModel::InitAdditionalRoadTypes() { diff --git a/routing_common/pedestrian_model.cpp b/routing_common/pedestrian_model.cpp index a2e3b7027f..6922ee1a40 100644 --- a/routing_common/pedestrian_model.cpp +++ b/routing_common/pedestrian_model.cpp @@ -51,7 +51,6 @@ double constexpr kOutCitySpeedPedestrianKMpH = 5.0; double constexpr kOutCitySpeedFootwayKMpH = 5.0; double constexpr kOutCitySpeedPlatformKMpH = 5.0; double constexpr kOutCitySpeedPierKMpH = 4.0; -double constexpr kOutCitySpeedOffroadKMpH = 3.0; double constexpr kOutCitySpeedFerryKMpH = 1.0; // Speed of road features located inside cities and towns polygons in km per hour. @@ -77,129 +76,130 @@ double constexpr kInCitySpeedPedestrianKMpH = kOutCitySpeedPedestrianKMpH; double constexpr kInCitySpeedFootwayKMpH = kOutCitySpeedFootwayKMpH; double constexpr kInCitySpeedPlatformKMpH = kOutCitySpeedPlatformKMpH; double constexpr kInCitySpeedPierKMpH = kOutCitySpeedPierKMpH; -double constexpr kInCitySpeedOffroadKMpH = kOutCitySpeedOffroadKMpH; double constexpr kInCitySpeedFerryKMpH = kOutCitySpeedFerryKMpH; +double constexpr kSpeedOffroadKMpH = 3.0; + // Default VehicleModel::LimitsInitList const g_pedestrianLimitsDefault = { // {{roadType, roadType} {weightSpeedKMpH, etSpeedKMpH} passThroughAllowed} - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // All options available. VehicleModel::LimitsInitList const g_pedestrianLimitsAll = { - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, kInCitySpeedBridlewayKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Same as defaults except trunk and trunk link are not allowed. VehicleModel::LimitsInitList const g_pedestrianLimitsNoTrunk = { - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Same as defaults except cycleway is allowed. VehicleModel::LimitsInitList const g_pedestrianLimitsCyclewayAllowed = { - {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, true}, - {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, true}, - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "trunk"}, kOutCitySpeedTrunkKMpH, kInCitySpeedTrunkKMpH, true}, + {{"highway", "trunk_link"}, kOutCitySpeedTrunkLinkKMpH, kInCitySpeedTrunkLinkKMpH, true}, + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Same as defaults except cycleway is allowed and trunk and trunk_link are not allowed. VehicleModel::LimitsInitList const g_pedestrianLimitsCyclewayAllowedNoTrunk = { - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Australia @@ -216,25 +216,25 @@ VehicleModel::LimitsInitList const g_pedestrianLimitsBelgium = { // Trunk and trunk_link are not allowed // Bridleway and cycleway are allowed - {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, true}, - {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, true}, - {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, true}, - {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, true}, - {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, true}, - {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, true}, - {{"highway", "service"}, kOutCitySpeedServiceKMpH, true}, - {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, true}, - {{"highway", "road"}, kOutCitySpeedRoadKMpH, true}, - {{"highway", "track"}, kOutCitySpeedTrackKMpH, true}, - {{"highway", "path"}, kOutCitySpeedPathKMpH, true}, - {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, true}, - {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, true}, - {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, true}, - {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, true}, - {{"highway", "steps"}, kOutCitySpeedStepsKMpH, true}, - {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, true}, - {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, true}, - {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, true} + {{"highway", "primary"}, kOutCitySpeedPrimaryKMpH, kInCitySpeedPrimaryKMpH, true}, + {{"highway", "primary_link"}, kOutCitySpeedPrimaryLinkKMpH, kInCitySpeedPrimaryLinkKMpH, true}, + {{"highway", "secondary"}, kOutCitySpeedSecondaryKMpH, kInCitySpeedSecondaryKMpH, true}, + {{"highway", "secondary_link"}, kOutCitySpeedSecondaryLinkKMpH, kInCitySpeedSecondaryLinkKMpH, true}, + {{"highway", "tertiary"}, kOutCitySpeedTertiaryKMpH, kInCitySpeedTertiaryKMpH, true}, + {{"highway", "tertiary_link"}, kOutCitySpeedTertiaryLinkKMpH, kInCitySpeedTertiaryLinkKMpH, true}, + {{"highway", "service"}, kOutCitySpeedServiceKMpH, kInCitySpeedServiceKMpH, true}, + {{"highway", "unclassified"}, kOutCitySpeedUnclassifiedKMpH, kInCitySpeedUnclassifiedKMpH, true}, + {{"highway", "road"}, kOutCitySpeedRoadKMpH, kInCitySpeedRoadKMpH, true}, + {{"highway", "track"}, kOutCitySpeedTrackKMpH, kInCitySpeedTrackKMpH, true}, + {{"highway", "path"}, kOutCitySpeedPathKMpH, kInCitySpeedPathKMpH, true}, + {{"highway", "bridleway"}, kOutCitySpeedBridlewayKMpH, kInCitySpeedBridlewayKMpH, true}, + {{"highway", "cycleway"}, kOutCitySpeedCyclewayKMpH, kInCitySpeedCyclewayKMpH, true}, + {{"highway", "residential"}, kOutCitySpeedResidentialKMpH, kInCitySpeedResidentialKMpH, true}, + {{"highway", "living_street"}, kOutCitySpeedLivingStreetKMpH, kInCitySpeedLivingStreetKMpH, true}, + {{"highway", "steps"}, kOutCitySpeedStepsKMpH, kInCitySpeedStepsKMpH, true}, + {{"highway", "pedestrian"}, kOutCitySpeedPedestrianKMpH, kInCitySpeedPedestrianKMpH, true}, + {{"highway", "footway"}, kOutCitySpeedFootwayKMpH, kInCitySpeedFootwayKMpH, true}, + {{"highway", "platform"}, kOutCitySpeedPlatformKMpH, kInCitySpeedPlatformKMpH, true} }; // Brazil @@ -320,7 +320,7 @@ PedestrianModel::PedestrianModel(VehicleModel::LimitsInitList const & speedLimit Init(); } -double PedestrianModel::GetOffroadSpeed() const { return kOutCitySpeedOffroadKMpH; } +double PedestrianModel::GetOffroadSpeed() const { return kSpeedOffroadKMpH; } void PedestrianModel::Init() { @@ -330,9 +330,9 @@ void PedestrianModel::Init() m_yesFootType = classif().GetTypeByPath(hwtagYesFoot); vector<AdditionalRoadTags> const additionalTags = { - {hwtagYesFoot, m_maxSpeed}, - {{"route", "ferry"}, kOutCitySpeedFerryKMpH}, - {{"man_made", "pier"}, kOutCitySpeedPierKMpH} + {hwtagYesFoot, m_maxSpeed, m_maxSpeed}, + {{"route", "ferry"}, kOutCitySpeedFerryKMpH, kInCitySpeedFerryKMpH}, + {{"man_made", "pier"}, kOutCitySpeedPierKMpH, kInCitySpeedPierKMpH} }; SetAdditionalRoadTypes(classif(), additionalTags); diff --git a/routing_common/routing_common_tests/vehicle_model_test.cpp b/routing_common/routing_common_tests/vehicle_model_test.cpp index 675927400f..4f37122b65 100644 --- a/routing_common/routing_common_tests/vehicle_model_test.cpp +++ b/routing_common/routing_common_tests/vehicle_model_test.cpp @@ -13,11 +13,12 @@ using namespace std; namespace { routing::VehicleModel::LimitsInitList const s_testLimits = { - {{"highway", "trunk"}, {150 /* weightSpeed */, 150 /* etaSpeed */}, true}, - {{"highway", "primary"}, {120, 120}, true}, - {{"highway", "secondary"}, {80, 70}, true}, - {{"highway", "residential"}, {50, 60}, true}, - {{"highway", "service"}, {50, 40}, false} + // Out of city weight and eta speeds. In city weight and eta speeds. + {{"highway", "trunk"}, {150.0, 150.0}, {100.0, 100.0}, true}, + {{"highway", "primary"}, {120.0, 120.0}, {90.0, 90.0}, true}, + {{"highway", "secondary"}, {80.0, 70.0}, {80.0, 70.0}, true}, + {{"highway", "residential"}, {50.0, 60.0}, {45.0, 55.0}, true}, + {{"highway", "service"}, {50.0, 40.0}, {47.0, 36.0}, false} }; routing::VehicleModel::SurfaceInitList const g_carSurface = { @@ -103,9 +104,9 @@ UNIT_CLASS_TEST(VehicleModelTest, VehicleModel_Speed) CheckSpeed({GetType("highway", "secondary", "tunnel")}, {80.0, 70.0}); CheckSpeed({GetType("highway", "secondary")}, {80.0, 70.0}); - CheckSpeed({GetType("highway", "trunk")}, {150.0, 150.0}); - CheckSpeed({GetType("highway", "primary")}, {120.0, 120.0}); - CheckSpeed({GetType("highway", "residential")}, {50.0, 60.}); + CheckSpeed({GetType("highway", "trunk")}, {100.0, 100.0}); + CheckSpeed({GetType("highway", "primary")}, {90.0, 90.0}); + CheckSpeed({GetType("highway", "residential")}, {45.0, 55.0}); } UNIT_CLASS_TEST(VehicleModelTest, VehicleModel_Speed_MultiTypes) @@ -166,8 +167,8 @@ UNIT_CLASS_TEST(VehicleModelTest, VehicleModel_SpeedFactor) CheckSpeed({secondary, unpavedGood}, {48.0, 56.0}); CheckSpeed({secondary, unpavedBad}, {16.0, 14.0}); - CheckSpeed({residential, pavedGood}, {40.0, 54.0}); - CheckSpeed({residential, pavedBad}, {20.0, 30.0}); - CheckSpeed({residential, unpavedGood}, {30.0, 48.0}); - CheckSpeed({residential, unpavedBad}, {10.0, 12.0}); + CheckSpeed({residential, pavedGood}, {36.0, 49.5}); + CheckSpeed({residential, pavedBad}, {18.0, 27.5}); + CheckSpeed({residential, unpavedGood}, {27.0, 44.0}); + CheckSpeed({residential, unpavedBad}, {9.0, 11.0}); } diff --git a/routing_common/vehicle_model.cpp b/routing_common/vehicle_model.cpp index e9dd00108f..af32d54c1a 100644 --- a/routing_common/vehicle_model.cpp +++ b/routing_common/vehicle_model.cpp @@ -25,7 +25,9 @@ namespace routing { VehicleModel::AdditionalRoadType::AdditionalRoadType(Classificator const & c, AdditionalRoadTags const & tag) - : m_type(c.GetTypeByPath(tag.m_hwtag)), m_speed(tag.m_speed) + : m_type(c.GetTypeByPath(tag.m_hwtag)) + , m_outCitySpeed(tag.m_outCitySpeed) + , m_inCitySpeed(tag.m_inCitySpeed) { } @@ -48,9 +50,9 @@ VehicleModel::VehicleModel(Classificator const & c, LimitsInitList const & featu for (auto const & v : featureTypeLimits) { - m_maxSpeed = Pick<max>(m_maxSpeed, v.m_speed); - m_highwayTypes.emplace(c.GetTypeByPath(vector<string>(v.m_types, v.m_types + 2)), - RoadLimits(v.m_speed, v.m_isPassThroughAllowed)); + m_maxSpeed = Pick<max>(m_maxSpeed, Pick<max>(v.m_outCitySpeed, v.m_inCitySpeed)); + m_highwayTypes.emplace(c.GetTypeByPath(v.m_types), + RoadLimits(v.m_inCitySpeed, v.m_isPassThroughAllowed)); } size_t i = 0; @@ -75,7 +77,7 @@ void VehicleModel::SetAdditionalRoadTypes(Classificator const & c, for (auto const & tag : additionalTags) { m_addRoadTypes.emplace_back(c, tag); - m_maxSpeed = Pick<max>(m_maxSpeed, tag.m_speed); + m_maxSpeed = Pick<max>(m_maxSpeed, Pick<max>(tag.m_outCitySpeed, tag.m_inCitySpeed)); } } @@ -99,6 +101,7 @@ VehicleModel::SpeedKMpH VehicleModel::GetMinTypeSpeed(feature::TypesHolder const VehicleModel::SpeedFactor factor; for (uint32_t t : types) { + // @TODO(bykoianko) Check if there's a feature in city or not and use correct speed. uint32_t const type = ftypes::BaseChecker::PrepareToMatch(t, 2); auto const itHighway = m_highwayTypes.find(type); if (itHighway != m_highwayTypes.cend()) @@ -106,7 +109,7 @@ VehicleModel::SpeedKMpH VehicleModel::GetMinTypeSpeed(feature::TypesHolder const auto const addRoadInfoIter = FindRoadType(t); if (addRoadInfoIter != m_addRoadTypes.cend()) - speed = Pick<min>(speed, addRoadInfoIter->m_speed); + speed = Pick<min>(speed, addRoadInfoIter->m_outCitySpeed); auto const itFactor = find_if(m_surfaceFactors.cbegin(), m_surfaceFactors.cend(), [t](TypeFactor const & v) { return v.m_type == t; }); diff --git a/routing_common/vehicle_model.hpp b/routing_common/vehicle_model.hpp index f6873b2925..f3ad6d7126 100644 --- a/routing_common/vehicle_model.hpp +++ b/routing_common/vehicle_model.hpp @@ -99,9 +99,19 @@ public: struct FeatureTypeLimits final { - char const * m_types[2]; // 2-arity road type - SpeedKMpH m_speed; // max allowed speed on this road type - bool m_isPassThroughAllowed; // pass through this road type is allowed + FeatureTypeLimits(std::vector<std::string> const & types, SpeedKMpH const & outCitySpeed, + SpeedKMpH const & inCitySpeed, bool isPassThroughAllowed) + : m_types(types) + , m_outCitySpeed(outCitySpeed) + , m_inCitySpeed(inCitySpeed) + , m_isPassThroughAllowed(isPassThroughAllowed) + { + } + + std::vector<std::string> m_types; + SpeedKMpH m_outCitySpeed; // Average speed on this road type out of cities. + SpeedKMpH m_inCitySpeed; // Average speed on this road type in cities. + bool m_isPassThroughAllowed; // Pass through this road type is allowed. }; // Structure for keeping surface tags: psurface|paved_good, psurface|paved_bad, @@ -116,13 +126,15 @@ public: { AdditionalRoadTags() = default; - AdditionalRoadTags(std::initializer_list<char const *> const & hwtag, SpeedKMpH const & speed) - : m_hwtag(hwtag), m_speed(speed) + AdditionalRoadTags(std::initializer_list<char const *> const & hwtag, + SpeedKMpH const & outCitySpeed, SpeedKMpH const & inCitySpeed) + : m_hwtag(hwtag), m_outCitySpeed(outCitySpeed), m_inCitySpeed(inCitySpeed) { } std::initializer_list<char const *> m_hwtag; - SpeedKMpH m_speed; + SpeedKMpH m_outCitySpeed; + SpeedKMpH m_inCitySpeed; }; using LimitsInitList = std::initializer_list<FeatureTypeLimits>; @@ -186,8 +198,10 @@ private: AdditionalRoadType(Classificator const & c, AdditionalRoadTags const & tag); bool operator==(AdditionalRoadType const & rhs) const { return m_type == rhs.m_type; } + uint32_t const m_type; - SpeedKMpH const m_speed; + SpeedKMpH m_outCitySpeed; + SpeedKMpH m_inCitySpeed; }; class RoadLimits final |