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 Patrick Niklaus
parent 754bc2d274
commit c5e1742150
No known key found for this signature in database
GPG Key ID: E426891B5F978B1B

View File

@ -532,7 +532,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)