tracktable.algorithms.distance_geometry module¶
Module contents¶
tracktable.algorithms.distance_geometry - Compute the distance geometry signature of a trajectory.
- tracktable.algorithms.distance_geometry.distance_geometry_by_distance(trajectory, depth)[source]¶
Compute distance geometry signature sampled by length
This function computes the multilevel distance geometry for a given trajectory. Each level d approximates the input trajectory with d equal-length line segments. The distance geometry values for that level are the lengths of all d line segments, normalized to lie between 0 and 1. A value of 1 indicates the length of the entire trajectory.
The D-level distance geometry for a curve will result in (D * (D+1)) / 2 separate values.
This implementation creates the endpoints of the line segments by sampling the trajectory at fractions of total distance traveled. To sample by total duration, use distance_geometry_by_time().
- Parameters
trajectory (Tracktable trajectory) – Input curve to analyze
depth (int) – How many levels to compute. Must be greater than zero.
- Returns
List of distance geometry values laid out consecutively by increasing depth.
- Raises
ValueError –
depth
is not a positive integerBoostPythonArgumentException –
trajectory
is not a Tracktable trajectory
- tracktable.algorithms.distance_geometry.distance_geometry_by_time(trajectory, depth)[source]¶
Compute distance geometry signature sampled by time
This function computes the multilevel distance geometry for a given trajectory. Each level d approximates the input trajectory with d equal-length line segments. The distance geometry values for that level are the lengths of all d line segments, normalized to lie between 0 and 1. A value of 1 indicates the length of the entire trajectory.
The D-level distance geometry for a curve will result in (D * (D+1)) / 2 separate values.
This implementation creates the endpoints of the line segments by sampling the trajectory at fractions of total duration To sample by distance traveled, use distance_geometry_by_distance().
- Parameters
trajectory (Tracktable trajectory) – Input curve to analyze
depth (int) – How many levels to compute. Must be greater than zero.
- Returns
List of distance geometry values laid out consecutively by increasing depth.
- Raises
ValueError –
depth
is not a positive integerBoostPythonArgumentException –
trajectory
is not a Tracktable trajectory