Adding speed for inside city roads and outside city roads.

This commit is contained in:
Vladimir Byko-Ianko 2018-08-29 15:43:42 +03:00 committed by Vlad Mihaylenko
parent eb599530bf
commit f6f95346db
3 changed files with 84 additions and 5 deletions

View file

@ -28,21 +28,22 @@ namespace
// less bicycle. 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.
// Speed of road features located outside cities and towns polygons in km per hour.
double constexpr kOutCitySpeedTrunkKMpH = 3.0;
double constexpr kOutCitySpeedTrunkLinkKMpH = 3.0;
double constexpr kOutCitySpeedPrimaryKMpH = 5.0;
double constexpr kOutCitySpeedPrimaryLinkKMpH = 5.0;
double constexpr kOutCitySpeedSecondaryKMpH = 15.0;
double constexpr kOutCitySpeedSecondaryLinkKMpH = 15.0;
double constexpr kOutCitySpeedTertiaryKMpH = 15.0;
double constexpr kOutCitySpeedTertiaryLinkKMpH = 15.0;
double constexpr kOutCitySpeedSecondaryKMpH = 20.0;
double constexpr kOutCitySpeedSecondaryLinkKMpH = 20.0;
double constexpr kOutCitySpeedTertiaryKMpH = 20.0;
double constexpr kOutCitySpeedTertiaryLinkKMpH = 20.0;
double constexpr kOutCitySpeedServiceKMpH = 12.0;
double constexpr kOutCitySpeedUnclassifiedKMpH = 12.0;
double constexpr kOutCitySpeedRoadKMpH = 10.0;
double constexpr kOutCitySpeedTrackKMpH = 8.0;
double constexpr kOutCitySpeedPathKMpH = 6.0;
double constexpr kOutCitySpeedBridlewayKMpH = 4.0;
double constexpr kOutCitySpeedCyclewayKMpH = 15.0;
double constexpr kOutCitySpeedCyclewayKMpH = 20.0;
double constexpr kOutCitySpeedResidentialKMpH = 8.0;
double constexpr kOutCitySpeedLivingStreetKMpH = 7.0;
double constexpr kOutCitySpeedStepsKMpH = 1.0;
@ -53,6 +54,32 @@ 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.
double constexpr kInCitySpeedTrunkKMpH = kOutCitySpeedTrunkKMpH;
double constexpr kInCitySpeedTrunkLinkKMpH = kOutCitySpeedTrunkLinkKMpH;
double constexpr kInCitySpeedPrimaryKMpH = 10.0;
double constexpr kInCitySpeedPrimaryLinkKMpH = 10.0;
double constexpr kInCitySpeedSecondaryKMpH = 15.0;
double constexpr kInCitySpeedSecondaryLinkKMpH = 15.0;
double constexpr kInCitySpeedTertiaryKMpH = 15.0;
double constexpr kInCitySpeedTertiaryLinkKMpH = 15.0;
double constexpr kInCitySpeedServiceKMpH = kOutCitySpeedServiceKMpH;
double constexpr kInCitySpeedUnclassifiedKMpH = kOutCitySpeedUnclassifiedKMpH;
double constexpr kInCitySpeedRoadKMpH = kOutCitySpeedRoadKMpH;
double constexpr kInCitySpeedTrackKMpH = kOutCitySpeedTrackKMpH;
double constexpr kInCitySpeedPathKMpH = kOutCitySpeedPathKMpH;
double constexpr kInCitySpeedBridlewayKMpH = kOutCitySpeedBridlewayKMpH;
double constexpr kInCitySpeedCyclewayKMpH = kOutCitySpeedCyclewayKMpH;
double constexpr kInCitySpeedResidentialKMpH = kOutCitySpeedResidentialKMpH;
double constexpr kInCitySpeedLivingStreetKMpH = kOutCitySpeedLivingStreetKMpH;
double constexpr kInCitySpeedStepsKMpH = kOutCitySpeedStepsKMpH;
double constexpr kInCitySpeedPedestrianKMpH = kOutCitySpeedPedestrianKMpH;
double constexpr kInCitySpeedFootwayKMpH = kOutCitySpeedFootwayKMpH;
double constexpr kInCitySpeedPlatformKMpH = kOutCitySpeedPlatformKMpH;
double constexpr kInCitySpeedPierKMpH = kOutCitySpeedPierKMpH;
double constexpr kInCitySpeedOffroadKMpH = kOutCitySpeedOffroadKMpH;
double constexpr kInCitySpeedFerryKMpH = kOutCitySpeedFerryKMpH;
// Default
VehicleModel::LimitsInitList const g_bicycleLimitsDefault =
{

View file

@ -17,6 +17,7 @@ namespace
// See road types here:
// https://wiki.openstreetmap.org/wiki/Key:highway
// Speed of road features located outside cities and towns polygons in km per hour.
double constexpr kOutCitySpeedMotorwayKMpH = 115.37;
double constexpr kOutCitySpeedMotorwayLinkKMpH = 75.0;
double constexpr kOutCitySpeedTrunkKMpH = 93.89;
@ -40,6 +41,30 @@ 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;
double constexpr kInCitySpeedMotorwayLinkKMpH = kOutCitySpeedMotorwayLinkKMpH;
double constexpr kInCitySpeedTrunkKMpH = 70.0;
double constexpr kInCitySpeedTrunkLinkKMpH = 50.0;
double constexpr kInCitySpeedPrimaryKMpH = 65.0;
double constexpr kInCitySpeedPrimaryLinkKMpH = 55.0;
double constexpr kInCitySpeedSecondaryKMpH = 45.0;
double constexpr kInCitySpeedSecondaryLinkKMpH = 40.0;
double constexpr kInCitySpeedTertiaryKMpH = 40.0;
double constexpr kInCitySpeedTertiaryLinkKMpH = 30.0;
double constexpr kInCitySpeedResidentialKMpH = 25.0;
double constexpr kInCitySpeedUnclassifiedKMpH = 25.0;
double constexpr kInCitySpeedServiceKMpH = kOutCitySpeedServiceKMpH;
double constexpr kInCitySpeedLivingStreetKMpH = kOutCitySpeedLivingStreetKMpH;
double constexpr kInCitySpeedRoadKMpH = kOutCitySpeedRoadKMpH;
double constexpr kInCitySpeedTrackKMpH = kOutCitySpeedTrackKMpH;
double constexpr kInCitySpeedFerryMotorcarKMpH = kOutCitySpeedFerryMotorcarKMpH;
double constexpr kInCitySpeedFerryMotorcarVehicleKMpH = kOutCitySpeedFerryMotorcarVehicleKMpH;
double constexpr kInCitySpeedRailMotorcarVehicleKMpH = kOutCitySpeedRailMotorcarVehicleKMpH;
double constexpr kInCitySpeedShuttleTrainKMpH = kOutCitySpeedShuttleTrainKMpH;
double constexpr kInCitySpeedPierKMpH = kOutCitySpeedPierKMpH;
double constexpr kInCitySpeedOffroadKMpH = kOutCitySpeedOffroadKMpH;
VehicleModel::LimitsInitList const g_carLimitsDefault =
{
// {{roadType, roadType} {weightSpeedKMpH, etSpeedKMpH} passThroughAllowed}

View file

@ -28,6 +28,7 @@ namespace
// less pedestrian. 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.
// Speed of road features located outside cities and towns polygons in km per hour.
double constexpr kOutCitySpeedTrunkKMpH = 1.0;
double constexpr kOutCitySpeedTrunkLinkKMpH = 1.0;
double constexpr kOutCitySpeedPrimaryKMpH = 2.0;
@ -53,6 +54,32 @@ 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.
double constexpr kInCitySpeedTrunkKMpH = kOutCitySpeedTrunkKMpH;
double constexpr kInCitySpeedTrunkLinkKMpH = kOutCitySpeedTrunkLinkKMpH;
double constexpr kInCitySpeedPrimaryKMpH = kOutCitySpeedPrimaryKMpH;
double constexpr kInCitySpeedPrimaryLinkKMpH = kOutCitySpeedPrimaryLinkKMpH;
double constexpr kInCitySpeedSecondaryKMpH = kOutCitySpeedSecondaryKMpH;
double constexpr kInCitySpeedSecondaryLinkKMpH = kOutCitySpeedSecondaryLinkKMpH;
double constexpr kInCitySpeedTertiaryKMpH = kOutCitySpeedTertiaryKMpH;
double constexpr kInCitySpeedTertiaryLinkKMpH = kOutCitySpeedTertiaryLinkKMpH;
double constexpr kInCitySpeedServiceKMpH = kOutCitySpeedServiceKMpH;
double constexpr kInCitySpeedUnclassifiedKMpH = kOutCitySpeedUnclassifiedKMpH;
double constexpr kInCitySpeedRoadKMpH = kOutCitySpeedRoadKMpH;
double constexpr kInCitySpeedTrackKMpH = kOutCitySpeedTrackKMpH;
double constexpr kInCitySpeedPathKMpH = kOutCitySpeedPathKMpH;
double constexpr kInCitySpeedBridlewayKMpH = kOutCitySpeedBridlewayKMpH;
double constexpr kInCitySpeedCyclewayKMpH = kOutCitySpeedCyclewayKMpH;
double constexpr kInCitySpeedResidentialKMpH = kOutCitySpeedResidentialKMpH;
double constexpr kInCitySpeedLivingStreetKMpH = kOutCitySpeedLivingStreetKMpH;
double constexpr kInCitySpeedStepsKMpH = kOutCitySpeedStepsKMpH;
double constexpr kInCitySpeedPedestrianKMpH = kOutCitySpeedPedestrianKMpH;
double constexpr kInCitySpeedFootwayKMpH = kOutCitySpeedFootwayKMpH;
double constexpr kInCitySpeedPlatformKMpH = kOutCitySpeedPlatformKMpH;
double constexpr kInCitySpeedPierKMpH = kOutCitySpeedPierKMpH;
double constexpr kInCitySpeedOffroadKMpH = kOutCitySpeedOffroadKMpH;
double constexpr kInCitySpeedFerryKMpH = kOutCitySpeedFerryKMpH;
// Default
VehicleModel::LimitsInitList const g_pedestrianLimitsDefault =
{