@transportme/load-ptv-gtfs 1.4.2 → 1.4.3
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.
- package/lib/gtfs-parser/GTFSRoute.mjs +22 -4
- package/lib/gtfs-parser/GTFSTrip.mjs +23 -1
- package/lib/gtfs-parser/readers/GTFSCalendarReader.mjs +1 -0
- package/lib/gtfs-parser/readers/line-reader.mjs +1 -6
- package/lib/loader/TripLoader.mjs +1 -0
- package/package.json +1 -1
- package/.github/workflows/unit-test.yml +0 -46
- package/test/gtfs-calendar.test.mjs +0 -182
- package/test/gtfs-route-loader.test.mjs +0 -208
- package/test/gtfs-routes.test.mjs +0 -77
- package/test/gtfs-shapes-loader.test.mjs +0 -105
- package/test/gtfs-shapes.test.mjs +0 -23
- package/test/gtfs-stop-loader.test.mjs +0 -415
- package/test/gtfs-stop-times.test.mjs +0 -37
- package/test/gtfs-stops.test.mjs +0 -311
- package/test/gtfs-trip-loader.test.mjs +0 -188
- package/test/gtfs-trips.test.mjs +0 -108
- package/test/line-reader.test.mjs +0 -120
- package/test/merge-stops-full.test.mjs +0 -118
- package/test/merge-stops.test.mjs +0 -376
- package/test/new-metro-loader-test.test.mjs +0 -244
- package/test/new-tram-format.test.mjs +0 -49
- package/test/newer-metro-loader-test.test.mjs +0 -80
- package/test/newer-tram-format.test.mjs +0 -67
- package/test/ptv-gtfs.test.mjs +0 -106
- package/test/sample-data/calendar/calendar.txt +0 -34
- package/test/sample-data/calendar/calendar_dates.txt +0 -26
- package/test/sample-data/gtfs-splitting/force_unique_stops_bus.txt +0 -7
- package/test/sample-data/gtfs-splitting/force_unique_stops_tram.txt +0 -3
- package/test/sample-data/gtfs-splitting/general-stores.txt +0 -19
- package/test/sample-data/gtfs-splitting/line_reader_test.txt +0 -8
- package/test/sample-data/gtfs-splitting/name_overrides.txt +0 -4
- package/test/sample-data/gtfs-splitting/sample_stops.txt +0 -20
- package/test/sample-data/gtfs-splitting/special_chars_stops_csv.txt +0 -6
- package/test/sample-data/gtfs-splitting/stops_without_secondary.txt +0 -6
- package/test/sample-data/gtfs-splitting/union_with_spaces.txt +0 -5
- package/test/sample-data/gtfs-unzipping/gtfs.zip +0 -0
- package/test/sample-data/merge/shapes.txt +0 -1224
- package/test/sample-data/merge/stop_times.txt +0 -103
- package/test/sample-data/merge/stops.txt +0 -39
- package/test/sample-data/merge/trips.txt +0 -7
- package/test/sample-data/mtm-rail/stops.txt +0 -4
- package/test/sample-data/new-metro/calendar.txt +0 -13
- package/test/sample-data/new-metro/calendar_dates.txt +0 -1
- package/test/sample-data/new-metro/routes.txt +0 -18
- package/test/sample-data/new-metro/simple_stop_test.txt +0 -6
- package/test/sample-data/new-metro/stop_times.txt +0 -64
- package/test/sample-data/new-metro/stops.txt +0 -139
- package/test/sample-data/new-metro/trips.txt +0 -6
- package/test/sample-data/new-metro-2/calendar.txt +0 -13
- package/test/sample-data/new-metro-2/calendar_dates.txt +0 -1
- package/test/sample-data/new-metro-2/routes.txt +0 -2
- package/test/sample-data/new-metro-2/stop_times.txt +0 -5
- package/test/sample-data/new-metro-2/stops.txt +0 -9
- package/test/sample-data/new-metro-2/trips.txt +0 -2
- package/test/sample-data/new-tram/routes.txt +0 -25
- package/test/sample-data/new-tram/stops.txt +0 -5
- package/test/sample-data/new-tram-2/routes.txt +0 -25
- package/test/sample-data/new-tram-2/stops.txt +0 -8
- package/test/sample-data/one_line.csv +0 -2
- package/test/sample-data/parent-stop/multi_stop.txt +0 -4
- package/test/sample-data/parent-stop/stops.txt +0 -15
- package/test/sample-data/routes/agency.txt +0 -12
- package/test/sample-data/routes/bad_routes.txt +0 -4
- package/test/sample-data/routes/metro_bus_routes.txt +0 -4
- package/test/sample-data/routes/metro_lines.txt +0 -8
- package/test/sample-data/routes/regional_bus_routes.txt +0 -7
- package/test/sample-data/routes/vline.txt +0 -7
- package/test/sample-data/routes/west_gipp_transit.txt +0 -20
- package/test/sample-data/shapes/shapes.txt +0 -89
- package/test/sample-data/shapes/stop_times.txt +0 -9
- package/test/sample-data/shapes/stops.txt +0 -4
- package/test/sample-data/shapes/trips.txt +0 -4
- package/test/sample-data/stop-data/name-overrides.json +0 -25
- package/test/sample-data/stop-data/unique-stops.json +0 -1
- package/test/sample-data/suburbs.json +0 -77
- package/test/sample-data/trips/bus_trips.txt +0 -5
- package/test/sample-data/trips/stop_times.txt +0 -29
- package/test/sample-data/trips/stops.txt +0 -93
- package/test/sample-data/trips/trips.txt +0 -5
- package/test/utils-test.mjs +0 -12
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
import url from 'url'
|
|
4
|
-
import CSVLineReader from '../lib/gtfs-parser/readers/line-reader.mjs'
|
|
5
|
-
|
|
6
|
-
const __filename = url.fileURLToPath(import.meta.url)
|
|
7
|
-
const __dirname = path.dirname(__filename)
|
|
8
|
-
|
|
9
|
-
const stopsFile = path.join(__dirname, 'sample-data', 'gtfs-splitting', 'line_reader_test.txt')
|
|
10
|
-
const oneLineFile = path.join(__dirname, 'sample-data', 'one_line.csv')
|
|
11
|
-
|
|
12
|
-
const noQuotesFile = path.join(__dirname, 'sample-data', 'mtm-rail', 'stops.txt')
|
|
13
|
-
|
|
14
|
-
describe('The CSVLineReader class', () => {
|
|
15
|
-
it('Should open a CSV file and identify the headers', async () => {
|
|
16
|
-
let reader = new CSVLineReader(stopsFile)
|
|
17
|
-
await reader.open()
|
|
18
|
-
|
|
19
|
-
expect(reader.getHeaders()).to.deep.equal([
|
|
20
|
-
'stop_id', 'stop_name', 'stop_lat', 'stop_lon'
|
|
21
|
-
])
|
|
22
|
-
|
|
23
|
-
await reader.close()
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
it('Can handle files that are not quoted', async () => {
|
|
27
|
-
let reader = new CSVLineReader(noQuotesFile)
|
|
28
|
-
await reader.open()
|
|
29
|
-
|
|
30
|
-
let line = await reader.nextLine()
|
|
31
|
-
expect(line).to.deep.equal({
|
|
32
|
-
stop_id: '77945',
|
|
33
|
-
stop_code: '',
|
|
34
|
-
stop_name: 'Alamein_Up',
|
|
35
|
-
stop_desc: '',
|
|
36
|
-
stop_lat: '-37.868383',
|
|
37
|
-
stop_lon: '145.079837',
|
|
38
|
-
zone_id: '',
|
|
39
|
-
stop_url: '',
|
|
40
|
-
location_type: '0',
|
|
41
|
-
parent_station: '',
|
|
42
|
-
stop_timezone: '',
|
|
43
|
-
wheelchair_boarding: '',
|
|
44
|
-
platform_code: '',
|
|
45
|
-
tts_stop_name: ''
|
|
46
|
-
})
|
|
47
|
-
await reader.close()
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
it('Should return the first line of the CSV, with the fields mapped to their headers', async () => {
|
|
51
|
-
let reader = new CSVLineReader(stopsFile)
|
|
52
|
-
await reader.open()
|
|
53
|
-
|
|
54
|
-
let line = await reader.nextLine()
|
|
55
|
-
expect(line).to.deep.equal({
|
|
56
|
-
stop_id: '1000',
|
|
57
|
-
stop_name: 'Dole Ave/Cheddar Rd (Reservoir)',
|
|
58
|
-
stop_lat: '-37.7007748061827',
|
|
59
|
-
stop_lon: '145.018951051008'
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
await reader.close()
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
it('Should be able to peek if a line is available', async () => {
|
|
66
|
-
let reader = new CSVLineReader(stopsFile)
|
|
67
|
-
await reader.open()
|
|
68
|
-
|
|
69
|
-
for (let i = 0; i < 6; i++) await reader.nextLine()
|
|
70
|
-
|
|
71
|
-
expect(reader.available()).to.be.true
|
|
72
|
-
expect(await reader.nextLine()).to.deep.equal({
|
|
73
|
-
stop_id: '10011',
|
|
74
|
-
stop_name: 'Moffat St/Main Rd West (St Albans)',
|
|
75
|
-
stop_lat: '-37.7423246041343',
|
|
76
|
-
stop_lon: '144.783466504334'
|
|
77
|
-
})
|
|
78
|
-
expect(reader.available()).to.be.false
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
it('Should be unable to unread a single line from the file', async () => {
|
|
82
|
-
let reader = new CSVLineReader(stopsFile)
|
|
83
|
-
await reader.open()
|
|
84
|
-
let expectedLine = {
|
|
85
|
-
stop_id: '1000',
|
|
86
|
-
stop_name: 'Dole Ave/Cheddar Rd (Reservoir)',
|
|
87
|
-
stop_lat: '-37.7007748061827',
|
|
88
|
-
stop_lon: '145.018951051008'
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
let line = await reader.nextLine()
|
|
92
|
-
expect(line).to.deep.equal(expectedLine)
|
|
93
|
-
reader.unreadLine()
|
|
94
|
-
|
|
95
|
-
expect(await reader.nextLine()).to.deep.equal(expectedLine)
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
it('Should be unable to unread the last line from the file, then read it again', async () => {
|
|
99
|
-
let reader = new CSVLineReader(oneLineFile)
|
|
100
|
-
|
|
101
|
-
await reader.open()
|
|
102
|
-
let expectedLine = {
|
|
103
|
-
trip_id: '1.T2.2-ALM-vpt-1.1.R'
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
expect(reader.available()).to.be.true
|
|
107
|
-
let line = await reader.nextLine()
|
|
108
|
-
expect(line).to.deep.equal(expectedLine)
|
|
109
|
-
|
|
110
|
-
expect(reader.available(), 'No more data should be available').to.be.false
|
|
111
|
-
|
|
112
|
-
reader.unreadLine()
|
|
113
|
-
|
|
114
|
-
expect(reader.available(), 'More data should be available after unreading the last line').to.be.true
|
|
115
|
-
|
|
116
|
-
expect(await reader.nextLine()).to.deep.equal(expectedLine)
|
|
117
|
-
|
|
118
|
-
expect(reader.available()).to.be.false
|
|
119
|
-
})
|
|
120
|
-
})
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
import url from 'url'
|
|
4
|
-
import { TRANSIT_MODES } from '../lib/constants.mjs'
|
|
5
|
-
import { LokiDatabaseConnection } from '@transportme/database'
|
|
6
|
-
import StopsLoader from '../lib/loader/StopsLoader.mjs'
|
|
7
|
-
import RouteLoader from '../lib/loader/RouteLoader.mjs'
|
|
8
|
-
import TripLoader from '../lib/loader/TripLoader.mjs'
|
|
9
|
-
import ShapeLoader from '../lib/loader/ShapeLoader.mjs'
|
|
10
|
-
import setRouteStops from '../lib/post-processing/set-route-stops.mjs'
|
|
11
|
-
import suburbs from './sample-data/suburbs.json' with { type: 'json' }
|
|
12
|
-
|
|
13
|
-
const __filename = url.fileURLToPath(import.meta.url)
|
|
14
|
-
const __dirname = path.dirname(__filename)
|
|
15
|
-
|
|
16
|
-
const routesFile = path.join(__dirname, 'sample-data', 'routes', 'metro_lines.txt')
|
|
17
|
-
const agencyFile = path.join(__dirname, 'sample-data', 'routes', 'agency.txt')
|
|
18
|
-
|
|
19
|
-
const calendarFile = path.join(__dirname, 'sample-data', 'calendar', 'calendar.txt')
|
|
20
|
-
const calendarDatesFile = path.join(__dirname, 'sample-data', 'calendar', 'calendar_dates.txt')
|
|
21
|
-
|
|
22
|
-
const stopsFile = path.join(__dirname, 'sample-data', 'merge', 'stops.txt')
|
|
23
|
-
const stopTimesFile = path.join(__dirname, 'sample-data', 'merge', 'stop_times.txt')
|
|
24
|
-
const tripsFile = path.join(__dirname, 'sample-data', 'merge', 'trips.txt')
|
|
25
|
-
const shapeFile = path.join(__dirname, 'sample-data', 'merge', 'shapes.txt')
|
|
26
|
-
|
|
27
|
-
let database = new LokiDatabaseConnection('test-db')
|
|
28
|
-
let stops = await database.createCollection('gtfs-stops')
|
|
29
|
-
let routes = await database.createCollection('gtfs-routes')
|
|
30
|
-
let trips = await database.createCollection('gtfs-gtfs timetables')
|
|
31
|
-
|
|
32
|
-
let stopLoader = new StopsLoader(stopsFile, suburbs, TRANSIT_MODES.metroTrain, database)
|
|
33
|
-
await stopLoader.loadStops()
|
|
34
|
-
|
|
35
|
-
let routeLoader = new RouteLoader(routesFile, agencyFile, TRANSIT_MODES.metroTrain, database)
|
|
36
|
-
await routeLoader.loadRoutes()
|
|
37
|
-
|
|
38
|
-
let routeIDMap = routeLoader.getRouteIDMap()
|
|
39
|
-
|
|
40
|
-
let tripLoader = new TripLoader({
|
|
41
|
-
tripsFile, stopTimesFile,
|
|
42
|
-
calendarFile, calendarDatesFile
|
|
43
|
-
}, TRANSIT_MODES.metroTrain, database)
|
|
44
|
-
|
|
45
|
-
await tripLoader.loadTrips({ routeIDMap })
|
|
46
|
-
let shapeIDMap = tripLoader.getShapeIDMap()
|
|
47
|
-
let directionIDMap = tripLoader.getDirectionIDMap()
|
|
48
|
-
|
|
49
|
-
let shapeLoader = new ShapeLoader(shapeFile, database)
|
|
50
|
-
|
|
51
|
-
await shapeLoader.loadShapes({ shapeIDMap })
|
|
52
|
-
|
|
53
|
-
await setRouteStops(database, directionIDMap, () => {})
|
|
54
|
-
|
|
55
|
-
describe('The GTFS Route stop merger', () => {
|
|
56
|
-
describe('When processing Metro routes', () => {
|
|
57
|
-
it('Should set Up trips to be City-bound', async () => {
|
|
58
|
-
let pakenhamRoute = await routes.findDocument({ routeGTFSID: '2-PKM' })
|
|
59
|
-
expect(pakenhamRoute).to.not.be.null
|
|
60
|
-
|
|
61
|
-
let city = pakenhamRoute.directions.find(dir => dir.directionName === 'City')
|
|
62
|
-
expect(city).to.not.be.undefined
|
|
63
|
-
expect(city.stops[0].stopName).to.equal('East Pakenham Railway Station')
|
|
64
|
-
expect(city.stops[city.stops.length - 2].stopName).to.equal('Southern Cross Railway Station')
|
|
65
|
-
expect(city.stops[city.stops.length - 1].stopName).to.equal('Flinders Street Railway Station')
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
it('Should set Down trips to the name of the route', async () => {
|
|
69
|
-
let pakenhamRoute = await routes.findDocument({ routeGTFSID: '2-PKM' })
|
|
70
|
-
expect(pakenhamRoute).to.not.be.null
|
|
71
|
-
|
|
72
|
-
let pakenham = pakenhamRoute.directions.find(dir => dir.directionName !== 'City')
|
|
73
|
-
expect(pakenham).to.not.be.undefined
|
|
74
|
-
expect(pakenham.directionName).to.equal('Pakenham')
|
|
75
|
-
expect(pakenham.stops[0].stopName).to.equal('Flinders Street Railway Station')
|
|
76
|
-
expect(pakenham.stops[pakenham.stops.length - 2].stopName).to.equal('Pakenham Railway Station')
|
|
77
|
-
expect(pakenham.stops[pakenham.stops.length - 1].stopName).to.equal('East Pakenham Railway Station')
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
it('Should set Stony Point to Frankston trips as Up', async () => {
|
|
81
|
-
let stonyPointRoute = await routes.findDocument({ routeGTFSID: '2-STY' })
|
|
82
|
-
expect(stonyPointRoute).to.not.be.null
|
|
83
|
-
|
|
84
|
-
let frankston = stonyPointRoute.directions.find(dir => dir.directionName === 'Frankston')
|
|
85
|
-
expect(frankston).to.not.be.undefined
|
|
86
|
-
expect(frankston.stops[0].stopName).to.equal('Stony Point Railway Station')
|
|
87
|
-
expect(frankston.stops[frankston.stops.length - 1].stopName).to.equal('Frankston Railway Station')
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
it('Should set Stony Point trips as Down', async () => {
|
|
91
|
-
let stonyPointRoute = await routes.findDocument({ routeGTFSID: '2-STY' })
|
|
92
|
-
expect(stonyPointRoute).to.not.be.null
|
|
93
|
-
|
|
94
|
-
let stonyPoint = stonyPointRoute.directions.find(dir => dir.directionName === 'Stony Point')
|
|
95
|
-
expect(stonyPoint).to.not.be.undefined
|
|
96
|
-
expect(stonyPoint.stops[0].stopName).to.equal('Frankston Railway Station')
|
|
97
|
-
expect(stonyPoint.stops[stonyPoint.stops.length - 1].stopName).to.equal('Stony Point Railway Station')
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
it('Should set City Circle trips as Down', async () => {
|
|
101
|
-
let cityCircleRoute = await routes.findDocument({ routeGTFSID: '2-CCL' })
|
|
102
|
-
expect(cityCircleRoute).to.not.be.null
|
|
103
|
-
|
|
104
|
-
let direction = cityCircleRoute.directions.find(dir => dir.directionName === 'City Circle (Clockwise)')
|
|
105
|
-
expect(direction).to.not.be.undefined
|
|
106
|
-
expect(direction.trainDirection).to.equal('Down')
|
|
107
|
-
expect(direction.stops[0].stopName).to.equal('Flinders Street Railway Station')
|
|
108
|
-
expect(direction.stops[direction.stops.length - 2].stopName).to.equal('Parliament Railway Station')
|
|
109
|
-
expect(direction.stops[direction.stops.length - 1].stopName).to.equal('Flinders Street Railway Station')
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
it('Should mark the PTV Route direction', async () => {
|
|
113
|
-
let stonyPointRoute = await routes.findDocument({ routeGTFSID: '2-STY' })
|
|
114
|
-
expect(stonyPointRoute.ptvDirections['Stony Point']).to.equal(0)
|
|
115
|
-
expect(stonyPointRoute.ptvDirections['Frankston']).to.equal(1)
|
|
116
|
-
})
|
|
117
|
-
})
|
|
118
|
-
})
|
|
@@ -1,376 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai'
|
|
2
|
-
import merge from '../lib/post-processing/merge-stops.mjs'
|
|
3
|
-
|
|
4
|
-
describe('The stop merger', () => {
|
|
5
|
-
it('Should insert a deviation (Altona Loop)', () => {
|
|
6
|
-
let variants = [
|
|
7
|
-
[
|
|
8
|
-
{ "stopName" : "Yarraville", "stopGTFSID" : "19996" },
|
|
9
|
-
{ "stopName" : "Spotswood", "stopGTFSID" : "19995" },
|
|
10
|
-
{ "stopName" : "Newport", "stopGTFSID" : "19994" },
|
|
11
|
-
{ "stopName" : "Seaholme", "stopGTFSID" : "19927" },
|
|
12
|
-
{ "stopName" : "Altona", "stopGTFSID" : "19926" },
|
|
13
|
-
{ "stopName" : "Westona", "stopGTFSID" : "19925" },
|
|
14
|
-
{ "stopName" : "Laverton", "stopGTFSID" : "19923" },
|
|
15
|
-
{ "stopName" : "Aircraft", "stopGTFSID" : "19924" }
|
|
16
|
-
], [
|
|
17
|
-
{ "stopName" : "North Melbourne", "stopGTFSID" : "19973" },
|
|
18
|
-
{ "stopName" : "South Kensington", "stopGTFSID" : "20026" },
|
|
19
|
-
{ "stopName" : "Footscray", "stopGTFSID" : "20025" },
|
|
20
|
-
{ "stopName" : "Seddon", "stopGTFSID" : "19997" },
|
|
21
|
-
{ "stopName" : "Yarraville", "stopGTFSID" : "19996" },
|
|
22
|
-
{ "stopName" : "Spotswood", "stopGTFSID" : "19995" },
|
|
23
|
-
{ "stopName" : "Newport", "stopGTFSID" : "19994" },
|
|
24
|
-
{ "stopName" : "Laverton", "stopGTFSID" : "19923" },
|
|
25
|
-
{ "stopName" : "Aircraft", "stopGTFSID" : "19924" },
|
|
26
|
-
{ "stopName" : "Williams Landing", "stopGTFSID" : "46468" },
|
|
27
|
-
{ "stopName" : "Hoppers Crossing", "stopGTFSID" : "19922" },
|
|
28
|
-
{ "stopName" : "Werribee", "stopGTFSID" : "19921" }
|
|
29
|
-
]
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
expect(merge(variants)).to.deep.equal([
|
|
33
|
-
{ "stopName" : "North Melbourne", "stopGTFSID" : "19973" },
|
|
34
|
-
{ "stopName" : "South Kensington", "stopGTFSID" : "20026" },
|
|
35
|
-
{ "stopName" : "Footscray", "stopGTFSID" : "20025" },
|
|
36
|
-
{ "stopName" : "Seddon", "stopGTFSID" : "19997" },
|
|
37
|
-
{ "stopName" : "Yarraville", "stopGTFSID" : "19996" },
|
|
38
|
-
{ "stopName" : "Spotswood", "stopGTFSID" : "19995" },
|
|
39
|
-
{ "stopName" : "Newport", "stopGTFSID" : "19994" },
|
|
40
|
-
{ "stopName" : "Seaholme", "stopGTFSID" : "19927" },
|
|
41
|
-
{ "stopName" : "Altona", "stopGTFSID" : "19926" },
|
|
42
|
-
{ "stopName" : "Westona", "stopGTFSID" : "19925" },
|
|
43
|
-
{ "stopName" : "Laverton", "stopGTFSID" : "19923" },
|
|
44
|
-
{ "stopName" : "Aircraft", "stopGTFSID" : "19924" },
|
|
45
|
-
{ "stopName" : "Williams Landing", "stopGTFSID" : "46468" },
|
|
46
|
-
{ "stopName" : "Hoppers Crossing", "stopGTFSID" : "19922" },
|
|
47
|
-
{ "stopName" : "Werribee", "stopGTFSID" : "19921" }
|
|
48
|
-
])
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
it('Should merge 2 different branches (742)', () => {
|
|
52
|
-
let variants = [
|
|
53
|
-
[
|
|
54
|
-
{ "stopName" : "Blackburn Road/Ferntree Gully Road", "stopGTFSID" : "13038" },
|
|
55
|
-
{ "stopName" : "Blackburn Road/Normanby Road", "stopGTFSID" : "15418" },
|
|
56
|
-
{ "stopName" : "Howleys Road/Normanby Road", "stopGTFSID" : "15419" },
|
|
57
|
-
{ "stopName" : "Monash University/Research Way", "stopGTFSID" : "22447" },
|
|
58
|
-
{ "stopName" : "Hilltop Avenue/Gardiner Road", "stopGTFSID" : "22445" },
|
|
59
|
-
{ "stopName" : "Ferntree Gully Road/Gardiner Road", "stopGTFSID" : "22442" },
|
|
60
|
-
{ "stopName" : "Gardiner Road/Ferntree Gully Road", "stopGTFSID" : "13043" }
|
|
61
|
-
],
|
|
62
|
-
[
|
|
63
|
-
{ "stopName" : "Blackburn Road/Ferntree Gully Road", "stopGTFSID" : "13038" },
|
|
64
|
-
{ "stopName" : "Blackburn Road/Normanby Road", "stopGTFSID" : "15418" },
|
|
65
|
-
{ "stopName" : "Howleys Road/Normanby Road", "stopGTFSID" : "15419" },
|
|
66
|
-
{ "stopName" : "CSIRO/Normanby Road", "stopGTFSID" : "40973" },
|
|
67
|
-
{ "stopName" : "Ferntree Gully Road/Gardiner Road", "stopGTFSID" : "22442" },
|
|
68
|
-
{ "stopName" : "Gardiner Road/Ferntree Gully Road", "stopGTFSID" : "13043" }
|
|
69
|
-
]
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
expect(merge(variants)).to.deep.equal([
|
|
73
|
-
{ "stopName" : "Blackburn Road/Ferntree Gully Road", "stopGTFSID" : "13038" },
|
|
74
|
-
{ "stopName" : "Blackburn Road/Normanby Road", "stopGTFSID" : "15418" },
|
|
75
|
-
{ "stopName" : "Howleys Road/Normanby Road", "stopGTFSID" : "15419" },
|
|
76
|
-
{ "stopName" : "Monash University/Research Way", "stopGTFSID" : "22447" },
|
|
77
|
-
{ "stopName" : "Hilltop Avenue/Gardiner Road", "stopGTFSID" : "22445" },
|
|
78
|
-
{ "stopName" : "CSIRO/Normanby Road", "stopGTFSID" : "40973" },
|
|
79
|
-
{ "stopName" : "Ferntree Gully Road/Gardiner Road", "stopGTFSID" : "22442" },
|
|
80
|
-
{ "stopName" : "Gardiner Road/Ferntree Gully Road", "stopGTFSID" : "13043" }
|
|
81
|
-
])
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
it('Should merge 2 different branches (688)', () => {
|
|
86
|
-
let variants = [
|
|
87
|
-
[
|
|
88
|
-
{ "stopName" : "Montrose Town Centre/Mount Dandenong Tourist Road", "stopGTFSID" : "8936" },
|
|
89
|
-
{ "stopName" : "Acacia Avenue/Cambridge Road", "stopGTFSID" : "10295" },
|
|
90
|
-
{ "stopName" : "Alpine Way/Cambridge Road", "stopGTFSID" : "10296" },
|
|
91
|
-
{ "stopName" : "Regina Street/Cambridge Road", "stopGTFSID" : "11081" },
|
|
92
|
-
{ "stopName" : "Balmoral Street/Durham Road", "stopGTFSID" : "11082" },
|
|
93
|
-
{ "stopName" : "Elizabeth Bridge Reserve/Durham Road", "stopGTFSID" : "11083" },
|
|
94
|
-
{ "stopName" : "Hansen Park/Durham Road", "stopGTFSID" : "11084" },
|
|
95
|
-
{ "stopName" : "Charles Street/Durham Road", "stopGTFSID" : "11085" },
|
|
96
|
-
{ "stopName" : "Liverpool Road/Mount Dandenong Road", "stopGTFSID" : "11086" },
|
|
97
|
-
{ "stopName" : "Russo Place/Mount Dandenong Road", "stopGTFSID" : "8948" },
|
|
98
|
-
{ "stopName" : "Kilsyth Memorial Hall/Mount Dandenong Road", "stopGTFSID" : "8949" },
|
|
99
|
-
{ "stopName" : "Shelley Avenue/Mount Dandenong Road", "stopGTFSID" : "8950" },
|
|
100
|
-
{ "stopName" : "The Oaks/Mount Dandenong Road", "stopGTFSID" : "8951" },
|
|
101
|
-
{ "stopName" : "Ruskin Avenue/Mount Dandenong Road", "stopGTFSID" : "8952" },
|
|
102
|
-
{ "stopName" : "Gordon Street/Mount Dandenong Road", "stopGTFSID" : "8953" },
|
|
103
|
-
{ "stopName" : "Dorset Road/Mount Dandenong Road", "stopGTFSID" : "8954" },
|
|
104
|
-
{ "stopName" : "Norton Road/Mount Dandenong Road", "stopGTFSID" : "8955" },
|
|
105
|
-
{ "stopName" : "Arndale Shopping Centre/Mount Dandenong Road", "stopGTFSID" : "8956" },
|
|
106
|
-
{ "stopName" : "Mount Dandenong Road/Main Street", "stopGTFSID" : "13457" },
|
|
107
|
-
{ "stopName" : "Croydon Railway Station/Railway Avenue", "stopGTFSID" : "28719" }
|
|
108
|
-
], [
|
|
109
|
-
{ "stopName" : "Montrose Town Centre/Mount Dandenong Tourist Road", "stopGTFSID" : "8936" },
|
|
110
|
-
{ "stopName" : "Montrose Road/Mount Dandenong Road", "stopGTFSID" : "8937" },
|
|
111
|
-
{ "stopName" : "Montrose CFA/Mount Dandenong Road", "stopGTFSID" : "8938" },
|
|
112
|
-
{ "stopName" : "Canterbury Road/Mount Dandenong Road", "stopGTFSID" : "8939" },
|
|
113
|
-
{ "stopName" : "Bretby Way/Mount Dandenong Road", "stopGTFSID" : "8940" },
|
|
114
|
-
{ "stopName" : "Alpine Way/Mount Dandenong Road", "stopGTFSID" : "8941" },
|
|
115
|
-
{ "stopName" : "736 Mount Dandenong Road", "stopGTFSID" : "8942" },
|
|
116
|
-
{ "stopName" : "Geoffrey Drive/Mount Dandenong Road", "stopGTFSID" : "8943" },
|
|
117
|
-
{ "stopName" : "St. Richards Primary School/Mount Dandenong Road", "stopGTFSID" : "8944" },
|
|
118
|
-
{ "stopName" : "Cherylnne Crescent/Mount Dandenong Road", "stopGTFSID" : "8945" },
|
|
119
|
-
{ "stopName" : "Glendale Court/Mount Dandenong Road", "stopGTFSID" : "8946" },
|
|
120
|
-
{ "stopName" : "Durham Road/Mount Dandenong Road", "stopGTFSID" : "8947" },
|
|
121
|
-
{ "stopName" : "Liverpool Road/Mount Dandenong Road", "stopGTFSID" : "11086" },
|
|
122
|
-
{ "stopName" : "Russo Place/Mount Dandenong Road", "stopGTFSID" : "8948" },
|
|
123
|
-
{ "stopName" : "Kilsyth Memorial Hall/Mount Dandenong Road", "stopGTFSID" : "8949" },
|
|
124
|
-
{ "stopName" : "Shelley Avenue/Mount Dandenong Road", "stopGTFSID" : "8950" },
|
|
125
|
-
{ "stopName" : "The Oaks/Mount Dandenong Road", "stopGTFSID" : "8951" },
|
|
126
|
-
{ "stopName" : "Ruskin Avenue/Mount Dandenong Road", "stopGTFSID" : "8952" },
|
|
127
|
-
{ "stopName" : "Gordon Street/Mount Dandenong Road", "stopGTFSID" : "8953" },
|
|
128
|
-
{ "stopName" : "Dorset Road/Mount Dandenong Road", "stopGTFSID" : "8954" },
|
|
129
|
-
{ "stopName" : "Norton Road/Mount Dandenong Road", "stopGTFSID" : "8955" },
|
|
130
|
-
{ "stopName" : "Arndale Shopping Centre/Mount Dandenong Road", "stopGTFSID" : "8956" },
|
|
131
|
-
{ "stopName" : "Mount Dandenong Road/Main Street", "stopGTFSID" : "13457" },
|
|
132
|
-
{ "stopName" : "Croydon Railway Station/Railway Avenue", "stopGTFSID" : "28719" }
|
|
133
|
-
]
|
|
134
|
-
]
|
|
135
|
-
|
|
136
|
-
expect(merge(variants)).to.deep.equal([
|
|
137
|
-
{ "stopName" : "Montrose Town Centre/Mount Dandenong Tourist Road", "stopGTFSID" : "8936" },
|
|
138
|
-
{ "stopName" : "Montrose Road/Mount Dandenong Road", "stopGTFSID" : "8937" },
|
|
139
|
-
{ "stopName" : "Montrose CFA/Mount Dandenong Road", "stopGTFSID" : "8938" },
|
|
140
|
-
{ "stopName" : "Canterbury Road/Mount Dandenong Road", "stopGTFSID" : "8939" },
|
|
141
|
-
{ "stopName" : "Bretby Way/Mount Dandenong Road", "stopGTFSID" : "8940" },
|
|
142
|
-
{ "stopName" : "Alpine Way/Mount Dandenong Road", "stopGTFSID" : "8941" },
|
|
143
|
-
{ "stopName" : "736 Mount Dandenong Road", "stopGTFSID" : "8942" },
|
|
144
|
-
{ "stopName" : "Geoffrey Drive/Mount Dandenong Road", "stopGTFSID" : "8943" },
|
|
145
|
-
{ "stopName" : "St. Richards Primary School/Mount Dandenong Road", "stopGTFSID" : "8944" },
|
|
146
|
-
{ "stopName" : "Cherylnne Crescent/Mount Dandenong Road", "stopGTFSID" : "8945" },
|
|
147
|
-
{ "stopName" : "Glendale Court/Mount Dandenong Road", "stopGTFSID" : "8946" },
|
|
148
|
-
{ "stopName" : "Durham Road/Mount Dandenong Road", "stopGTFSID" : "8947" },
|
|
149
|
-
{ "stopName" : "Acacia Avenue/Cambridge Road", "stopGTFSID" : "10295" },
|
|
150
|
-
{ "stopName" : "Alpine Way/Cambridge Road", "stopGTFSID" : "10296" },
|
|
151
|
-
{ "stopName" : "Regina Street/Cambridge Road", "stopGTFSID" : "11081" },
|
|
152
|
-
{ "stopName" : "Balmoral Street/Durham Road", "stopGTFSID" : "11082" },
|
|
153
|
-
{ "stopName" : "Elizabeth Bridge Reserve/Durham Road", "stopGTFSID" : "11083" },
|
|
154
|
-
{ "stopName" : "Hansen Park/Durham Road", "stopGTFSID" : "11084" },
|
|
155
|
-
{ "stopName" : "Charles Street/Durham Road", "stopGTFSID" : "11085" },
|
|
156
|
-
{ "stopName" : "Liverpool Road/Mount Dandenong Road", "stopGTFSID" : "11086" },
|
|
157
|
-
{ "stopName" : "Russo Place/Mount Dandenong Road", "stopGTFSID" : "8948" },
|
|
158
|
-
{ "stopName" : "Kilsyth Memorial Hall/Mount Dandenong Road", "stopGTFSID" : "8949" },
|
|
159
|
-
{ "stopName" : "Shelley Avenue/Mount Dandenong Road", "stopGTFSID" : "8950" },
|
|
160
|
-
{ "stopName" : "The Oaks/Mount Dandenong Road", "stopGTFSID" : "8951" },
|
|
161
|
-
{ "stopName" : "Ruskin Avenue/Mount Dandenong Road", "stopGTFSID" : "8952" },
|
|
162
|
-
{ "stopName" : "Gordon Street/Mount Dandenong Road", "stopGTFSID" : "8953" },
|
|
163
|
-
{ "stopName" : "Dorset Road/Mount Dandenong Road", "stopGTFSID" : "8954" },
|
|
164
|
-
{ "stopName" : "Norton Road/Mount Dandenong Road", "stopGTFSID" : "8955" },
|
|
165
|
-
{ "stopName" : "Arndale Shopping Centre/Mount Dandenong Road", "stopGTFSID" : "8956" },
|
|
166
|
-
{ "stopName" : "Mount Dandenong Road/Main Street", "stopGTFSID" : "13457" },
|
|
167
|
-
{ "stopName" : "Croydon Railway Station/Railway Avenue", "stopGTFSID" : "28719" }
|
|
168
|
-
])
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
it('Should not create any further stops if a deviation overlaps (City Loop)', () => {
|
|
172
|
-
let variants = [
|
|
173
|
-
[
|
|
174
|
-
{ "stopName" : "Flinders Street Railway Station", "stopGTFSID" : "19854" },
|
|
175
|
-
{ "stopName" : "Southern Cross Railway Station", "stopGTFSID" : "22180" },
|
|
176
|
-
{ "stopName" : "Flagstaff Railway Station", "stopGTFSID" : "19841" },
|
|
177
|
-
{ "stopName" : "Melbourne Central Railway Station", "stopGTFSID" : "19842" },
|
|
178
|
-
{ "stopName" : "Parliament Railway Station", "stopGTFSID" : "19843" },
|
|
179
|
-
{ "stopName" : "Richmond Railway Station", "stopGTFSID" : "19908" },
|
|
180
|
-
{ "stopName" : "East Richmond Railway Station", "stopGTFSID" : "19907" },
|
|
181
|
-
{ "stopName" : "Burnley Railway Station", "stopGTFSID" : "19906" },
|
|
182
|
-
{ "stopName" : "Hawthorn Railway Station", "stopGTFSID" : "19905" },
|
|
183
|
-
{ "stopName" : "Glenferrie Railway Station", "stopGTFSID" : "19904" },
|
|
184
|
-
{ "stopName" : "Auburn Railway Station", "stopGTFSID" : "19903" },
|
|
185
|
-
{ "stopName" : "Camberwell Railway Station", "stopGTFSID" : "19853" },
|
|
186
|
-
], [
|
|
187
|
-
{ "stopName" : "Flinders Street Railway Station", "stopGTFSID" : "19854" },
|
|
188
|
-
{ "stopName" : "Richmond Railway Station", "stopGTFSID" : "19908" },
|
|
189
|
-
{ "stopName" : "East Richmond Railway Station", "stopGTFSID" : "19907" },
|
|
190
|
-
{ "stopName" : "Burnley Railway Station", "stopGTFSID" : "19906" },
|
|
191
|
-
{ "stopName" : "Hawthorn Railway Station", "stopGTFSID" : "19905" },
|
|
192
|
-
{ "stopName" : "Glenferrie Railway Station", "stopGTFSID" : "19904" },
|
|
193
|
-
{ "stopName" : "Auburn Railway Station", "stopGTFSID" : "19903" },
|
|
194
|
-
{ "stopName" : "Camberwell Railway Station", "stopGTFSID" : "19853" },
|
|
195
|
-
]
|
|
196
|
-
]
|
|
197
|
-
|
|
198
|
-
expect(merge(variants)).to.deep.equal(variants[0])
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
it('Should merge 2 different branches (NOR Group City Loop)', () => {
|
|
203
|
-
let variants = [
|
|
204
|
-
[
|
|
205
|
-
{ "stopName" : "Flinders Street Railway Station", "stopGTFSID" : "19854" },
|
|
206
|
-
{ "stopName" : "Southern Cross Railway Station", "stopGTFSID" : "22180" },
|
|
207
|
-
{ "stopName" : "North Melbourne Railway Station", "stopGTFSID" : "19973" },
|
|
208
|
-
{ "stopName" : "Macaulay Railway Station", "stopGTFSID" : "19972" },
|
|
209
|
-
], [
|
|
210
|
-
{ "stopName" : "Flinders Street Railway Station", "stopGTFSID" : "19854" },
|
|
211
|
-
{ "stopName" : "Parliament Railway Station", "stopGTFSID" : "19843" },
|
|
212
|
-
{ "stopName" : "Melbourne Central Railway Station", "stopGTFSID" : "19842" },
|
|
213
|
-
{ "stopName" : "Flagstaff Railway Station", "stopGTFSID" : "19841" },
|
|
214
|
-
{ "stopName" : "North Melbourne Railway Station", "stopGTFSID" : "19973" },
|
|
215
|
-
{ "stopName" : "Macaulay Railway Station", "stopGTFSID" : "19972" },
|
|
216
|
-
]
|
|
217
|
-
]
|
|
218
|
-
|
|
219
|
-
expect(merge(variants)).to.deep.equal([
|
|
220
|
-
{ "stopName" : "Flinders Street Railway Station", "stopGTFSID" : "19854" },
|
|
221
|
-
{ "stopName" : "Parliament Railway Station", "stopGTFSID" : "19843" },
|
|
222
|
-
{ "stopName" : "Melbourne Central Railway Station", "stopGTFSID" : "19842" },
|
|
223
|
-
{ "stopName" : "Flagstaff Railway Station", "stopGTFSID" : "19841" },
|
|
224
|
-
{ "stopName" : "Southern Cross Railway Station", "stopGTFSID" : "22180" },
|
|
225
|
-
{ "stopName" : "North Melbourne Railway Station", "stopGTFSID" : "19973" },
|
|
226
|
-
{ "stopName" : "Macaulay Railway Station", "stopGTFSID" : "19972" },
|
|
227
|
-
])
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
it('Should handle a branch that is also an alternate destination (681)', () => {
|
|
231
|
-
let commonStops = [
|
|
232
|
-
{ "stopName" : "Knox City Shopping Centre/Burwood Highway", "stopGTFSID" : "19629" },
|
|
233
|
-
{ "stopName" : "Burwood Highway/Stud Road", "stopGTFSID" : "15219" },
|
|
234
|
-
{ "stopName" : "Swinburne TAFE - Wantirna/Stud Road", "stopGTFSID" : "14191" },
|
|
235
|
-
{ "stopName" : "High Street Road/Stud Road", "stopGTFSID" : "14190" },
|
|
236
|
-
{ "stopName" : "Harcrest Boulevard/Stud Road", "stopGTFSID" : "14189" },
|
|
237
|
-
{ "stopName" : "Mockridge Street/Stud Road", "stopGTFSID" : "14188" },
|
|
238
|
-
{ "stopName" : "Armin Street/Stud Road", "stopGTFSID" : "14187" },
|
|
239
|
-
{ "stopName" : "Evans Street/Stud Road", "stopGTFSID" : "14186" },
|
|
240
|
-
{ "stopName" : "Glenifer Avenue/Stud Road", "stopGTFSID" : "14184" },
|
|
241
|
-
{ "stopName" : "Scoresby Village Shopping Centre/Stud Road", "stopGTFSID" : "14183" },
|
|
242
|
-
{ "stopName" : "Ferntree Gully Road/Stud Road", "stopGTFSID" : "14182" },
|
|
243
|
-
{ "stopName" : "Centre Road/Stud Road", "stopGTFSID" : "14181" },
|
|
244
|
-
{ "stopName" : "Kingsley Close/Stud Road", "stopGTFSID" : "14180" },
|
|
245
|
-
{ "stopName" : "Kelletts Road/Stud Road", "stopGTFSID" : "14179" },
|
|
246
|
-
{ "stopName" : "Lakeside Boulevard/Stud Road", "stopGTFSID" : "14178" },
|
|
247
|
-
{ "stopName" : "Stud Park Shopping Centre", "stopGTFSID" : "21314" },
|
|
248
|
-
{ "stopName" : "Rowville Community Centre/Fulham Road", "stopGTFSID" : "13339" },
|
|
249
|
-
{ "stopName" : "Erie Avenue/Bridgewater Way", "stopGTFSID" : "13346" },
|
|
250
|
-
{ "stopName" : "Kelletts Road/Taylors Lane", "stopGTFSID" : "15227" },
|
|
251
|
-
{ "stopName" : "Valleyview Drive/Karoo Road", "stopGTFSID" : "15242" },
|
|
252
|
-
{ "stopName" : "Oakdene Court/Landsborough Avenue", "stopGTFSID" : "15243" },
|
|
253
|
-
{ "stopName" : "Kellbourne Drive/Landsborough Avenue", "stopGTFSID" : "15244" },
|
|
254
|
-
{ "stopName" : "Karoo Primary School/Karoo Road", "stopGTFSID" : "15245" },
|
|
255
|
-
{ "stopName" : "Camley Court/Karoo Road", "stopGTFSID" : "15246" },
|
|
256
|
-
{ "stopName" : "Sovereign Manors Crescent/Karoo Road", "stopGTFSID" : "15247" },
|
|
257
|
-
{ "stopName" : "Langhorne Crescent/Victoria Knox Avenue", "stopGTFSID" : "15248" },
|
|
258
|
-
{ "stopName" : "Sovereign Crest Boulevard/Victoria Knox Avenue", "stopGTFSID" : "15249" },
|
|
259
|
-
{ "stopName" : "Greenhaven Court/Sovereign Crest Boulevard", "stopGTFSID" : "15250" },
|
|
260
|
-
{ "stopName" : "Lakesfield Drive/Napoleon Road", "stopGTFSID" : "15251" },
|
|
261
|
-
{ "stopName" : "Lakesfield Drive/Kelletts Road", "stopGTFSID" : "15252" },
|
|
262
|
-
{ "stopName" : "Rosewood Boulevard/Heritage Way", "stopGTFSID" : "15202" },
|
|
263
|
-
{ "stopName" : "Windsor Drive/Heritage Way", "stopGTFSID" : "15201" },
|
|
264
|
-
{ "stopName" : "Windsor Drive/Rosewood Boulevard", "stopGTFSID" : "15200" },
|
|
265
|
-
{ "stopName" : "Heritage Way/Rosewood Boulevard", "stopGTFSID" : "15198" },
|
|
266
|
-
{ "stopName" : "Kelletts Road/Rosewood Boulevard", "stopGTFSID" : "15199" },
|
|
267
|
-
{ "stopName" : "Grenfell Place/Major Crescent", "stopGTFSID" : "15258" },
|
|
268
|
-
{ "stopName" : "Malata Way/Major Crescent", "stopGTFSID" : "15259" },
|
|
269
|
-
{ "stopName" : "Regency Terrace/Major Crescent", "stopGTFSID" : "15260" },
|
|
270
|
-
{ "stopName" : "Major Crescent/Sullivan Avenue", "stopGTFSID" : "15261" },
|
|
271
|
-
{ "stopName" : "Barry Reserve/Anthony Drive", "stopGTFSID" : "15262" },
|
|
272
|
-
{ "stopName" : "Napoleon Road/Anthony Drive", "stopGTFSID" : "15263" },
|
|
273
|
-
{ "stopName" : "Gill Court/Napoleon Road", "stopGTFSID" : "15264" },
|
|
274
|
-
{ "stopName" : "Park Road/Napoleon Road", "stopGTFSID" : "15265" },
|
|
275
|
-
{ "stopName" : "Teofilo Drive/Napoleon Road", "stopGTFSID" : "15266" },
|
|
276
|
-
{ "stopName" : "Wetherby Court/Dandelion Drive", "stopGTFSID" : "15267" },
|
|
277
|
-
{ "stopName" : "Peregrine Reserve/Dandelion Drive", "stopGTFSID" : "15268" },
|
|
278
|
-
{ "stopName" : "Armstrong Drive/Dandelion Drive", "stopGTFSID" : "15269" },
|
|
279
|
-
{ "stopName" : "Wellington Village Shopping Centre/Braeburn Parade", "stopGTFSID" : "15271" },
|
|
280
|
-
{ "stopName" : "Ada Street/Braeburn Parade", "stopGTFSID" : "41177" },
|
|
281
|
-
{ "stopName" : "Dalmatia Court/Gearon Avenue", "stopGTFSID" : "15272" },
|
|
282
|
-
{ "stopName" : "Suzana Place/Pia Drive", "stopGTFSID" : "15273" },
|
|
283
|
-
{ "stopName" : "Pia Drive/Trisha Drive", "stopGTFSID" : "15275" },
|
|
284
|
-
{ "stopName" : "Koombahla Court/Liviana Drive", "stopGTFSID" : "23180" },
|
|
285
|
-
{ "stopName" : "Fowler Road/Shearer Drive", "stopGTFSID" : "23038" },
|
|
286
|
-
{ "stopName" : "Liberty Avenue/Shearer Drive", "stopGTFSID" : "15277" },
|
|
287
|
-
{ "stopName" : "Buckingham Drive/Liberty Avenue", "stopGTFSID" : "15278" },
|
|
288
|
-
{ "stopName" : "Liberty Avenue Reserve/Liberty Avenue", "stopGTFSID" : "15279" },
|
|
289
|
-
{ "stopName" : "Virgilia Court/Liberty Avenue", "stopGTFSID" : "23037" },
|
|
290
|
-
{ "stopName" : "Liberty Avenue/Clauscen Drive", "stopGTFSID" : "15281" },
|
|
291
|
-
{ "stopName" : "McKay Road/Taylors Lane", "stopGTFSID" : "15282" },
|
|
292
|
-
{ "stopName" : "Taylors Lane/Bernard Hamilton Way", "stopGTFSID" : "15283" },
|
|
293
|
-
{ "stopName" : "Turramurra Drive/Bridgewater Way", "stopGTFSID" : "15284" },
|
|
294
|
-
{ "stopName" : "Simon Avenue/Bridgewater Way", "stopGTFSID" : "15285" },
|
|
295
|
-
{ "stopName" : "Rowville Community Centre/Fulham Road", "stopGTFSID" : "15184" },
|
|
296
|
-
{ "stopName" : "Stud Park Shopping Centre", "stopGTFSID" : "21314" },
|
|
297
|
-
{ "stopName" : "Stud Park Shopping Centre/Stud Road", "stopGTFSID" : "15149" }
|
|
298
|
-
]
|
|
299
|
-
|
|
300
|
-
let studKnox = [
|
|
301
|
-
{ "stopName" : "Lakeside Boulevard/Stud Road", "stopGTFSID" : "15150" },
|
|
302
|
-
{ "stopName" : "Kelletts Road/Stud Road - West", "stopGTFSID" : "15151" },
|
|
303
|
-
{ "stopName" : "Kingsley Close/Stud Road", "stopGTFSID" : "15152" },
|
|
304
|
-
{ "stopName" : "Centre Road/Stud Road", "stopGTFSID" : "15153" },
|
|
305
|
-
{ "stopName" : "Scoresby Village Shopping Centre/Stud Road", "stopGTFSID" : "15154" },
|
|
306
|
-
{ "stopName" : "The Close/Stud Road", "stopGTFSID" : "15155" },
|
|
307
|
-
{ "stopName" : "Sheppard Drive/Stud Road", "stopGTFSID" : "15156" },
|
|
308
|
-
{ "stopName" : "Evans Street/Stud Road", "stopGTFSID" : "15157" },
|
|
309
|
-
{ "stopName" : "George Street/Stud Road", "stopGTFSID" : "15158" },
|
|
310
|
-
{ "stopName" : "Mockridge Street/Stud Road", "stopGTFSID" : "15159" },
|
|
311
|
-
{ "stopName" : "Harcrest Boulevard/Stud Road", "stopGTFSID" : "15160" },
|
|
312
|
-
{ "stopName" : "High Street Road/Stud Road", "stopGTFSID" : "15161" },
|
|
313
|
-
{ "stopName" : "Swinburne TAFE - Wantirna/Stud Road", "stopGTFSID" : "15162" },
|
|
314
|
-
{ "stopName" : "Knox City Shopping Centre/Burwood Highway", "stopGTFSID" : "19629" }
|
|
315
|
-
]
|
|
316
|
-
|
|
317
|
-
let studWav = [
|
|
318
|
-
{ "stopName" : "Turramurra Drive/Stud Road", "stopGTFSID" : "14176" },
|
|
319
|
-
{ "stopName" : "Stud Road/Wellington Road", "stopGTFSID" : "16505" },
|
|
320
|
-
{ "stopName" : "Viewtech Place/Wellington Road", "stopGTFSID" : "16506" },
|
|
321
|
-
{ "stopName" : "Jaydee Court/Wellington Road", "stopGTFSID" : "16507" },
|
|
322
|
-
{ "stopName" : "Eastlink/Wellington Road", "stopGTFSID" : "16508" },
|
|
323
|
-
{ "stopName" : "Haverbrack Drive/Wellington Road", "stopGTFSID" : "2351" },
|
|
324
|
-
{ "stopName" : "Wellington Road/Jacksons Road", "stopGTFSID" : "22714" },
|
|
325
|
-
{ "stopName" : "Stirling Theological College/Jacksons Road", "stopGTFSID" : "22715" },
|
|
326
|
-
{ "stopName" : "Carboni Court/Jacksons Road", "stopGTFSID" : "22716" },
|
|
327
|
-
{ "stopName" : "Gladeswood Drive/Jacksons Road", "stopGTFSID" : "21327" },
|
|
328
|
-
{ "stopName" : "Waverley Gardens Shopping Centre/Hansworth Street", "stopGTFSID" : "21310" }
|
|
329
|
-
]
|
|
330
|
-
|
|
331
|
-
let variants = [
|
|
332
|
-
[
|
|
333
|
-
...commonStops,
|
|
334
|
-
...studKnox
|
|
335
|
-
],
|
|
336
|
-
[
|
|
337
|
-
...commonStops,
|
|
338
|
-
...studWav
|
|
339
|
-
]
|
|
340
|
-
]
|
|
341
|
-
|
|
342
|
-
expect(merge(variants)).to.deep.equal(
|
|
343
|
-
[
|
|
344
|
-
...commonStops,
|
|
345
|
-
...studWav,
|
|
346
|
-
...studKnox
|
|
347
|
-
]
|
|
348
|
-
)
|
|
349
|
-
})
|
|
350
|
-
|
|
351
|
-
it('Should merge a route that runs in halves only', () => {
|
|
352
|
-
let firstHalf = [
|
|
353
|
-
{ "stopName" : "Knox City Shopping Centre/Burwood Highway", "stopGTFSID" : "19629" },
|
|
354
|
-
{ "stopName" : "Burwood Highway/Stud Road", "stopGTFSID" : "15219" },
|
|
355
|
-
{ "stopName" : "Swinburne TAFE - Wantirna/Stud Road", "stopGTFSID" : "14191" },
|
|
356
|
-
{ "stopName" : "High Street Road/Stud Road", "stopGTFSID" : "14190" },
|
|
357
|
-
{ "stopName" : "Harcrest Boulevard/Stud Road", "stopGTFSID" : "14189" },
|
|
358
|
-
{ "stopName" : "Mockridge Street/Stud Road", "stopGTFSID" : "14188" },
|
|
359
|
-
]
|
|
360
|
-
let secondHalf = [
|
|
361
|
-
{ "stopName" : "Mockridge Street/Stud Road", "stopGTFSID" : "14188" },
|
|
362
|
-
{ "stopName" : "Armin Street/Stud Road", "stopGTFSID" : "14187" },
|
|
363
|
-
{ "stopName" : "Evans Street/Stud Road", "stopGTFSID" : "14186" },
|
|
364
|
-
{ "stopName" : "Glenifer Avenue/Stud Road", "stopGTFSID" : "14184" },
|
|
365
|
-
{ "stopName" : "Scoresby Village Shopping Centre/Stud Road", "stopGTFSID" : "14183" },
|
|
366
|
-
{ "stopName" : "Ferntree Gully Road/Stud Road", "stopGTFSID" : "14182" },
|
|
367
|
-
{ "stopName" : "Centre Road/Stud Road", "stopGTFSID" : "14181" },
|
|
368
|
-
{ "stopName" : "Kingsley Close/Stud Road", "stopGTFSID" : "14180" }
|
|
369
|
-
]
|
|
370
|
-
|
|
371
|
-
expect(merge([ firstHalf, secondHalf ])).to.deep.equal([
|
|
372
|
-
...firstHalf,
|
|
373
|
-
...secondHalf.slice(1)
|
|
374
|
-
])
|
|
375
|
-
})
|
|
376
|
-
})
|