@transportme/load-ptv-gtfs 1.1.4 → 1.1.5

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.
@@ -95,6 +95,10 @@ export default class StopsLoader {
95
95
  stop.codedSuburbs = stop.cleanSuburbs
96
96
  }
97
97
 
98
+ updateStopLocation(stop) {
99
+ stop.location.coordinates = stop.bays.map(bay => bay.location.coordinates)
100
+ }
101
+
98
102
  async mergeStops(matchingStop, stopData) {
99
103
  let newBay = stopData.bays[0]
100
104
  let hasIdenticalBay = matchingStop.bays.some(bay =>
@@ -107,6 +111,7 @@ export default class StopsLoader {
107
111
 
108
112
  this.updateStopSuburb(matchingStop)
109
113
  this.updateStopName(matchingStop)
114
+ this.updateStopLocation(matchingStop)
110
115
 
111
116
  await this.#stops.replaceDocument({
112
117
  _id: matchingStop._id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transportme/load-ptv-gtfs",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "",
5
5
  "main": "index.mjs",
6
6
  "scripts": {
@@ -61,6 +61,11 @@ describe('The GTFS Stops Loader', () => {
61
61
  expect(wavWarrigal).to.not.be.null
62
62
  expect(wavWarrigal.stopName).to.equal('Waverley Road/Warrigal Road')
63
63
  expect(wavWarrigal.bays.length).to.equal(2)
64
+
65
+ expect(wavWarrigal.location.coordinates).to.deep.equal([
66
+ [145.091009789504, -37.879427459666],
67
+ [145.090653754117, -37.8795658733597]
68
+ ])
64
69
  })
65
70
 
66
71
  it('Should merge non street stops, and keep the secondary stop name if they are the same', async () => {