fix post-processing for local paths, fixes #2310

This commit is contained in:
Moritz Kobitzsch 2016-04-25 11:35:32 +02:00 committed by Daniel J. Hofmann
parent 823dcbf511
commit 598d5fbb67

View File

@ -331,7 +331,7 @@ void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry)
BOOST_ASSERT(geometry.locations.size() >= steps.size());
// Look for distances under 1m
const bool zero_length_step = steps.front().distance <= 1;
const bool zero_length_step = steps.front().distance <= 1 && steps.size() > 2;
const bool duplicated_coordinate = util::coordinate_calculation::haversineDistance(
geometry.locations[0], geometry.locations[1]) <= 1;
if (zero_length_step || duplicated_coordinate)