Documentation ¶
Index ¶
Constants ¶
const ( RouteTypeTram = 0 RouteTypeSubway = 1 RouteTypeRail = 2 RouteTypeBus = 3 RouteTypeFerry = 4 RouteTypeCableCar = 5 RouteTypeGondola = 6 RouteTypeFunicular = 7 ExceptionTypeAdded = 1 ExceptionTypeRemoved = 2 )
Const used in GTFS
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agency ¶
type Agency struct { ID string `csv:"agency_id"` Name string `csv:"agency_name"` URL string `csv:"agency_url"` Timezone string `csv:"agency_timezone"` Langue string `csv:"agency_lang"` Phone string `csv:"agency_phone"` }
Agency -
type Calendar ¶
type Calendar struct { ServiceID string `csv:"service_id"` Monday int `csv:"monday"` Tuesday int `csv:"tuesday"` Wednesday int `csv:"wednesday"` Thursday int `csv:"thursday"` Friday int `csv:"friday"` Saturday int `csv:"saturday"` Sunday int `csv:"sunday"` Start string `csv:"start_date"` End string `csv:"end_date"` }
Calendar -
type CalendarDate ¶
type CalendarDate struct { ServiceID string `csv:"service_id"` Date string `csv:"date"` ExceptionType int `csv:"exception_type"` }
CalendarDate -
type GTFS ¶
type GTFS struct { Path string // The path to the containing directory Agencies []Agency Routes []Route Stops []Stop StopsTimes []StopTime Trips []Trip Calendars []Calendar CalendarDates []CalendarDate Transfers []Transfer Shapes []Shape }
GTFS -
func Load ¶
Load - load GTFS files @param dirPath: the directory containing the GTFS @param filter: It is possible to partialy load the gtfs files If you don't want to load all the files, add an param to the Load function containing only the files that must be loaded Example: Load("path/to/gtfs", map[string]bool{"routes": true}) @return a filled GTFS or an error
func LoadSplitted ¶
LoadSplitted - load splitted GTFS files ==> When GTFS are splitted into sub directories @param dirPath: the directory containing the sub GTFSs @param filter: see Load function @return an array of filled GTFS or an error
type Route ¶
type Route struct { ID string `csv:"route_id"` AgencyID string `csv:"agency_id"` ShortName string `csv:"route_short_name"` LongName string `csv:"route_long_name"` Type int `csv:"route_type"` Desc string `csv:"route_url"` URL string `csv:"route_desc"` Color string `csv:"route_color"` TextColor string `csv:"route_text_color"` }
Route -
type Shape ¶
type Shape struct { ID string `csv:"shape_id"` Sequence int `csv:"shape_pt_sequence"` Latitude float64 `csv:"shape_pt_lat"` Longitude float64 `csv:"shape_pt_lon"` DistanceTraveled float64 `csv:"shape_dist_traveled"` }
Shape -
type Stop ¶
type Stop struct { ID string `csv:"stop_id"` Code string `csv:"stop_code"` Name string `csv:"stop_name"` Description string `csv:"stop_desc"` Latitude float64 `csv:"stop_lat"` Longitude float64 `csv:"stop_lon"` ZoneID string `csv:"zone_id"` Timezone string `csv:"stop_timezone"` Type string `csv:"location_type"` Parent string `csv:"parent_station"` }
Stop -
type StopTime ¶
type StopTime struct { StopID string `csv:"stop_id"` StopSeq int `csv:"stop_sequence"` StopHeadSign string `csv:"stop_headsign"` TripID string `csv:"trip_id"` Shape float64 `csv:"shape_dist_traveled"` Departure string `csv:"departure_time"` Arrival string `csv:"arrival_time"` PickupType int `csv:"pickup_type"` DropOffType int `csv:"drop_off_type"` }
StopTime -
type Transfer ¶
type Transfer struct { FromStopID string `csv:"from_stop_id"` ToStopID string `csv:"to_stop_id"` Type int `csv:"transfer_type"` MinTime int `csv:"min_transfer_time"` }
Transfer -
type Trip ¶
type Trip struct { ID string `csv:"trip_id"` Name string `csv:"trip_short_name"` RouteID string `csv:"route_id"` ServiceID string `csv:"service_id"` ShapeID string `csv:"shape_id"` DirectionID string `csv:"direction_id"` Headsign string `csv:"trip_headsign"` BlockID string `csv:"block_id"` WheelchairAccessible int `csv:"wheelchair_accessible"` }
Trip -