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" json:"trip_id"` Name string `csv:"agency_name" json:"agency_name"` URL string `csv:"agency_url" json:"agency_url"` Timezone string `csv:"agency_timezone" json:"agency_timezone"` Langue string `csv:"agency_lang" json:"agency_lang"` Phone string `csv:"agency_phone" json:"agency_phone"` }
Agency -
type Calendar ¶
type Calendar struct { ServiceID string `csv:"service_id" json:"trip_id"` Monday int `csv:"monday" json:"monday"` Tuesday int `csv:"tuesday" json:"tuesday"` Wednesday int `csv:"wednesday" json:"wednesday"` Thursday int `csv:"thursday" json:"thursday"` Friday int `csv:"friday" json:"friday"` Saturday int `csv:"saturday" json:"saturday"` Sunday int `csv:"sunday" json:"sunday"` Start string `csv:"start_date" json:"start_date"` End string `csv:"end_date" json:"end_date"` }
Calendar -
type CalendarDate ¶
type CalendarDate struct { ServiceID string `csv:"service_id" json:"service_id"` Date string `csv:"date" json:"date"` ExceptionType int `csv:"exception_type" json:"exception_type"` }
CalendarDate -
type GTFS ¶
type GTFS struct { Path string `json:"path"` // The path to the containing directory Agency Agency `json:"agency"` Agencies []Agency `json:"agencies"` Routes []Route `json:"routes"` Stops []Stop `json:"stops"` StopsTimes []StopTime `json:"stop_times"` Trips []Trip `json:"trips"` Calendars []Calendar `json:"calendars"` CalendarDates []CalendarDate `json:"calendar_dates"` Transfers []Transfer `json:"transfer"` }
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" json:"route_id"` AgencyID string `csv:"agency_id" json:"agency_id"` ShortName string `csv:"route_short_name" json:"route_short_name"` LongName string `csv:"route_long_name" json:"route_long_name"` Type int `csv:"route_type" json:"route_type"` Desc string `csv:"route_url" json:"route_url"` URL string `csv:"route_desc" json:"route_desc"` Color string `csv:"route_color" json:"route_color"` TextColor string `csv:"route_text_color" json:"route_text_color"` }
Route -
type Stop ¶
type Stop struct { ID string `csv:"stop_id" json:"trip_id"` Code string `csv:"stop_code" json:"stop_code"` Name string `csv:"stop_name" json:"stop_name"` Description string `csv:"stop_desc" json:"stop_desc"` Latitude float64 `csv:"stop_lat" json:"stop_lat"` Longitude float64 `csv:"stop_lon" json:"stop_lon"` ZoneID string `csv:"zone_id" json:"zone_id"` Type string `csv:"location_type" json:"location_type"` Parent string `csv:"parent_station" json:"parent_station"` }
Stop -
type StopTime ¶
type StopTime struct { StopID string `csv:"stop_id" json:"stop_id"` StopSeq string `csv:"stop_sequence" json:"stop_sequence"` StopHeadSign string `csv:"stop_headsign" json:"stop_headsign"` TripID string `csv:"trip_id" json:"trip_id"` Shape int `csv:"shape_dist_traveled" json:"shape_dist_traveled"` Departure string `csv:"departure_time" json:"departure_time"` Arrival string `csv:"arrival_time" json:"arrival_time"` PickupType int `csv:"pickup_type" json:"pickup_type"` DropOffType int `csv:"drop_off_type" json:"drop_off_type"` }
StopTime -
type Transfer ¶
type Transfer struct { FromStopID string `csv:"from_stop_id" json:"trip_id"` ToStopID string `csv:"to_stop_id" json:"to_stop_id"` Type int `csv:"transfer_type" json:"transfer_type"` MinTime int `csv:"min_transfer_time" json:"min_transfer_time"` }
Transfer -
type Trip ¶
type Trip struct { ID string `csv:"trip_id" json:"trip_id"` Name string `csv:"trip_short_name" json:"trip_short_name"` RouteID string `csv:"route_id" json:"route_id"` ServiceID string `csv:"service_id" json:"service_id"` ShapeID string `csv:"shape_id" json:"shape_id"` DirectionID string `csv:"direction_id" json:"direction_id"` Headsign string `csv:"trip_headsign" json:"trip_headsign"` }
Trip -