transbigdata.traj_clean_drift

transbigdata.traj_clean_drift(data, col=['VehicleNum', 'Time', 'Lng', 'Lat'], method='twoside', speedlimit=80, dislimit=1000, anglelimit=30)

Delete the drift in the trajectory data. The drift is defined as the data with a speed greater than the speed limit or the distance between the current point and the next point is greater than the distance limit or the angle between the current point, the previous point, and the next point is smaller than the angle limit. The speed limit is 80km/h by default, and the distance limit is 1000m by default. The method of cleaning drift data is divided into two methods: ‘oneside’ and ‘twoside’. The ‘oneside’ method is to consider the speed of the current point and the next point, and the ‘twoside’ method is to consider the speed of the current point, the previous point, and the next point.

Parameters:
  • data (DataFrame) – Data

  • col (List) – Column names, in the order of [‘VehicleNum’, ‘Time’, ‘Lng’, ‘Lat’]

  • method (string) – Method of cleaning drift data, including ‘oneside’ and ‘twoside’

  • speedlimit (number) – Speed limitation

  • dislimit (number) – Distance limit

  • anglelimit (number) – Angle limit

Returns:

data1 – Cleaned data

Return type:

DataFrame