Learn R Programming

⚠️There's a newer version (1.4.0) of this package.Take me there.

gtfstools

gtfstools offers a set of convenient tools for editing and analysing transit feeds in GTFS format. Feeds are read as a list of data.tables, allowing for easy and fast data manipulation. Many of this package’s features are based on functions from other packages, especially {tidytransit} and {gtfs2gps}.

Installation

Stable version:

install.packages("gtfstools")

Development version:

# either
install.packages("gtfstools", repos = "https://dhersz.r-universe.dev")

# or
# install.packages("remotes")
remotes::install_github("ipeaGIT/gtfstools")

This package requires a working installation of {sf}. Please check this link for more information on how to install it.

Usage

Please read gtfstools vignettes for more on the package usage:

  • Basic usage: reading, analysing, manipulating and writing feeds. Run vignette("gtfstools") or check it on the website (Introduction to gtfstools).
  • Filtering GTFS feeds. Run vignette("filtering", package = "gtfstools") or check it on the website (Filtering GTFS feeds).

Related packages

Citation

citation("gtfstools")
#> 
#> To cite gtfstools in publications use:
#> 
#>   Daniel Herszenhut, Rafael H. M. Pereira, Pedro R.
#>   Andrade & Joao Bazzo. (2022, May). gtfstools:
#>   General Transit Feed Specification (GTFS) Editing
#>   and Analysing Tools (Version v1.1.0). Zenodo.
#>   http://doi.org/10.5281/zenodo.6577028
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {gtfstools: General Transit Feed Specification (GTFS) Editing and Analysing Tools},
#>     author = {Daniel Herszenhut and Rafael H. M. Pereira and Pedro R. Andrade and Joao Bazzo},
#>     month = {may},
#>     year = {2022},
#>     publisher = {Zenodo},
#>     version = {v1.1.0},
#>     doi = {10.5281/zenodo.6577028},
#>     url = {https://doi.org/10.5281/zenodo.6577028},
#>   }

Acknowledgement

gtfstools is developed by a team at the Institute for Applied Economic Research (Ipea), Brazil.

Copy Link

Version

Install

install.packages('gtfstools')

Monthly Downloads

2,162

Version

1.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Herszenhut

Last Published

May 24th, 2022

Functions in gtfstools (1.1.0)

copy_gtfs_without_file

Make a GTFS copy without a given file
filter_by_route_type

Filter GTFS object by route_type (transport mode)
filter_by_route_id

Filter GTFS object by route_id
filter_by_time_of_day

Filter GTFS object by time of day
filter_by_trip_id

Filter GTFS object by trip_id
get_trip_duration

Get trip duration
get_stop_times_patterns

Get stop times patterns
validate_gtfs

Validate GTFS file
write_gtfs

Write GTFS files
integer_to_date

Convert an integer vector into a Date vector
filter_by_sf

Filter a GTFS object using a simple features object
filter_by_service_id

Filter GTFS object by service_id
set_trip_speed

Set trip average speed
gtfstools

gtfstools: General Transit Feed Specification (GTFS) Editing and Analysing Tools
string_to_seconds

Convert time string to seconds after midnight
filter_by_weekday

Filter GTFS object by weekday
get_parent_station

Get parent stations recursively
get_children_stops

Get children stops recursively
merge_gtfs

Merge GTFS files
read_gtfs

Read GTFS files
filter_by_shape_id

Filter GTFS object by shape_id
get_trip_geometry

Get trip geometry
frequencies_to_stop_times

Convert frequencies to stop times
filter_by_stop_id

Filter GTFS object by stop_id
get_trip_segment_duration

Get trip segments' duration
get_trip_speed

Get trip speed
remove_duplicates

Remove duplicated entries
get_trip_length

Get trip length
seconds_to_string

Convert seconds after midnight to time string
convert_shapes_to_sf

Convert shapes table to simple feature object
copy_gtfs_diff_field_class

Make a GTFS copy with a field of a different class
convert_time_to_seconds

Convert time fields to seconds after midnight
convert_from_standard

Convert a standards-compliant GTFS into a gtfstools' GTFS
convert_stops_to_sf

Convert stops table to simple feature object
convert_to_standard

Convert a gtfstools' GTFS into a standards-compliant GTFS
copy_gtfs_without_field

Make a GTFS copy without a given field from a given file
date_to_integer

Convert a Date vector into an integer vector
filter_by_agency_id

Filter GTFS object by agency_id