movingpandas.TrajectoryCollection.add_direction#
- TrajectoryCollection.add_direction(overwrite=False, name='direction', n_processes=1, **kwargs)#
Add direction column and values to the trajectories.
The direction is calculated between consecutive locations. Direction values are in degrees, starting North turning clockwise.
- Parameters:
overwrite (bool) – Whether to overwrite existing direction values (default: False)
name (str) – Name of the direction column (default: “direction”)
n_processes (int or None, optional) – Number of processes to use for computation (default: 1). If set to None, the number of processes will be set to os.cpu_count(), enabling full CPU utilization via multiprocessing.
n_threads (int, optional) – DEPRECATED. Use n_processes instead. This parameter will be removed in a future version.