MovingPandas.TrajectoryStopDetector

movingpandas: Implementation of Trajectory classes and functions built on top of GeoPandas

class movingpandas.TrajectoryStopDetector(traj)

Detects stops in a trajectory. A stop is detected if the movement stays within an area of specified size for at least the specified duration.

__init__(traj)

Create StopDetector

Parameters:traj (Trajectory or TrajectoryCollection) –
get_stop_points(max_diameter, min_duration)

Returns detected stop location points

Parameters:
  • max_diameter (float) – Maximum diameter for stop detection
  • min_duration (datetime.timedelta) – Minimum stop duration
Returns:

Stop locations as points

Return type:

geopandas.GeoDataFrame

Examples

>>> mpd.TrajectoryStopDetector(traj).get_stop_segments(min_duration=timedelta(seconds=60), max_diameter=100)
get_stop_segments(max_diameter, min_duration)

Returns detected stop trajectory segments

Parameters:
  • max_diameter (float) – Maximum diameter for stop detection
  • min_duration (datetime.timedelta) – Minimum stop duration
Returns:

Trajectory segments

Return type:

TrajectoryCollection

Examples

>>> mpd.TrajectoryStopDetector(traj).get_stop_segments(min_duration=timedelta(seconds=60), max_diameter=100)
get_stop_time_ranges(max_diameter, min_duration)

Returns detected stop start and end times

Parameters:
  • max_diameter (float) – Maximum diameter for stop detection
  • min_duration (datetime.timedelta) – Minimum stop duration
Returns:

TemporalRanges of detected stops

Return type:

list