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).
  • Validating GTFS feeds. Run vignette("validating", package = "gtfstools") or check it on the website (Validating GTFS feeds).

Related packages

Acknowledgement <img align="right"

src="man/figures/ipea_logo.png" alt="IPEA" width="300" />

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

Copy Link

Version

Install

install.packages('gtfstools')

Monthly Downloads

704

Version

1.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Herszenhut

Last Published

November 24th, 2022

Functions in gtfstools (1.2.0)

copy_gtfs_diff_field_class

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

Filter GTFS object by agency_id
filter_by_trip_id

Filter GTFS object by trip_id
filter_by_shape_id

Filter GTFS object by shape_id
filter_by_time_of_day

Filter GTFS object by time of day
filter_by_weekday

Filter GTFS object by weekday
filter_by_route_type

Filter GTFS object by route_type (transport mode)
filter_by_route_id

Filter GTFS object by route_id
filter_by_stop_id

Filter GTFS object by stop_id
filter_by_sf

Filter a GTFS object using a simple features object
filter_by_service_id

Filter GTFS object by service_id
get_children_stops

Get children stops recursively
frequencies_to_stop_times

Convert frequencies to stop times
get_trip_duration

Get trip duration
get_trip_segment_duration

Get trip segments' duration
get_trip_length

Get trip length
get_trip_speed

Get trip speed
get_trip_geometry

Get trip geometry
gtfstools

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

Read GTFS files
write_gtfs

Write GTFS files
string_to_seconds

Convert time string to seconds after midnight
validate_gtfs

Validate GTFS feed
set_trip_speed

Set trip average speed
get_stop_times_patterns

Get stop times patterns
get_parent_station

Get parent stations recursively
seconds_to_string

Convert seconds after midnight to time string
remove_duplicates

Remove duplicated entries
merge_gtfs

Merge GTFS files
integer_to_date

Convert an integer vector into a Date vector
convert_shapes_to_sf

Convert shapes table to simple feature object
convert_stops_to_sf

Convert stops table to simple feature object
convert_time_to_seconds

Convert time fields to seconds after midnight
copy_gtfs_without_file

Make a GTFS copy without a given file
download_validator

Download MobilityData's GTFS validator
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
convert_from_standard

Convert a standards-compliant GTFS into a gtfstools' GTFS