@transportme/load-ptv-gtfs 1.4.26 → 1.4.28
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.
|
@@ -51,7 +51,11 @@ export default class GTFSStopTimesReader {
|
|
|
51
51
|
|
|
52
52
|
return {
|
|
53
53
|
tripID,
|
|
54
|
-
stops: lines.map(line => this.processEntity(line))
|
|
54
|
+
stops: lines.map(line => this.processEntity(line)).filter((stop, i, arr) => {
|
|
55
|
+
if (i === 0) return true
|
|
56
|
+
const prev = arr[i - 1]
|
|
57
|
+
return !(prev.stopID === stop.stopID && prev.stopSequence === stop.stopSequence)
|
|
58
|
+
})
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
|
|
@@ -130,7 +130,7 @@ export default class TripLoader {
|
|
|
130
130
|
let stopTimings = await async.map(stops, async stop => {
|
|
131
131
|
let stopData = await this.findMatchingStop(stop.stopID)
|
|
132
132
|
if (!stopData) throw new Error(`Failed to match stop ${stop.stopID} in trip ${tripData.getTripID()}`)
|
|
133
|
-
let bay = stopData.bays.find(bay => bay.stopGTFSID === stop.stopID)
|
|
133
|
+
let bay = stopData.bays.find(bay => bay.stopGTFSID === stop.stopID && bay.mode === this.#mode)
|
|
134
134
|
|
|
135
135
|
let data = {
|
|
136
136
|
stopName: bay.fullStopName,
|