@transportme/load-ptv-gtfs 1.4.8 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,6 +11,10 @@ export default class GTFSRouteReader extends GTFSReader {
|
|
|
11
11
|
this.#mode = mode
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
getMode() {
|
|
15
|
+
return this.#mode
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
/**
|
|
15
19
|
* Converts a CSV row into a route object
|
|
16
20
|
*
|
|
@@ -30,6 +34,6 @@ export default class GTFSRouteReader extends GTFSReader {
|
|
|
30
34
|
routeName: data.route_long_name
|
|
31
35
|
}
|
|
32
36
|
|
|
33
|
-
return GTFSRoute.create(routeData, this
|
|
37
|
+
return GTFSRoute.create(routeData, this.getMode())
|
|
34
38
|
}
|
|
35
39
|
}
|
|
@@ -12,6 +12,14 @@ export default class GTFSStopsReader extends GTFSReader {
|
|
|
12
12
|
this.#suburbHook = suburbHook
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
getSuburbData() {
|
|
16
|
+
return this.#suburbData
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getSuburbHook() {
|
|
20
|
+
return this.#suburbHook
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
/**
|
|
16
24
|
* Converts a CSV row into a stop object
|
|
17
25
|
*
|
|
@@ -35,6 +43,6 @@ export default class GTFSStopsReader extends GTFSReader {
|
|
|
35
43
|
parentStopGTFSID: data.parent_station
|
|
36
44
|
}
|
|
37
45
|
|
|
38
|
-
return GTFSStop.create(stopData, this
|
|
46
|
+
return GTFSStop.create(stopData, this.getSuburbData(), this.getSuburbHook())
|
|
39
47
|
}
|
|
40
48
|
}
|
|
@@ -13,6 +13,10 @@ export default class GTFSTripReader extends GTFSReader {
|
|
|
13
13
|
this.#routeMappings = routeMappings
|
|
14
14
|
this.#mode = mode
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
getMode() {
|
|
18
|
+
return this.#mode
|
|
19
|
+
}
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* Sets the route ID mappings of the trip reader.
|
|
@@ -31,6 +35,22 @@ export default class GTFSTripReader extends GTFSReader {
|
|
|
31
35
|
this.#calendars = calendars
|
|
32
36
|
}
|
|
33
37
|
|
|
38
|
+
getRouteMappings() {
|
|
39
|
+
return this.#routeMappings
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
getCalendars() {
|
|
43
|
+
return this.#calendars
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
getRouteMapping(routeGTFSID) {
|
|
47
|
+
return this.getRouteMappings()[routeGTFSID]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
getCalendar(calendarID) {
|
|
51
|
+
return this.getCalendars()[calendarID]
|
|
52
|
+
}
|
|
53
|
+
|
|
34
54
|
/**
|
|
35
55
|
* Converts a CSV row into a trip object
|
|
36
56
|
*
|
|
@@ -47,8 +67,8 @@ export default class GTFSTripReader extends GTFSReader {
|
|
|
47
67
|
*/
|
|
48
68
|
processEntity(data) {
|
|
49
69
|
let tripData = {
|
|
50
|
-
routeGTFSID: this
|
|
51
|
-
calendar: this
|
|
70
|
+
routeGTFSID: this.getRouteMapping(data.route_id),
|
|
71
|
+
calendar: this.getCalendar(data.service_id),
|
|
52
72
|
id: data.trip_id,
|
|
53
73
|
shapeID: data.shape_id,
|
|
54
74
|
headsign: data.trip_headsign,
|
|
@@ -56,6 +76,6 @@ export default class GTFSTripReader extends GTFSReader {
|
|
|
56
76
|
block: data.block_id
|
|
57
77
|
}
|
|
58
78
|
|
|
59
|
-
return GTFSTrip.create(tripData, this
|
|
79
|
+
return GTFSTrip.create(tripData, this.getMode())
|
|
60
80
|
}
|
|
61
81
|
}
|