Count reverse offset from the back of the geometry, not the front.
This commit is contained in:
parent
714719c377
commit
1d82b01816
@ -465,6 +465,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
|||||||
EdgeDuration{0});
|
EdgeDuration{0});
|
||||||
|
|
||||||
EdgeDistance forward_distance_offset = 0;
|
EdgeDistance forward_distance_offset = 0;
|
||||||
|
// Sum up the distance from the start to the fwd_segment_position
|
||||||
for (auto current = forward_geometry.begin();
|
for (auto current = forward_geometry.begin();
|
||||||
current < forward_geometry.begin() + data.fwd_segment_position;
|
current < forward_geometry.begin() + data.fwd_segment_position;
|
||||||
++current)
|
++current)
|
||||||
@ -494,8 +495,9 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
|||||||
EdgeDuration{0});
|
EdgeDuration{0});
|
||||||
|
|
||||||
EdgeDistance reverse_distance_offset = 0;
|
EdgeDistance reverse_distance_offset = 0;
|
||||||
for (auto current = forward_geometry.begin();
|
// Sum up the distance from just after the fwd_segment_position to the end
|
||||||
current < forward_geometry.end() - data.fwd_segment_position - 2;
|
for (auto current = forward_geometry.begin() + data.fwd_segment_position + 1;
|
||||||
|
current != std::prev(forward_geometry.end());
|
||||||
++current)
|
++current)
|
||||||
{
|
{
|
||||||
reverse_distance_offset += util::coordinate_calculation::fccApproximateDistance(
|
reverse_distance_offset += util::coordinate_calculation::fccApproximateDistance(
|
||||||
|
Loading…
Reference in New Issue
Block a user