fixing unit tests
This commit is contained in:
@@ -426,7 +426,9 @@ void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry)
|
||||
// This can happen if the last coordinate snaps to a node in the unpacked geometry
|
||||
geometry.locations.pop_back();
|
||||
geometry.segment_offsets.back()--;
|
||||
BOOST_ASSERT(next_to_last_step.geometry_end == steps.back().geometry_begin);
|
||||
// since the last geometry includes the location of arrival, the arrival instruction
|
||||
// geometry overlaps with the previous segment
|
||||
BOOST_ASSERT(next_to_last_step.geometry_end == steps.back().geometry_begin + 1);
|
||||
BOOST_ASSERT(next_to_last_step.geometry_begin < next_to_last_step.geometry_end);
|
||||
next_to_last_step.geometry_end--;
|
||||
steps.back().geometry_begin--;
|
||||
|
||||
@@ -104,10 +104,13 @@ std::pair<double, FloatCoordinate> projectPointOnSegment(const FloatCoordinate &
|
||||
{
|
||||
clamped_ratio = 0.;
|
||||
}
|
||||
|
||||
return {clamped_ratio,
|
||||
{
|
||||
source.lon + slope_vector.lon * FloatLongitude(clamped_ratio),
|
||||
source.lat + slope_vector.lat * FloatLatitude(clamped_ratio),
|
||||
FloatLongitude(1.0 - clamped_ratio) * source.lon +
|
||||
target.lon * FloatLongitude(clamped_ratio),
|
||||
FloatLatitude(1.0 - clamped_ratio) * source.lat +
|
||||
target.lat * FloatLatitude(clamped_ratio),
|
||||
}};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user