select_waypoints {dynwrap} | R Documentation |
Add or create waypoints to a trajectory
Description
Waypoints are points along the trajectory, which do not necessarily correspond to cells. They are selected in such a way that all parts of the trajectory are covered
Usage
select_waypoints(
trajectory,
n_waypoints = 200,
trafo = sqrt,
resolution = sum(trafo(trajectory$milestone_network$length))/n_waypoints,
recompute = FALSE
)
add_waypoints(
trajectory,
n_waypoints = 200,
trafo = sqrt,
resolution = sum(trafo(trajectory$milestone_network$length))/n_waypoints,
recompute = FALSE
)
is_wrapper_with_waypoints(trajectory)
Arguments
trajectory |
The trajectory as created by |
n_waypoints |
The number of waypoints |
trafo |
Transformation function of the edge lengths |
resolution |
The resolution of the waypoints, measured in the same units as the lengths of the milestone network edges, will be automatically computed using n_waypoints |
recompute |
Force recompute |
Value
add_waypoints
returns the trajectory with waypoints added, which is a list containing:
-
milestone_percentages and progressions: The milestone percentages and progressions of each waypoint, in the same format as the cell equivalents (see
add_trajectory()
) but with a waypoint_id column instead of a cell_id column -
geodesic_distances: a matrix with the geodesic distance of each waypoint (rows) to every cell (columns)
-
waypoint_network: a dataframe containing the network between consecutive waypoints, it contains information on the connected waypoints (from and to) and the edge on which they reside (from_milestone_id and to_milestone_id)
-
waypoints: the waypoint identifiers
**select_waypoints
returns the list as mentioned in add_waypoints