@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.
@@ -65,6 +65,7 @@ export default class GTFSTrip {
65
65
  return {
66
66
  routeGTFSID: this.getRouteGTFSID(),
67
67
  operationDays: this.getOperationDays(),
68
+ calendarID: this.getCalendarName(),
68
69
  tripID: this.getTripID(),
69
70
  shapeID: this.getShapeID(),
70
71
  block: this.getBlock(),
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transportme/load-ptv-gtfs",
3
- "version": "1.4.26",
3
+ "version": "1.4.28",
4
4
  "description": "",
5
5
  "main": "index.mjs",
6
6
  "scripts": {