From 5531b1129ba1af40608e1fec1f6d97440ca2b0b7 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Fri, 6 Jun 2025 17:09:11 +0300 Subject: [PATCH] [traffxml] Code comment Signed-off-by: mvglasow --- traffxml/traff_decoder.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/traffxml/traff_decoder.cpp b/traffxml/traff_decoder.cpp index 12fc9a6c5..a67ec2d91 100644 --- a/traffxml/traff_decoder.cpp +++ b/traffxml/traff_decoder.cpp @@ -129,7 +129,12 @@ void TraffDecoder::ApplyTrafficImpact(traffxml::TrafficImpact & impact, traffxml speedKmPH = speed.GetSpeedKmPH(cit->first.GetDir() == traffic::TrafficInfo::RoadSegmentId::kForwardDirection); } auto const idx = cit->first.GetIdx(); - // TODO sum of all lengths may differ from route length by up to ~6%, no idea why + /* + * TODO sum of all lengths may differ from route length by up to ~6% in either direction. + * This is partly due to the fact that route length also includes fake endings, which we are + * not counting here. However, this only explains routes being longer than the sum of all + * lengths calculated here, yet in some cases the route is shorter. + */ auto const length = mercator::DistanceOnEarth(points[idx], points[idx + 1]); if (speedKmPH != routing::kInvalidSpeed) normalDurationS += length * kOneMpSInKmpH / speedKmPH;