22#include <lanelet2_core/primitives/LineString.h>
23#include <lanelet2_core/geometry/Point.h>
24#include <unordered_map>
54 std::unordered_map<lanelet::Id, std::pair<size_t, size_t>>
id_index_map;
65 void pushBack(
const lanelet::LineString2d& ls);
100 double distanceBetween(
size_t index,
size_t p1_index,
size_t p2_index)
const;
131 std::pair<size_t, size_t>
getIndexFromId(
const lanelet::Id&
id)
const;
145 size_t size(
size_t index)
const;
O(1) distance lookup structure for quickly accessing route distance information. NOTE: This structure...
std::pair< size_t, size_t > getIndexFromId(const lanelet::Id &id) const
Returns the indexes of the element identified by the provided Id NOTE: It is up to the user to know i...
std::unordered_map< lanelet::Id, std::pair< size_t, size_t > > id_index_map
void pushBack(const lanelet::LineString2d &ls)
Add a linestring to this structure. This function will iterate over the line string to compute distan...
double elementLength(size_t index) const
Get the length of the linestring located at the provided index.
std::vector< std::tuple< std::vector< double >, double > > accum_lengths
std::pair< size_t, size_t > getElementIndexByDistance(double distance, bool get_point=true) const
Returns index of the linestring which the provided distance is within. NOTE: Unlike the rest of this ...
double distanceToPointAlongElement(size_t index, size_t point_index) const
Get the along-line distance to the point on the provided linestring.
double totalLength() const
Returns the total along-line length of this structure.
double distanceToElement(size_t index) const
Get the distance to the start of the linestring at the specified index.
size_t size() const
Returns number of linestrings in this structure.
double distanceBetween(size_t index, size_t p1_index, size_t p2_index) const
Get the distance between two points on the same linestring.