Documentation
¶
Index ¶
- func GetSupportedExtendedTypeFromExtended(t int16) int16
- func GetTypeFromExtended(t int16) int16
- type Agency
- type Attribution
- type Date
- type FareAttribute
- type FareAttributeRule
- type FeedInfo
- type Frequency
- type LanguageISO6391
- type Level
- type Pathway
- type Route
- type Service
- func (s *Service) Daymap(i int) bool
- func (s *Service) End_date() Date
- func (s *Service) Equals(b *Service) bool
- func (s *Service) Exceptions() map[Date]bool
- func (s *Service) GetExceptionTypeOn(d Date) int8
- func (s *Service) GetFirstActiveDate() Date
- func (s *Service) GetFirstDefinedDate() Date
- func (s *Service) GetLastActiveDate() Date
- func (s *Service) GetLastDefinedDate() Date
- func (s *Service) Id() string
- func (s *Service) IsActiveOn(d Date) bool
- func (d *Service) IsEmpty() bool
- func (s *Service) RawDaymap() uint8
- func (s *Service) SetDaymap(i int, v bool)
- func (s *Service) SetEnd_date(d Date)
- func (s *Service) SetExceptionTypeOn(d Date, t int8)
- func (s *Service) SetExceptions(e map[Date]bool)
- func (s *Service) SetId(id string)
- func (s *Service) SetRawDaymap(i uint8)
- func (s *Service) SetStart_date(d Date)
- func (s *Service) Start_date() Date
- type Shape
- type ShapePoint
- type ShapePoints
- type Stop
- type StopTime
- func (st *StopTime) Arrival_time() Time
- func (st *StopTime) Continuous_drop_off() uint8
- func (st *StopTime) Continuous_pickup() uint8
- func (st *StopTime) Departure_time() Time
- func (st *StopTime) Drop_off_type() uint8
- func (s StopTime) HasDistanceTraveled() bool
- func (st *StopTime) Headsign() *string
- func (st *StopTime) Pickup_type() uint8
- func (st *StopTime) Sequence() int
- func (st *StopTime) SetArrival_time(t Time)
- func (st *StopTime) SetContinuous_drop_off(cdo uint8)
- func (st *StopTime) SetContinuous_pickup(cp uint8)
- func (st *StopTime) SetDeparture_time(t Time)
- func (st *StopTime) SetDrop_off_type(dot uint8)
- func (st *StopTime) SetHeadsign(hs *string)
- func (st *StopTime) SetPickup_type(put uint8)
- func (st *StopTime) SetSequence(seq int)
- func (st *StopTime) SetShape_dist_traveled(d float32)
- func (st *StopTime) SetStop(s *Stop)
- func (st *StopTime) SetTimepoint(tp bool)
- func (st *StopTime) Shape_dist_traveled() float32
- func (st *StopTime) Stop() *Stop
- func (st *StopTime) Timepoint() bool
- type StopTimes
- type Time
- type Timezone
- type TransferKey
- type TransferVal
- type Translation
- type Trip
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTypeFromExtended ¶
Types ¶
type Agency ¶
type Agency struct { Id string Name string Url *url.URL Timezone Timezone Lang LanguageISO6391 Phone string Fare_url *url.URL Email *mail.Address Attributions []*Attribution Translations []*Translation }
An Agency represents a transit agency in GTFS
type Attribution ¶
type Attribution struct { Id string Organization_name string Is_producer bool Is_operator bool Email *mail.Address Url *url.URL Phone string }
An Attribution represents attribution parameters
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
A Date object as used in GTFS
func GetGtfsDateFromTime ¶
GetGtfsDateFromTime constructs a GTFS Date object from a Time object
func (Date) GetOffsettedDate ¶
GetOffsettedDate returns a date offsetted by a certain number of days
type FareAttribute ¶
type FareAttribute struct { Id string Price string Currency_type string Payment_method int Transfers int Agency *Agency Transfer_duration int Rules []*FareAttributeRule }
A FareAttribute is a single fare attribute that applies if certain FareAttributeRules are matched
type FareAttributeRule ¶
type FareAttributeRule struct { Route *Route Origin_id string // connection to Zone_id in Stop Destination_id string // connection to Zone_id in Stop Contains_id string // connection to Zone_id in Stop }
A FareAttributeRule holds rules which describe when a FareAttribute applies
type FeedInfo ¶
type FeedInfo struct { Publisher_name string Publisher_url *url.URL Lang string Start_date Date End_date Date Version string Contact_email *mail.Address Contact_url *url.URL }
FeedInfo holds general information about a GTFS feed
type LanguageISO6391 ¶
type LanguageISO6391 struct {
// contains filtered or unexported fields
}
A LanguageISO6391 struct describes a language according to the ISO 6391 standard
func NewLanguageISO6391 ¶
func NewLanguageISO6391(tofind string) (LanguageISO6391, error)
NewLanguageISO6391 create a new LanguageISO6391 object
func (LanguageISO6391) GetLangString ¶
func (a LanguageISO6391) GetLangString() string
GetLangString returns the two-character string representation of an ISO 6391 language
type Level ¶
type Level struct { Id string Index float32 Name string Translations []*Translation }
A Pathway represents a graph of the station layout
type Pathway ¶
type Pathway struct { Id string From_stop *Stop To_stop *Stop Mode uint8 Is_bidirectional bool Length float32 Traversal_time int Stair_count int Max_slope float32 Min_width float32 Signposted_as string Reversed_signposted_as string Translations []*Translation }
A Pathway represents a graph of the station layout
type Route ¶
type Route struct { Id string Agency *Agency Short_name string Long_name string Desc string Type int16 Url *url.URL Color string Text_color string Sort_order int Continuous_pickup int8 Continuous_drop_off int8 Attributions []*Attribution }
A Route describes a group of trips that are presented to passangers as a single service
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
A Service object describes exactly on what days a trip is served
func EmptyService ¶
func EmptyService() *Service
func (*Service) Equals ¶
Equals returns true if the service is exactly the same - that is if it is active on exactly the same days
func (*Service) Exceptions ¶
func (*Service) GetExceptionTypeOn ¶
GetExceptionTypeOn returns the expection type on a particular day
func (*Service) GetFirstActiveDate ¶
GetFirstActiveDate returns the first active date of this service
func (*Service) GetFirstDefinedDate ¶
GetFirstDefinedDate returns the first date something is defined (either positively or negatively) in this service
func (*Service) GetLastActiveDate ¶
GetLastActiveDate returns the first active date of this service
func (*Service) GetLastDefinedDate ¶
GetLastDefinedDate returns the last date something is defined (either positively or negatively) in this service
func (*Service) IsActiveOn ¶
IsActiveOn returns true if the service is active on a particular date
func (*Service) SetEnd_date ¶
func (*Service) SetExceptionTypeOn ¶
SetExceptionTypeOn sets the expection type on a particular day
func (*Service) SetExceptions ¶
func (*Service) SetRawDaymap ¶
func (*Service) SetStart_date ¶
func (*Service) Start_date ¶
type Shape ¶
type Shape struct { Id string Points ShapePoints }
A Shape describes the geographical path of one or multiple trips
type ShapePoint ¶
A ShapePoint is a single point in a Shape
func (*ShapePoint) HasDistanceTraveled ¶
func (p *ShapePoint) HasDistanceTraveled() bool
HasDistanceTraveled returns true if this ShapePoint has a measurement
func (*ShapePoint) String ¶
func (p *ShapePoint) String() string
Get a string representation of a ShapePoint
type ShapePoints ¶
type ShapePoints []ShapePoint
ShapePoints are multiple ShapePoints
func (ShapePoints) Len ¶
func (shapePoints ShapePoints) Len() int
func (ShapePoints) Less ¶
func (shapePoints ShapePoints) Less(i, j int) bool
func (ShapePoints) Swap ¶
func (shapePoints ShapePoints) Swap(i, j int)
type Stop ¶
type Stop struct { Id string Code string Name string Desc string Lat float32 Lon float32 Location_type int8 Wheelchair_boarding int8 Zone_id string Url *url.URL Parent_station *Stop Translations []*Translation Level *Level Platform_code string Timezone Timezone }
A Stop object describes a single stop location
type StopTime ¶
type StopTime struct {
// contains filtered or unexported fields
}
A StopTime is a single stop with times on a trip
func (*StopTime) Arrival_time ¶
func (*StopTime) Continuous_drop_off ¶
func (*StopTime) Continuous_pickup ¶
func (*StopTime) Departure_time ¶
func (*StopTime) Drop_off_type ¶
func (StopTime) HasDistanceTraveled ¶
HasDistanceTraveled returns true if this ShapePoint has a measurement
func (*StopTime) Pickup_type ¶
func (*StopTime) SetArrival_time ¶
func (*StopTime) SetContinuous_drop_off ¶
func (*StopTime) SetContinuous_pickup ¶
func (*StopTime) SetDeparture_time ¶
func (*StopTime) SetDrop_off_type ¶
func (*StopTime) SetHeadsign ¶
func (*StopTime) SetPickup_type ¶
func (*StopTime) SetSequence ¶
func (*StopTime) SetShape_dist_traveled ¶
func (*StopTime) SetTimepoint ¶
func (*StopTime) Shape_dist_traveled ¶
type Time ¶
Time is a simple GTFS time type
func (Time) GetLocationTime ¶
GetLocationTime returns the time.Time of the gtfs time on a certain date, for a certain agency (which itself holds a timezone)
func (Time) SecondsSinceMidnight ¶
SecondsSinceMidnight returns the number of seconds since midnight
type Timezone ¶
type Timezone struct {
// contains filtered or unexported fields
}
A Timezone describes a single timezone in the world
func NewTimezone ¶
NewTimezone creates a new timezone object
func (Timezone) GetLocation ¶
GetLocation constructs a time.Location object from this GTFS timezone
func (Timezone) GetTzString ¶
GetTzString returns the string representation of a timesone
type TransferKey ¶
type TransferVal ¶
type Translation ¶
type Translation struct { FieldName string Language LanguageISO6391 Translation string FieldValue string }
A Translation holds a single translation for an entity in a GTFS table
type Trip ¶
type Trip struct { Route *Route Service *Service Headsign *string Shape *Shape Id string Short_name *string Block_id *string StopTimes StopTimes Frequencies *[]*Frequency Attributions *[]*Attribution Translations *[]*Translation Direction_id int8 Wheelchair_accessible int8 Bikes_allowed int8 }
A Trip is a single vehicle trip traveling through the network with specific times