mappymatch.matchers.lcss.ops#

Functions

add_matches_for_stationary_points(matches, ...)

Takes a set of matches and adds duplicate match entries for stationary

drop_stationary_points(trace, stationary_index)

Drops stationary points from the trace, keeping the first point

find_stationary_points(trace)

Find the positional index of all stationary points in a trace

new_path(road_map, trace)

Computes a shortest path and returns the path

same_trajectory_scheme(scheme1, scheme2)

Compares two trajectory schemes for equality

split_trajectory_segment(road_map, ...)

Splits a trajectory segment based on the provided cutting points.

Classes

StationaryIndex(i_index, c_index)

An index of a stationary point in a trajectory

mappymatch.matchers.lcss.ops.new_path(road_map, trace)[source]#

Computes a shortest path and returns the path

Return type:

List[Road]

Parameters:
Args:

road_map: the road map to match to trace: the trace to match

Returns:

the path that most closely matches the trace

mappymatch.matchers.lcss.ops.split_trajectory_segment(road_map, trajectory_segment)[source]#

Splits a trajectory segment based on the provided cutting points.

Merge back any segments that are too short

Return type:

List[TrajectorySegment]

Parameters:
Args:

road_map: the road map to match to trajectory_segment: the trajectory segment to split distance_epsilon: the distance epsilon

Returns:

a list of split segments or the original segment if it can't be split

mappymatch.matchers.lcss.ops.same_trajectory_scheme(scheme1, scheme2)[source]#

Compares two trajectory schemes for equality

Return type:

bool

Parameters:
Args:

scheme1: the first trajectory scheme scheme2: the second trajectory scheme

Returns:

True if the two schemes are equal, False otherwise

class mappymatch.matchers.lcss.ops.StationaryIndex(i_index: List[int], c_index: List[Any])[source]#

An index of a stationary point in a trajectory

Attributes:

trace_index: the index of the trace coord_index: the index of the coordinate

Parameters:
  • i_index (List[int])

  • c_index (List[Any])

i_index: List[int]#

Alias for field number 0

c_index: List[Any]#

Alias for field number 1

mappymatch.matchers.lcss.ops.find_stationary_points(trace)[source]#

Find the positional index of all stationary points in a trace

Return type:

List[StationaryIndex]

Parameters:

trace (Trace)

Args:

trace: the trace to find the stationary points in

Returns:

a list of stationary indices

mappymatch.matchers.lcss.ops.drop_stationary_points(trace, stationary_index)[source]#

Drops stationary points from the trace, keeping the first point

Return type:

Trace

Parameters:
Args:

trace: the trace to drop the stationary points from stationary_index: the stationary indices to drop

Returns:

the trace with the stationary points dropped

mappymatch.matchers.lcss.ops.add_matches_for_stationary_points(matches, stationary_index)[source]#

Takes a set of matches and adds duplicate match entries for stationary

Return type:

List[Match]

Parameters:
Args:

matches: the matches to add the stationary points to stationary_index: the stationary indices to add

Returns:

the matches with the stationary points added