diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2019-01-30 14:16:34 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <bykoianko@gmail.com> | 2019-01-31 14:01:28 +0300 |
commit | e875284de1b621237c2f6b34e398f9948018b0f1 (patch) | |
tree | b92a14860fde0421f587d87d2fbc1d2ecee73fe3 /track_analyzing | |
parent | 65c07dc58f5e9f403669a23fd74c28b5a4b2f47a (diff) |
[track analyzer] Correct usage of none maxspeed and walk maxspeed.
Diffstat (limited to 'track_analyzing')
-rw-r--r-- | track_analyzing/track_analyzer/cmd_table.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/track_analyzing/track_analyzer/cmd_table.cpp b/track_analyzing/track_analyzer/cmd_table.cpp index 05f28147fc..f608bdc7c5 100644 --- a/track_analyzing/track_analyzer/cmd_table.cpp +++ b/track_analyzing/track_analyzer/cmd_table.cpp @@ -46,8 +46,7 @@ using namespace track_analyzing; namespace { -uint16_t constexpr kWalkMaxspeedKMpHValue = 10; -uint16_t constexpr kNoneMaxspeedKMpHValue = 200; +uint16_t constexpr kMaxspeedTopBound = 200; string TypeToString(uint32_t type) { @@ -340,18 +339,9 @@ private: m_featuresVector.GetVector().GetByIndex(featureId, feature); auto const maxspeed = m_maxspeeds.GetMaxspeed(featureId); - auto maxspeedValueKMpH = kInvalidSpeed; - if (maxspeed.IsValid()) - { - maxspeedValueKMpH = maxspeed.GetSpeedKmPH(segment.IsForward()); - if (maxspeedValueKMpH == kNoneMaxSpeed) - maxspeedValueKMpH = kNoneMaxspeedKMpHValue; - - if (maxspeedValueKMpH == kWalkMaxSpeed) - maxspeedValueKMpH = kWalkMaxspeedKMpHValue; - - maxspeedValueKMpH = min(maxspeedValueKMpH, kNoneMaxspeedKMpHValue); - } + auto const maxspeedValueKMpH = maxspeed.IsValid() ? + min(maxspeed.GetSpeedKmPH(segment.IsForward()), kMaxspeedTopBound) : + kInvalidSpeed; m_prevFeatureId = featureId; m_prevRoadInfo = {m_carModelTypes.GetType(feature), |