extract_gtfs: extract_gtfs

extract_gtfsR Documentation

extract_gtfs

Description

Extract data from a GTFS zip archive.

Usage

extract_gtfs(filename = NULL, quiet = FALSE, stn_suffixes = NULL)

Arguments

filename

Name of GTFS archive

quiet

If FALSE, display progress information on screen

stn_suffixes

Any values provided will be removed from terminal characters of station IDs. Useful for feeds like NYC for which some stations are appended with values of "N" and "S" to indicate directions. Specifying stn_suffixes = c ("N", "S") will automatically remove these suffixes.

Value

List of several data.table objects corresponding to the tables present in the nominated GTFS data set.

Note

Column types in each table of the returned object conform to GTFS standards (https://developers.google.com/transit/gtfs/reference), except that "Time" fields in the "stop_times" table are converted to integer values, rather than as character or "Time" objects ("HH:MM:SS"). These can be converted back to comply with GTFS standards by applying the hms::hms() function to the two time columns of the "stop_times" table.

See Also

Other extract: berlin_gtfs_to_zip(), gtfs_timetable()

Examples

berlin_gtfs_to_zip () # Write sample feed from Berlin, Germany to tempdir
f <- file.path (tempdir (), "vbb.zip") # name of feed
gtfs <- extract_gtfs (f)


gtfsrouter documentation built on Sept. 24, 2023, 1:08 a.m.