| 18 | namespace track_analyzing |
| 19 | { |
| 20 | double CalcSubtrackLength(MatchedTrack::const_iterator begin, MatchedTrack::const_iterator end, Geometry & geometry) |
| 21 | { |
| 22 | double length = 0.0; |
| 23 | |
| 24 | Segment prevSegment; |
| 25 | for (auto it = begin; it != end; ++it) |
| 26 | { |
| 27 | MatchedTrackPoint const & point = *it; |
| 28 | Segment const & segment = point.GetSegment(); |
| 29 | if (segment != prevSegment) |
| 30 | { |
| 31 | length += ms::DistanceOnEarth(geometry.GetPoint(segment.GetRoadPoint(false /* front */)), |
| 32 | geometry.GetPoint(segment.GetRoadPoint(true /* front */))); |
| 33 | prevSegment = segment; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | return length; |
| 38 | } |
| 39 | |
| 40 | double CalcTrackLength(MatchedTrack const & track, Geometry & geometry) |
| 41 | { |
no test coverage detected