forked from artonge/go-gtfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
108 lines (98 loc) · 2.83 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package gtfs
// GTFS -
type GTFS struct {
Path string // The path to the containing directory
Agency Agency
Routes []Route
Stops []Stop
StopsTimes []StopTime
Trips []Trip
Calendars []Calendar
CalendarDates []CalendarDate
Transfers []Transfer
Translations []Translation
}
// 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"`
}
// 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"`
}
// 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"`
Type string `csv:"location_type"`
Parent string `csv:"parent_station"`
}
// StopTime -
type StopTime struct {
StopID string `csv:"stop_id"`
StopSeq string `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"`
}
// 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"`
}
// CalendarDate -
type CalendarDate struct {
ServiceID string `csv:"service_id"`
Date string `csv:"date"`
ExceptionType int `csv:"exception_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"`
}
// 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"`
}
// Translation
type Translation struct {
TranslationId string `csv:"trans_id"`
Translation string `csv:"translation"`
Language string `csv:"lang"`
}