Documentation
¶
Overview ¶
Package gtfs contains parsers for GTFS static and realtime feeds.
Index ¶
- func SortScheduledStopTimes(stopTimes []ScheduledStopTime)
- type Agency
- type Alert
- type AlertActivePeriod
- type AlertCause
- type AlertEffect
- type AlertInformedEntity
- type AlertText
- type DirectionID
- type ParseRealtimeOptions
- type ParseStaticOptions
- type Realtime
- type Route
- type RoutePolicy
- type RouteType
- type ScheduledStopTime
- type ScheduledTrip
- type Service
- type Static
- type Stop
- type StopTimeEvent
- type StopTimeUpdate
- type StopType
- type Transfer
- type TransferType
- type Trip
- type TripID
- type Vehicle
- type VehicleID
- type WheelchairBoarding
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortScheduledStopTimes ¶
func SortScheduledStopTimes(stopTimes []ScheduledStopTime)
SortScheduledStopTimes sorts the provided stop times based on the stop sequence field.
Types ¶
type Agency ¶
type Agency struct { Id string Name string Url string Timezone string Language *string Phone *string FareUrl *string Email *string }
Agency corresponds to a single row in the agency.txt file.
type Alert ¶
type Alert struct { ID string Cause AlertCause Effect AlertEffect ActivePeriods []AlertActivePeriod InformedEntities []AlertInformedEntity Header []AlertText Description []AlertText URL []AlertText }
type AlertCause ¶
type AlertCause = gtfsrt.Alert_Cause
const ( UnknownCause AlertCause = gtfsrt.Alert_UNKNOWN_CAUSE OtherCause AlertCause = gtfsrt.Alert_OTHER_CAUSE TechnicalProblem AlertCause = gtfsrt.Alert_TECHNICAL_PROBLEM Strike AlertCause = gtfsrt.Alert_STRIKE Demonstration AlertCause = gtfsrt.Alert_DEMONSTRATION Accident AlertCause = gtfsrt.Alert_ACCIDENT Holiday AlertCause = gtfsrt.Alert_HOLIDAY Weather AlertCause = gtfsrt.Alert_WEATHER Maintenance AlertCause = gtfsrt.Alert_MAINTENANCE Construction AlertCause = gtfsrt.Alert_CONSTRUCTION PoliceActivity AlertCause = gtfsrt.Alert_POLICE_ACTIVITY MedicalEmergency AlertCause = gtfsrt.Alert_MEDICAL_EMERGENCY )
type AlertEffect ¶
type AlertEffect = gtfsrt.Alert_Effect
const ( UnknownEffect AlertEffect = gtfsrt.Alert_UNKNOWN_EFFECT NoService AlertEffect = gtfsrt.Alert_NO_SERVICE ReducedService AlertEffect = gtfsrt.Alert_REDUCED_SERVICE SignificantDelays AlertEffect = gtfsrt.Alert_SIGNIFICANT_DELAYS Detour AlertEffect = gtfsrt.Alert_DETOUR AdditionalService AlertEffect = gtfsrt.Alert_ADDITIONAL_SERVICE ModifiedService AlertEffect = gtfsrt.Alert_MODIFIED_SERVICE OtherEffect AlertEffect = gtfsrt.Alert_OTHER_EFFECT StopMoved AlertEffect = gtfsrt.Alert_STOP_MOVED NoEffect AlertEffect = gtfsrt.Alert_NO_EFFECT AccessibilityIssue AlertEffect = gtfsrt.Alert_ACCESSIBILITY_ISSUE )
type AlertInformedEntity ¶
type DirectionID ¶
type DirectionID uint8
const ( DirectionIDUnspecified DirectionID = 0 DirectionIDTrue DirectionID = 1 DirectionIDFalse DirectionID = 2 )
func (DirectionID) String ¶
func (d DirectionID) String() string
type ParseRealtimeOptions ¶
type ParseRealtimeOptions struct { // The timezone to interpret date field. // // It can be nil, in which case UTC will used. Timezone *time.Location // The GTFS Realtime extension to use when parsing. // // This can be nil, in which case no extension is used. Extension extensions.Extension }
type ParseStaticOptions ¶
type ParseStaticOptions struct{}
type Realtime ¶
Realtime contains the parsed content for a single GTFS realtime message.
func ParseRealtime ¶
func ParseRealtime(content []byte, opts *ParseRealtimeOptions) (*Realtime, error)
type RoutePolicy ¶
type RoutePolicy int32
const ( NotAllowed RoutePolicy = 0 Continuous RoutePolicy = 1 PhoneAgency RoutePolicy = 2 CoordinateWithDriver RoutePolicy = 3 )
func NewRoutePolicy ¶
func NewRoutePolicy(i int) RoutePolicy
func (RoutePolicy) String ¶
func (t RoutePolicy) String() string
type ScheduledStopTime ¶
type ScheduledTrip ¶
type Static ¶
type Static struct { Agencies []Agency Routes []Route Stops []Stop Transfers []Transfer Services []Service Trips []ScheduledTrip }
Static contains the parsed content for a single GTFS static message.
func ParseStatic ¶
func ParseStatic(content []byte, opts ParseStaticOptions) (*Static, error)
ParseStatic parses the content as a GTFS static feed.
type Stop ¶
type StopTimeEvent ¶
type StopTimeUpdate ¶
type StopTimeUpdate struct { StopSequence *uint32 StopID *string Arrival *StopTimeEvent Departure *StopTimeEvent NyctTrack *string }
TODO: shouldn't this just be StopTime?
func (*StopTimeUpdate) GetArrival ¶
func (stopTimeUpdate *StopTimeUpdate) GetArrival() StopTimeEvent
func (*StopTimeUpdate) GetDeparture ¶
func (stopTimeUpdate *StopTimeUpdate) GetDeparture() StopTimeEvent
type Transfer ¶
type Transfer struct { From *Stop To *Stop Type TransferType MinTransferTime *int32 }
type TransferType ¶
type TransferType int32
const ( Recommended TransferType = 0 Timed TransferType = 1 RequiresTime TransferType = 2 TransferNotPossible TransferType = 3 )
func NewTransferType ¶
func NewTransferType(i int32) (TransferType, bool)
func (TransferType) String ¶
func (t TransferType) String() string
type Trip ¶
type Trip struct { ID TripID StopTimeUpdates []StopTimeUpdate NyctIsAssigned bool Vehicle *Vehicle IsEntityInMessage bool }
func (*Trip) GetVehicle ¶
type WheelchairBoarding ¶
type WheelchairBoarding int32
const ( NotSpecified WheelchairBoarding = 0 Possible WheelchairBoarding = 1 NotPossible WheelchairBoarding = 2 )
func NewWheelchairBoarding ¶
func NewWheelchairBoarding(i int) (WheelchairBoarding, bool)
func (WheelchairBoarding) String ¶
func (w WheelchairBoarding) String() string
Directories
¶
Path | Synopsis |
---|---|
Package csv is a wrapper around the stdlib csv library that provides a nice API for the GTFS static parser.
|
Package csv is a wrapper around the stdlib csv library that provides a nice API for the GTFS static parser. |
nycttrips
Package nycttrips contains logic for the New York City Transit GTFS realtime extenstions
|
Package nycttrips contains logic for the New York City Transit GTFS realtime extenstions |
internal
|
|
Click to show internal directories.
Click to hide internal directories.