@transportme/load-ptv-gtfs 1.0.6 → 1.0.8
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import async from 'async'
|
|
2
2
|
import merge from './merge-stops.mjs'
|
|
3
3
|
import DatabaseConnection from '@transportme/database/lib/DatabaseConnection.mjs'
|
|
4
|
+
import { TRANSIT_MODES } from '../constants.mjs'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Loads route stop data into the database. This is generated based off the timetable data.
|
|
@@ -59,6 +60,15 @@ export default async function setRouteStops(database) {
|
|
|
59
60
|
gtfsDirection,
|
|
60
61
|
stops: directionStops
|
|
61
62
|
}
|
|
63
|
+
|
|
64
|
+
if (routeData.mode === TRANSIT_MODES.metroTrain) {
|
|
65
|
+
let currentDir = stopsByService[routeGTFSID][gtfsDirection].directionName
|
|
66
|
+
if (currentDir.includes('Flinders Street') || currentDir.includes('Town Hall')) {
|
|
67
|
+
stopsByService[routeGTFSID][gtfsDirection].directionName = 'City'
|
|
68
|
+
} else {
|
|
69
|
+
stopsByService[routeGTFSID][gtfsDirection].directionName = currentDir.slice(0, -16)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
62
72
|
}
|
|
63
73
|
})
|
|
64
74
|
|