as_wizardgtfs: Convert a GTFS Feed to 'wizardgtfs'

View source: R/as_wizardgtfs.R

as_wizardgtfsR Documentation

Convert a GTFS Feed to 'wizardgtfs'

Description

Converts a list-like GTFS feed to the class used by GTFSwizard. Character GTFS dates are converted to [Date] values, a date-to-service lookup is created, and missing shapes can optionally be inferred from stop locations.

Usage

as_wizardgtfs(gtfs_list, build_shapes = TRUE, repair = c("legacy", "none"))

Arguments

gtfs_list

A named list of GTFS tables or a 'tidygtfs' object.

build_shapes

Logical. If 'TRUE', infer 'shapes' when the table is absent. Inferred shapes connect stops with straight line segments and are intended for analysis and visualization, not map-matched routing.

repair

'legacy' preserves historical reference cleanup, recording changes in [repair_report()]. Use 'none' to validate without deleting or creating reference records. Use [repair_gtfs()] for explicit time repairs.

Details

The input is checked for required tables, required fields, primary-key duplication, foreign-key consistency, increasing stop and shape sequences, valid service dates, and valid GTFS time strings. Times remain character values because GTFS permits hours greater than 24.

Value

A 'wizardgtfs' object.

See Also

[GTFSwizard::create_gtfs()], [GTFSwizard::get_shapes()]

Examples

gtfs_wizard <- as_wizardgtfs(for_rail_gtfs, build_shapes = TRUE)


GTFSwizard documentation built on Nov. 18, 2026, 1:07 a.m.