transbigdata.traj_slice

transbigdata.traj_slice(traj_data, slice_data, traj_col=['vid', 'time'], slice_col=['vid', 'stime', 'etime', 'tripid'])

Slice the trajectory data according to the slice data. This method extracts data from a given set of trajectory data(traj_data) based on a specified time period(slice_data).

Parameters:
  • traj_data (DataFrame) – Trajectory data, containing the trajectory of each vehicle

  • slice_data (DataFrame) – Slice data, containing the start time, end time and vehicleid of each slice

  • traj_col (List) – The column name of trajectory data, in the sequence of [VehicleNum, Time]

  • slice_col (List) – The column name of slice data, in the sequence of [VehicleNum_slice, Stime, Etime, SliceId]

Returns:

data_sliced – The sliced trajectory data

Return type:

DataFrame

Example

>>> tbd.traj_slice(GPSData, move, traj_col=['vid', 'time'], slice_col = ['vid','stime','etime','tripid'])