The General Transit Feed Specification (GTFS) is a commonly used model to represent public transit data.
This crates brings serde structures of this model and helpers to read GTFS files.
To get started, see Gtfs.
A Gtfs feed is a collection of CSV files (often bundled as a zip file). Each file represents a collection of one type (stops, lines, etc.) that have relationships through unique identifiers.
This crate reads a feed, deserializes the objects into Rust structs and verifies the relationships.
The RawGtfs representation holds the objects as close as possible to their CSV representation. This allows to check invalid references.
Gtfs re-organizes a bit the data. For instance all the StopTime are included within their corresponding Trip and cannot be accessed directly. If an object references a non existing Id it will be an error.
Many values are integers that are actually enumerations of certain values. We always use Rust enums, like LocationType to represent them, and not the integer value.
We try to stick as closely as possible to the reference. Optional fields are std::option, while missing mandatory elements will result in an error. If a default value is defined, we will use it.
There are two references https://gtfs.org/reference/static and https://developers.google.com/transit/gtfs/reference. They are mostly the same, even if google’s specification has some extensions.
Module for the error management
General informations about the agency running the network. See https://gtfs.org/reference/static/#agencytxt
A calender describes on which days the vehicle runs. See https://gtfs.org/reference/static/#calendartxt
Defines a specific date that can be added or removed from a Calendar. See https://gtfs.org/reference/static/#calendar_datestxt
Defines one possible fare. See https://gtfs.org/reference/static/#fare_attributestxt
Timetables can be defined by the frequency of their vehicles. See <https://gtfs.org/reference/static/#frequenciestxt>
Data structure with all the GTFS objects
Allows to parameterize how the parsing library behaves
Pathway going from a stop to another.
Data structure that map the GTFS csv with little intelligence
A graph representation to describe subway or train, with nodes (the locations) and edges (the pathways).
A route is a commercial line (there can be various stop sequences for a same line). See https://gtfs.org/reference/static/#routestxt
Transfer information between stops
Generic enum to define if a service (like wheelchair boarding) is available
Is the [Trip] accessible with a bike. See https://gtfs.org/reference/static/#tripstxt
Indicates whether a rider can board the transit vehicle anywhere along the vehicle’s travel path
Defines the direction of a [Trip], only for display, not for routing. See https://gtfs.org/reference/static/#tripstxt
Defines if the [Frequency] is exact (the vehicle runs exactly every n minutes) or not
Defines if a [CalendarDate] is added or deleted from a [Calendar]
Describes the kind of [Stop]. See https://gtfs.org/reference/static/#stopstxt
All the objects type from the GTFS specification that this library reads
Indicates in which direction the pathway can be used
Type of pathway between [from_stop] and [to_stop]
Defines where a [FareAttribute] can be paid
Describes if and how a traveller can board or alight the vehicle. See https://gtfs.org/reference/static/#stop_timestxt
Describes if the stop time is exact or not. See https://gtfs.org/reference/static/#stop_timestxt
Defines the type of a [StopTransfer]
Defines how many transfers can be done with on [FareAttribute]