TransBigData – for Transportation Spatio-Temporal Big Data
Main Functions
TransBigData is a Python package developed for transportation spatio-temporal big data processing and analysis. TransBigData provides fast and concise methods for processing common traffic spatio-temporal big data such as Taxi GPS data, bicycle sharing data and bus GPS data. It includes general methods such as rasterization, data quality analysis, data pre-processing, data set counting, trajectory analysis, GIS processing, map base map loading, coordinate and distance calculation, and data visualization.
Technical Features
Provides different processing methods for different stages of traffic spatio-temporal big data analysis.
The code with TransBigData is clean, efficient, flexible, and easy to use, allowing complex data tasks to be achieved with concise code.
Introduction
Quick Start
pip install -U transbigdata
The following example shows how to use the TransBigData to quickly extract trip OD from taxi GPS data
import transbigdata as tbd
import pandas as pd
data = pd.read_csv('TaxiData-Sample.csv',header = None)
data.columns = ['VehicleNum','time','slon','slat','OpenStatus','Speed']
data
Use the tbd.taxigps_to_od method and pass in the corresponding column name to extract the trip OD:
#Extract OD from GPS data
oddata = tbd.taxigps_to_od(data,col = ['VehicleNum','time','slon','slat','OpenStatus'])
oddata
Aggregate OD into grids:
#define bounds
bounds = [113.6,22.4,114.8,22.9]
#obtain the gridding parameters
params = tbd.grid_params(bounds = bounds,accuracy = 1500)
#gridding OD data and aggregate
od_gdf = tbd.odagg_grid(oddata,params)
od_gdf.plot(column = 'count')