@transportme/load-ptv-gtfs 1.1.5 → 1.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transportme/load-ptv-gtfs",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "",
5
5
  "main": "index.mjs",
6
6
  "scripts": {
@@ -15,6 +15,8 @@ const __dirname = path.dirname(__filename)
15
15
 
16
16
  const stopsFile = path.join(__dirname, 'sample-data', 'gtfs-splitting', 'sample_stops.txt')
17
17
 
18
+ const generalStores = path.join(__dirname, 'sample-data', 'gtfs-splitting', 'general-stores.txt')
19
+
18
20
  const uniqueStopsBus = path.join(__dirname, 'sample-data', 'gtfs-splitting', 'force_unique_stops_bus.txt')
19
21
  const uniqueStopsTram = path.join(__dirname, 'sample-data', 'gtfs-splitting', 'force_unique_stops_tram.txt')
20
22
 
@@ -295,4 +297,15 @@ describe('The GTFS Stops Loader', () => {
295
297
  expect(huntingdale.bays[1].stopGTFSID).to.equal('51586')
296
298
  expect(huntingdale.bays[1].mode).to.equal(TRANSIT_MODES.regionalCoach)
297
299
  })
300
+
301
+ it('Should not merge stops with the same name that are located far away from one another', async () => {
302
+ let database = new LokiDatabaseConnection('test-db')
303
+ let stops = await database.createCollection('stops')
304
+
305
+ await (new StopsLoader(generalStores, suburbs, TRANSIT_MODES.bus, database)).loadStops()
306
+
307
+ expect((await stops.findDocument({ 'bays.stopGTFSID': '17124' })).bays.length).to.equal(2) // Piangil
308
+ expect((await stops.findDocument({ 'bays.stopGTFSID': '17977' })).bays.length).to.equal(2) // Tempy
309
+ expect((await stops.findDocument({ 'bays.stopGTFSID': '43916' })).bays.length).to.equal(1) // Coronet Bay
310
+ })
298
311
  })
@@ -0,0 +1,19 @@
1
+ stop_id,stop_name,stop_lat,stop_lon
2
+ "15117","General Store/Murray Valley Hwy (Torrumbarry)","-36.0289328143973","144.516565858212"
3
+ "17124","General Store/Murray St (Piangil)","-35.0542205869387","143.310581971833"
4
+ "17125","General Store/Murray St (Piangil)","-35.0538456443862","143.310697481574"
5
+ "17729","General Store/Macs St (Peterborough)","-38.6070683334915","142.87719698365"
6
+ "17730","General Store/Macs St (Peterborough)","-38.6070003726619","142.877568193123"
7
+ "17977","General Store/Sunraysia Hwy (Tempy)","-35.3453146606652","142.424802508117"
8
+ "17978","General Store/Sunraysia Hwy (Tempy)","-35.344983598941","142.424623331801"
9
+ "36974","General Store/Monash Ave (Nyah West)","-35.1852359469295","143.345799631341"
10
+ "37899","General Store/Princes Hwy (Johnsonville)","-37.8200787799472","147.831089593645"
11
+ "37901","General Store/Princes Hwy (Swan Reach)","-37.8219848899712","147.856891682107"
12
+ "37902","General Store/Princes Hwy (Swan Reach)","-37.822175385113","147.85672345214"
13
+ "37921","General Store/Main St (Bruthen)","-37.7082084114992","147.832470628437"
14
+ "37987","General Store/Phillip Island Rd (Surf Beach)","-38.5078845836624","145.29112542319"
15
+ "38000","General Store/Phillip Island Rd (Surf Beach)","-38.5077808366616","145.291426050202"
16
+ "42284","General Store/Ararat - St Arnaud Rd (Navarre)","-36.8998475986824","143.113535821369"
17
+ "43916","General Store/Champ Elysees Esp (Coronet Bay)","-38.4376225731191","145.436193608845"
18
+ "44217","General Store/Great Ocean Rd (Nullawarre)","-38.469533626788","142.749879594372"
19
+ "47879","General Store/Ararat-St Arnaud Rd (Navarre)","-36.8998967921621","143.113387501491"