Package: transittraj 1.1.0

Benjamin OBrien

transittraj: Reconstruct and Visualize Transit Vehicle Trajectories

Today's public transit vehicles produce a large amount of automatic vehicle location (AVL) data. This data is very useful for planning and performance studies, but can be noisy, error-prone, and sparse. This package provides tools for cleaning AVL point data and turning it into continuous, differentiable, monotonic, and invertible vehicle trajectory functions, based on the work of Robbennolt et al. (2025) <doi:10.48550/arXiv.2509.00119> and Huang et al. (2023) <doi:10.1109/ITSC57777.2023.10422524>.

Authors:Benjamin O'Brien [aut, cre, cph], Lewis Lehe [aut]

transittraj_1.1.0.tar.gz
transittraj_1.1.0.zip(r-4.7-any)transittraj_1.1.0.zip(r-4.6-any)transittraj_1.1.0.zip(r-4.5-any)
transittraj_1.1.0.tgz(r-4.6-any)transittraj_1.1.0.tgz(r-4.5-any)
transittraj_1.1.0.tar.gz(r-4.7-any)transittraj_1.1.0.tar.gz(r-4.6-any)
transittraj_1.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
transittraj/json (API)

# Install 'transittraj' in R:
install.packages('transittraj', repos = c('https://utel-uiuc.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/utel-uiuc/transittraj/issues

Pkgdown/docs site:https://utel-uiuc.github.io

Datasets:

On CRAN:

Conda:

5.68 score 2 stars 15 scripts 461 downloads 24 exports 97 dependencies

Last updated from:b29c656a89. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK289
source / vignettesOK260
linux-releaseOK254
macos-releaseOK267
macos-oldrelOK228
windows-develOK225
windows-releaseOK190
windows-oldrelOK184
wasm-releaseOK190

Exports:%>%clean_incomplete_tripsclean_jumpsclean_overlapping_subtripsexport_animationfilter_by_routeget_gtfs_service_datesget_gtfs_trajectory_funget_linear_distancesget_shape_geometryget_stop_distancesget_trajectory_funget_trip_extremesgroup_trajectoriesmake_monotonicnew_transittraj_dataplot_animated_lineplot_animated_mapplot_interactive_gtfsplot_trajectoryproject_onto_routetrim_tripsvalidate_monotonicityvalidate_tides

Dependencies:abindbase64encbslibcachemclassclassIntclicpp11crayoncrosstalkcurldata.tableDBIdigestdplyre1071evaluatefarverfastmapfontawesomefsgenericsgeodistgeosgganimateggnewscaleggplot2ggspatialgluegridExtragtablegtfsiohighrhmshtmltoolshtmlwidgetsisobandivsjpegjquerylibjsonliteKernSmoothknitrlabelinglatticelazyevalleafletleaflet.providerslibgeoslifecyclelpSolvemagrittrmemoisemimepillarpkgconfigpngprettyunitsprogressproxypurrrR6rappdirsrasterRColorBrewerRcpprlangrmarkdownrosms2S7sassscalessfsliderspstringistringrterratibbletidyrtidyselecttidytransittinytextransformrtweenrunitsutf8vctrsviridisviridisLitewarpwithrwkxfunyamlzip

Introduction to Trajectories
Introduction | Fitting a Trajectory Curve | Interpolating | Interpolating for Distance from Time | Interpolating for Time from Distance | Interpolating for Time & Distance Pairs Over a Range | Visualizing Trajectories | Quick Plots | Detailed Trajectories | Line Animations | Map Animations | Conclusion

Last update: 2026-09-02
Started: 2026-08-11

The AVL Cleaning Workflow
Introduction | Step 0: Setup | AVL | GTFS | Visualizing our Starting Data | Steps 1 & 2: Buffer & Linearize | Running the Code | Exploring the Results | Step 3: Cleaning Overlapping Subtrips | Step 4: Clean Outlier/Jumps | Step 5: Trim Trip Tails | Step 6: Clean Incomplete Trips | Step 7: Correct for Monotonicity | Conclusion

Last update: 2026-09-02
Started: 2026-09-02

Readme and manuals

Help Manual

Help pageTopics
Filter out entire trips which do not meet distance or duration requirementsclean_incomplete_trips
Apply median filters to detect large jumps (i.e., outliers) in trajectories.clean_jumps
Remove trips with multiple operators or vehicles assigned to the same trip IDclean_overlapping_subtrips
Save an animation at a desired qualityexport_animation
Filter GTFS to a desired route(s) and direction(s)filter_by_route
Get a dataframe of all service dates and their service IDs from a GTFSget_gtfs_service_dates
Fit continuous trajectory interpolating curves from GTFS schedule dataget_gtfs_trajectory_fun
Linearize latitude-longitude GPS points on a provided route shapeget_linear_distances
Get the geometry of a route shapeget_shape_geometry
Get the distances of stops along routesget_stop_distances
Fit continuous trajectory interpolating curves from AVL dataget_trajectory_fun
Get the distance and time range of each trip in a trajectory objectget_trip_extremes
Group existing trajectory objects or split them apartgroup_trajectories
LA Metro AVL Datalacmta_avl
LA Metro GTFSlacmta_gtfs
Correct distance observations, and optionally speeds, to be weakly or strictly monotonicmake_monotonic
Retrieve an object from a particular step of 'transittraj''s workflownew_transittraj_data
Animate vehicle trajectory or AVL dataplot_animated_line plot_animated_map
Generate a Leaflet viewer of GTFS routes and stopsplot_interactive_gtfs
Plot vehicle trajectories or AVL dataplot_trajectory
Quickly plot an AVL trajectoryplot.avltrajectory_group plot.avltrajectory_single
Interpolate time or distance points using AVL trajectoriespredict.avltrajectory_group
Print an AVL trajectory objectprint.avltrajectory_group print.avltrajectory_single
Project points to linear distances along a routeproject_onto_route
Summarize an AVL trajectory objectsummary.avltrajectory_group summary.avltrajectory_single
Remove observations occurring before a trip's minimum distance, or after a trip's maximum distancetrim_trips
Check if AVL data satisfies assumptions of monotonicityvalidate_monotonicity
Check if AVL data meets TIDES standardsvalidate_tides