MovingPandas.TrajectoryCleaner¶
movingpandas: Implementation of Trajectory classes and functions built on top of GeoPandas
- class movingpandas.OutlierCleaner(traj)¶
Speed-based outlier cleaner that cuts away spikes in the trajectory when the speed exceeds the provided speed threshold value
- Parameters:
v_max (speed threshold)
units (tuple) –
Units in which to calculate speed distance : str
Abbreviation for the distance unit (default: CRS units, or metres if geographic)
- timestr
Abbreviation for the time unit (default: seconds)
For more info, check the list of supported units at https://movingpandas.org/units
Examples
>>> mpd.OutlierCleaner(traj).clean(alpha=2)
>>> mpd.OutlierCleaner(traj).clean(v_max=100, units=("km", "h"))
- class movingpandas.IqrCleaner(traj)¶
Interquantile range (IQR) based outlier cleaner.
- Parameters:
columns (dictionary) –
Information regarding the columns that will be used to clean the trajectory and the accompanying thresholds. ex. - {‘speed’: 30, ‘heading’: 360} etc.
Key-value pairs of columns and alpha (IQR multiplier). Note: Setting alpha=3 is widely used.
Examples
>>> mpd.IqrCleaner(traj).clean(columns={'speed': 3})