Bus GPS data processing
|
Input bus GPS data, bus route and station GeoDataFrame, this method can identify the bus arrival and departure information |
|
Input the departure information table drive_info and the station information table stop to calculate the one-way travel time |
- transbigdata.busgps_arriveinfo(data, line, stop, col=['VehicleId', 'GPSDateTime', 'lon', 'lat', 'stopname'], stopbuffer=200, mintime=300, disgap=200, project_epsg='auto', timegap=1800, projectoutput=False)
Input bus GPS data, bus route and station GeoDataFrame, this method can identify the bus arrival and departure information
- Parameters:
data (DataFrame) – Bus GPS data. It should be the data from one bus route, and need to contain vehicle ID, GPS time, latitude and longitude (wgs84)
line (GeoDataFrame) – GeoDataFrame for the bus line
stop (GeoDataFrame) – GeoDataFrame for bus stops
col (List) – Column names, in the order of [vehicle ID, time, longitude, latitude, station name]
stopbuffer (number) – Meter. When the vehicle approaches the station within this certain distance, it is considered to be arrive at the station.
mintime (number) – Seconds. Within a short period of time that the bus arrive at bus station again, it will not be consider as another arrival
disgap (number) – Meter. The distance between the front point and the back point of the vehicle, which is used to determine whether the vehicle is moving or not
project_epsg (number) – The matching algorithm will convert the data into a projection coordinate system to calculate the distance, here the epsg code of the projection coordinate system is given
timegap (number) – Seconds. For how long the vehicle does not appear, it will be considered as a new vehicle
projectoutput (bool) – Whether to output the projected data
- Returns:
arrive_info – Bus arrival and departure information
- Return type:
DataFrame
- transbigdata.busgps_onewaytime(arrive_info, start, end, col=['VehicleId', 'stopname', 'arrivetime', 'leavetime'])
Input the departure information table drive_info and the station information table stop to calculate the one-way travel time
- Parameters:
arrive_info (DataFrame) – The departure information table drive_info
start (Str) – Starting station name
end (Str) – Ending station name
col (List) – Column name [vehicle ID, station name,arrivetime,leavetime]
- Returns:
onewaytime – One-way travel time of the bus
- Return type:
DataFrame