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

  • 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)


    Abbreviation for the time unit (default: seconds)

    For more info, check the list of supported units at


>>> 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.


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.


>>> mpd.IqrCleaner(traj).clean(columns={'speed': 3})