Taxi GPS data processing

clean_taxi_status(data[, col, timelimit])

Deletes records of instantaneous changes in passenger carrying status from taxi data.

taxigps_to_od(data[, col])

Input Taxi GPS data, extract OD information

taxigps_traj_point(data, oddata[, col])

Input Taxi data and OD data to extract the trajectory points for delivery and idle trips

transbigdata.clean_taxi_status(data, col=['VehicleNum', 'Time', 'OpenStatus'], timelimit=None)

Deletes records of instantaneous changes in passenger carrying status from taxi data. These abnormal records can affect travel order judgments. Judgement method: If the passenger status of the previous record and the next record are different from this record for the same vehicle, then this record should be deleted.

Parameters:
  • data (DataFrame) – Data

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

  • timelimit (number) – Optional, in seconds. If the time between the previous record and the next record is less than the time threshold, then it will be deleted

Returns:

data1 – Cleaned data

Return type:

DataFrame

transbigdata.taxigps_to_od(data, col=['VehicleNum', 'Stime', 'Lng', 'Lat', 'OpenStatus'])

Input Taxi GPS data, extract OD information

Parameters:
  • data (DataFrame) – Taxi GPS data

  • col (List) – Column names in the data, need to be in order [vehicle id, time, longitude, latitude, passenger status]

Returns:

oddata – OD information

Return type:

DataFrame

transbigdata.taxigps_traj_point(data, oddata, col=['Vehicleid', 'Time', 'Lng', 'Lat', 'OpenStatus'])

Input Taxi data and OD data to extract the trajectory points for delivery and idle trips

Parameters:
  • data (DataFrame) – Taxi GPS data, field name specified by col variable

  • oddata (DataFrame) – Taxi OD data

  • col (List) – Column names, need to be in order [vehicle id, time, longitude, latitude, passenger status]

Returns:

  • data_deliver (DataFrame) – Trajectory points for delivery trips

  • data_idle (DataFrame) – Trajectory points for idle trips