Template Function lanelet::geometry::nearestPointAtDistance

Function Documentation

template<typename LineStringT>
traits::PointType<LineStringT> lanelet::geometry::nearestPointAtDistance(LineStringT lineString, double dist)

returns the cosest point to a position on the linestring

This function works in 2d or 3d, depending on the type of the lineString. If the distance is greater length, the end point is returned (or start point if <0).

Parameters:
  • lineString – the lineString to iterate. Size must be >0.

  • dist – distance along linestring. If negative, the lineString is iterated in reversed order.

Returns:

The closest point.