@golemio/pid 4.1.6-dev.2103093669 → 4.1.6-dev.2103611002
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/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.d.ts +5 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.js +288 -237
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,11 @@ export declare class DelayComputationManager {
|
|
|
12
12
|
* @param {string} tripId - Internal DB trip id
|
|
13
13
|
* @returns {IComputationTrip} - Result with shape anchor points
|
|
14
14
|
*/
|
|
15
|
-
getComputationObject
|
|
15
|
+
getComputationObject(tripId: string): Promise<IComputationTrip | null>;
|
|
16
|
+
private roundToDecimals;
|
|
17
|
+
private shouldReadCoordsFromPrevPrevPoint;
|
|
18
|
+
private setupBearingBetweenPoints;
|
|
19
|
+
private shapePointCompareDistance;
|
|
16
20
|
/**
|
|
17
21
|
* Return geometry of anchor points with distance from start along trip track shape
|
|
18
22
|
*
|
|
@@ -34,257 +34,308 @@ class DelayComputationManager {
|
|
|
34
34
|
constructor(gtfsTripsRepository) {
|
|
35
35
|
this.gtfsTripsRepository = gtfsTripsRepository;
|
|
36
36
|
this.METRO_TRIP_PREFIX_REGEX = /^(991|992|993)/;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
const simpleConfig = ioc_1.IntegrationEngineContainer.resolve(CoreToken_1.CoreToken.SimpleConfig);
|
|
38
|
+
this.stepBetweenPoints = config_1.config.vehiclePositions.stepBetweenPoints;
|
|
39
|
+
this.stepBetweenPointsforMetro = Number(simpleConfig.getValue("module.pid.vehicle-positions.shapes.metro.stepBetweenPointsForMetro", "0.05"));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Return shape anchor points along trip track shape with stop times parameters
|
|
43
|
+
*
|
|
44
|
+
* @param {string} tripId - Internal DB trip id
|
|
45
|
+
* @returns {IComputationTrip} - Result with shape anchor points
|
|
46
|
+
*/
|
|
47
|
+
async getComputationObject(tripId) {
|
|
48
|
+
const gtfsTrip = await this.gtfsTripsRepository.findByIdForDelayComputation(tripId);
|
|
49
|
+
if (!gtfsTrip) {
|
|
50
|
+
helpers_1.log.info(`getComputationObject: GTFS trip ${tripId} was not found`);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const { shape_id, shapes, stop_times } = gtfsTrip;
|
|
54
|
+
if (!shapes?.length) {
|
|
55
|
+
throw new golemio_errors_1.GeneralError(`getComputationObject: GTFS trip ${tripId} has no shapes`, this.constructor.name);
|
|
56
|
+
}
|
|
57
|
+
else if (!stop_times?.length) {
|
|
58
|
+
throw new golemio_errors_1.GeneralError(`getComputationObject: GTFS trip ${tripId} has no stop_times`, this.constructor.name);
|
|
59
|
+
}
|
|
60
|
+
const isMetro = this.METRO_TRIP_PREFIX_REGEX.test(tripId);
|
|
61
|
+
const shapesGeometryAnchorPoints = this.getShapesGeometryAnchorPoints(shape_id, shapes, stop_times, isMetro);
|
|
62
|
+
// MAKING COPY
|
|
63
|
+
const shapePoints = [];
|
|
64
|
+
const lastPointIndex = shapesGeometryAnchorPoints.length - 1;
|
|
65
|
+
// const to determine shape points of stops (in meters)
|
|
66
|
+
const distanceBefore = 0.1;
|
|
67
|
+
const distanceAfter = 0.05;
|
|
68
|
+
for (let i = 0; i < shapesGeometryAnchorPoints.length; i++) {
|
|
69
|
+
const isLastPoint = i === lastPointIndex;
|
|
70
|
+
const bearing = this.setupBearingBetweenPoints(i, shapePoints, shapesGeometryAnchorPoints, isLastPoint);
|
|
71
|
+
// init values
|
|
72
|
+
let thisStopSequence = null;
|
|
73
|
+
let lastStopSequence = shapesGeometryAnchorPoints[i].last_stop_sequence;
|
|
74
|
+
let nextStopSequence = shapesGeometryAnchorPoints[i].next_stop_sequence;
|
|
75
|
+
// these are origin stop_times shape point fron shapes table, clearly at stops points
|
|
76
|
+
if (shapesGeometryAnchorPoints[i].this_stop_sequence) {
|
|
77
|
+
thisStopSequence = shapesGeometryAnchorPoints[i].this_stop_sequence;
|
|
48
78
|
}
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
|
|
79
|
+
// if is shape anchor point in close distance AFTER LAST stop, then set it also AT STOP
|
|
80
|
+
else if (i > 0 &&
|
|
81
|
+
shapesGeometryAnchorPoints[i].shape_dist_traveled -
|
|
82
|
+
stop_times[shapesGeometryAnchorPoints[i].last_stop_sequence - 1].shape_dist_traveled <=
|
|
83
|
+
distanceAfter) {
|
|
84
|
+
thisStopSequence = shapesGeometryAnchorPoints[i].last_stop_sequence;
|
|
52
85
|
}
|
|
53
|
-
|
|
54
|
-
|
|
86
|
+
// if is shape anchor point in close distance BEFORE NEXT stop, then set it also AT STOP
|
|
87
|
+
else if (i < shapesGeometryAnchorPoints.length - 1 &&
|
|
88
|
+
stop_times[shapesGeometryAnchorPoints[i].next_stop_sequence - 1].shape_dist_traveled -
|
|
89
|
+
shapesGeometryAnchorPoints[i].shape_dist_traveled <=
|
|
90
|
+
distanceBefore) {
|
|
91
|
+
thisStopSequence = shapesGeometryAnchorPoints[i].next_stop_sequence;
|
|
92
|
+
lastStopSequence = shapesGeometryAnchorPoints[i].next_stop_sequence;
|
|
93
|
+
nextStopSequence = Math.min(shapesGeometryAnchorPoints[i].next_stop_sequence + 1, stop_times.length);
|
|
55
94
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
for (let i = 0; i < shapesGeometryAnchorPoints.length; i++) {
|
|
64
|
-
let bearing = 0;
|
|
65
|
-
// add bearing from shape computed for previous shapePoint
|
|
66
|
-
if (i > 0) {
|
|
67
|
-
// compute bearing from two shape points
|
|
68
|
-
let shapePointBearing = Math.round(turf.bearing(turf.point(shapesGeometryAnchorPoints[i - 1].coordinates), turf.point(shapesGeometryAnchorPoints[i].coordinates)));
|
|
69
|
-
// turf.bearing returns -180 to 180, when 0 is north
|
|
70
|
-
// we need 0 to 359, for negative value we substract from 360
|
|
71
|
-
if (shapePointBearing < 0) {
|
|
72
|
-
shapePointBearing = 360 - Math.abs(shapePointBearing);
|
|
73
|
-
}
|
|
74
|
-
// save bearing
|
|
75
|
-
shapePoints[i - 1].bearing = shapePointBearing;
|
|
76
|
-
// for the last shapePoint copy the bearing from last one
|
|
77
|
-
if (shapesGeometryAnchorPoints.length - 1 === i) {
|
|
78
|
-
bearing = shapePoints[i - 1].bearing;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
// init values
|
|
82
|
-
let thisStopSequence = null;
|
|
83
|
-
let lastStopSequence = shapesGeometryAnchorPoints[i].last_stop_sequence;
|
|
84
|
-
let nextStopSequence = shapesGeometryAnchorPoints[i].next_stop_sequence;
|
|
85
|
-
// these are origin stop_times shape point fron shapes table, clearly at stops points
|
|
86
|
-
if (shapesGeometryAnchorPoints[i].this_stop_sequence) {
|
|
87
|
-
thisStopSequence = shapesGeometryAnchorPoints[i].this_stop_sequence;
|
|
88
|
-
}
|
|
89
|
-
// if is shape anchor point in close distance AFTER LAST stop, then set it also AT STOP
|
|
90
|
-
else if (i > 0 &&
|
|
91
|
-
shapesGeometryAnchorPoints[i].shape_dist_traveled -
|
|
92
|
-
stop_times[shapesGeometryAnchorPoints[i].last_stop_sequence - 1].shape_dist_traveled <=
|
|
93
|
-
distanceAfter) {
|
|
94
|
-
thisStopSequence = shapesGeometryAnchorPoints[i].last_stop_sequence;
|
|
95
|
-
}
|
|
96
|
-
// if is shape anchor point in close distance BEFORE NEXT stop, then set it also AT STOP
|
|
97
|
-
else if (i < shapesGeometryAnchorPoints.length - 1 &&
|
|
98
|
-
stop_times[shapesGeometryAnchorPoints[i].next_stop_sequence - 1].shape_dist_traveled -
|
|
99
|
-
shapesGeometryAnchorPoints[i].shape_dist_traveled <=
|
|
100
|
-
distanceBefore) {
|
|
101
|
-
thisStopSequence = shapesGeometryAnchorPoints[i].next_stop_sequence;
|
|
102
|
-
lastStopSequence = shapesGeometryAnchorPoints[i].next_stop_sequence;
|
|
103
|
-
nextStopSequence = Math.min(shapesGeometryAnchorPoints[i].next_stop_sequence + 1, stop_times.length);
|
|
104
|
-
}
|
|
105
|
-
let shapeDistTraveled = shapesGeometryAnchorPoints[i].shape_dist_traveled;
|
|
106
|
-
let distanceFromLastStop;
|
|
107
|
-
// fallback to shape_dist_traveled from GTFS stop_times, if the vehicle is at stop
|
|
108
|
-
// and set distance from last stop to 0 (the stop is literally at stop)
|
|
109
|
-
if (thisStopSequence !== null) {
|
|
110
|
-
shapeDistTraveled = stop_times[thisStopSequence - 1].shape_dist_traveled;
|
|
111
|
-
distanceFromLastStop = 0;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
distanceFromLastStop =
|
|
115
|
-
Math.round((shapeDistTraveled - stop_times[lastStopSequence - 1].shape_dist_traveled) * 1000) / 1000;
|
|
116
|
-
}
|
|
117
|
-
// if is trip at stop than set departure by this stop
|
|
118
|
-
// between stops do linear interpolation from departure from last stop and arrival of next stop
|
|
119
|
-
const timeScheduledSeconds = thisStopSequence !== null
|
|
120
|
-
? stop_times[lastStopSequence - 1].arrival_time_seconds
|
|
121
|
-
: stop_times[lastStopSequence - 1].departure_time_seconds +
|
|
122
|
-
Math.round(((stop_times[nextStopSequence - 1].arrival_time_seconds -
|
|
123
|
-
stop_times[lastStopSequence - 1].departure_time_seconds) *
|
|
124
|
-
distanceFromLastStop) /
|
|
125
|
-
(stop_times[nextStopSequence - 1].shape_dist_traveled -
|
|
126
|
-
stop_times[lastStopSequence - 1].shape_dist_traveled));
|
|
127
|
-
shapePoints.push({
|
|
128
|
-
index: i,
|
|
129
|
-
at_stop: thisStopSequence !== null,
|
|
130
|
-
bearing,
|
|
131
|
-
coordinates: shapesGeometryAnchorPoints[i].coordinates,
|
|
132
|
-
distance_from_last_stop: distanceFromLastStop,
|
|
133
|
-
last_stop_sequence: lastStopSequence,
|
|
134
|
-
next_stop_sequence: nextStopSequence,
|
|
135
|
-
shape_dist_traveled: shapeDistTraveled,
|
|
136
|
-
this_stop_sequence: thisStopSequence,
|
|
137
|
-
time_scheduled_seconds: timeScheduledSeconds,
|
|
138
|
-
});
|
|
95
|
+
let shapeDistTraveled = shapesGeometryAnchorPoints[i].shape_dist_traveled;
|
|
96
|
+
let distanceFromLastStop;
|
|
97
|
+
// fallback to shape_dist_traveled from GTFS stop_times, if the vehicle is at stop
|
|
98
|
+
// and set distance from last stop to 0 (the stop is literally at stop)
|
|
99
|
+
if (thisStopSequence !== null) {
|
|
100
|
+
shapeDistTraveled = stop_times[thisStopSequence - 1].shape_dist_traveled;
|
|
101
|
+
distanceFromLastStop = 0;
|
|
139
102
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
103
|
+
else {
|
|
104
|
+
distanceFromLastStop = this.roundToDecimals(shapeDistTraveled - stop_times[lastStopSequence - 1].shape_dist_traveled, 1000);
|
|
105
|
+
}
|
|
106
|
+
// if is trip at stop than set departure by this stop
|
|
107
|
+
// between stops do linear interpolation from departure from last stop and arrival of next stop
|
|
108
|
+
const timeScheduledSeconds = thisStopSequence !== null
|
|
109
|
+
? stop_times[lastStopSequence - 1].arrival_time_seconds
|
|
110
|
+
: stop_times[lastStopSequence - 1].departure_time_seconds +
|
|
111
|
+
Math.round(((stop_times[nextStopSequence - 1].arrival_time_seconds -
|
|
112
|
+
stop_times[lastStopSequence - 1].departure_time_seconds) *
|
|
113
|
+
distanceFromLastStop) /
|
|
114
|
+
(stop_times[nextStopSequence - 1].shape_dist_traveled -
|
|
115
|
+
stop_times[lastStopSequence - 1].shape_dist_traveled));
|
|
116
|
+
shapePoints.push({
|
|
117
|
+
index: i,
|
|
118
|
+
at_stop: thisStopSequence !== null,
|
|
119
|
+
bearing,
|
|
120
|
+
coordinates: shapesGeometryAnchorPoints[i].coordinates,
|
|
121
|
+
distance_from_last_stop: distanceFromLastStop,
|
|
122
|
+
last_stop_sequence: lastStopSequence,
|
|
123
|
+
next_stop_sequence: nextStopSequence,
|
|
124
|
+
shape_dist_traveled: shapeDistTraveled,
|
|
125
|
+
this_stop_sequence: thisStopSequence,
|
|
126
|
+
time_scheduled_seconds: timeScheduledSeconds,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
trip_id: tripId,
|
|
131
|
+
stop_times: stop_times,
|
|
132
|
+
shapes_anchor_points: shapePoints,
|
|
133
|
+
shapes: this.mapGtfsShapesToTripShapes(shapes),
|
|
146
134
|
};
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
135
|
+
}
|
|
136
|
+
roundToDecimals(n, fraction = 100000) {
|
|
137
|
+
return Math.round(n * fraction) / fraction;
|
|
138
|
+
}
|
|
139
|
+
shouldReadCoordsFromPrevPrevPoint(points, i) {
|
|
140
|
+
if (i <= 1) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
return (points[i - 1].coordinates[0] === points[i].coordinates[0] && points[i - 1].coordinates[1] === points[i].coordinates[1]);
|
|
144
|
+
}
|
|
145
|
+
setupBearingBetweenPoints(index, target, source, isLast) {
|
|
146
|
+
// add bearing from shape computed for previous shapePoint
|
|
147
|
+
if (index === 0) {
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
let bearing;
|
|
151
|
+
if (this.shouldReadCoordsFromPrevPrevPoint(source, index)) {
|
|
152
|
+
// take bearing of the pre-previous point (i - 2),
|
|
153
|
+
// ... to be saved into previous point (i - 1)
|
|
154
|
+
bearing = target[index - 2].bearing;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
// compute bearing from two shape points
|
|
158
|
+
bearing = Math.round(turf.bearing(turf.point(source[index - 1].coordinates), turf.point(source[index].coordinates)));
|
|
159
|
+
}
|
|
160
|
+
// turf.bearing returns -180 to 180, when 0 is north
|
|
161
|
+
// we need 0 to 359, for negative value we substract from 360
|
|
162
|
+
if (bearing < 0) {
|
|
163
|
+
bearing = 360 - Math.abs(bearing);
|
|
164
|
+
}
|
|
165
|
+
// save bearing
|
|
166
|
+
target[index - 1].bearing = bearing;
|
|
167
|
+
// for the last shapePoint copy the bearing from last one
|
|
168
|
+
if (isLast) {
|
|
169
|
+
bearing = target[index - 1].bearing;
|
|
170
|
+
}
|
|
171
|
+
return bearing;
|
|
172
|
+
}
|
|
173
|
+
shapePointCompareDistance(point, currentStop, nextStop) {
|
|
174
|
+
if (currentStop.shape_dist_traveled === point.shape_dist_traveled) {
|
|
175
|
+
point.shape_at_stop = true;
|
|
176
|
+
}
|
|
177
|
+
if (nextStop) {
|
|
178
|
+
if (point.shape_dist_traveled >= currentStop.shape_dist_traveled &&
|
|
179
|
+
point.shape_dist_traveled <= nextStop.shape_dist_traveled) {
|
|
180
|
+
// current segment
|
|
181
|
+
return 0;
|
|
182
|
+
}
|
|
183
|
+
else if (point.shape_dist_traveled > nextStop.shape_dist_traveled) {
|
|
184
|
+
// future segment
|
|
185
|
+
return 1;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// previous stop segment OR missing nextStop (currentStop is last stop)
|
|
189
|
+
return -1;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Return geometry of anchor points with distance from start along trip track shape
|
|
193
|
+
*
|
|
194
|
+
* @param {string} shapeId - GTFS shape id
|
|
195
|
+
* @param {ITransformedTripShape[]} shapes - GTFS shape points
|
|
196
|
+
* @param {IStopTime[]} stops
|
|
197
|
+
* @returns {IShapeGeometryAnchorPoint[]} - Result array of geometry points along trip track shape
|
|
198
|
+
*/
|
|
199
|
+
getShapesGeometryAnchorPoints(shapeId, shapes, stops, isMetro = false) {
|
|
200
|
+
try {
|
|
201
|
+
let segmentShapes = [];
|
|
202
|
+
// Splits shapes array to multiple arrays "delimited" by stops
|
|
203
|
+
let startShapeIndex = 0;
|
|
204
|
+
for (let st = 0; st < stops.length; st++) {
|
|
205
|
+
const currentSegment = [];
|
|
206
|
+
for (let sh = startShapeIndex; sh < shapes.length; sh++) {
|
|
207
|
+
const shapePoint = { ...shapes[sh], shape_at_stop: false };
|
|
208
|
+
const shapePointSituation = this.shapePointCompareDistance(shapePoint, stops[st], stops[st + 1]);
|
|
209
|
+
if (shapePointSituation === 0) {
|
|
210
|
+
// next stop iteration (outer for-cycle) can be shorter
|
|
211
|
+
startShapeIndex = sh;
|
|
212
|
+
// each segment starts with "at_stop=true" point
|
|
213
|
+
currentSegment.push(shapePoint);
|
|
171
214
|
}
|
|
172
|
-
if (
|
|
173
|
-
|
|
215
|
+
else if (shapePointSituation === 1) {
|
|
216
|
+
// no need to iterate over all future stops segments
|
|
217
|
+
break;
|
|
174
218
|
}
|
|
175
219
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
for (const segment of segmentShapes) {
|
|
179
|
-
segmentArr = [
|
|
180
|
-
...segmentArr,
|
|
181
|
-
...this.divideSegmentLine(segment, isMetro ? this.stepBetweenPointsforMetro : this.stepBetweenPoints),
|
|
182
|
-
];
|
|
220
|
+
if (currentSegment.length) {
|
|
221
|
+
segmentShapes.push(currentSegment);
|
|
183
222
|
}
|
|
184
|
-
// Make initial shapesGeometryAnchorPoints
|
|
185
|
-
let stopCounter = 0;
|
|
186
|
-
const resultArr = segmentArr.map((segment, index) => {
|
|
187
|
-
let this_stop_sequence;
|
|
188
|
-
let last_stop_sequence;
|
|
189
|
-
let next_stop_sequence;
|
|
190
|
-
if (segment.shape_at_stop) {
|
|
191
|
-
stopCounter++;
|
|
192
|
-
this_stop_sequence = stopCounter;
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
this_stop_sequence = null;
|
|
196
|
-
}
|
|
197
|
-
last_stop_sequence = stopCounter;
|
|
198
|
-
next_stop_sequence = stopCounter + 1;
|
|
199
|
-
return {
|
|
200
|
-
index,
|
|
201
|
-
coordinates: [
|
|
202
|
-
Math.round(segment.shape_pt_lon * 100000) / 100000,
|
|
203
|
-
Math.round(segment.shape_pt_lat * 100000) / 100000,
|
|
204
|
-
],
|
|
205
|
-
last_stop_sequence,
|
|
206
|
-
next_stop_sequence,
|
|
207
|
-
shape_dist_traveled: Math.round(segment.shape_dist_traveled * 1000) / 1000,
|
|
208
|
-
this_stop_sequence,
|
|
209
|
-
};
|
|
210
|
-
});
|
|
211
|
-
stopCounter++;
|
|
212
|
-
// and lastly shape point for last stop as there is no segment for last stop
|
|
213
|
-
resultArr.push({
|
|
214
|
-
index: resultArr.length,
|
|
215
|
-
coordinates: [
|
|
216
|
-
Math.round(shapes[shapes.length - 1].shape_pt_lon * 100000) / 100000,
|
|
217
|
-
Math.round(shapes[shapes.length - 1].shape_pt_lat * 100000) / 100000,
|
|
218
|
-
],
|
|
219
|
-
last_stop_sequence: stopCounter,
|
|
220
|
-
next_stop_sequence: stopCounter,
|
|
221
|
-
shape_dist_traveled: Math.round(shapes[shapes.length - 1].shape_dist_traveled * 1000) / 1000,
|
|
222
|
-
this_stop_sequence: stopCounter,
|
|
223
|
-
});
|
|
224
|
-
return resultArr;
|
|
225
|
-
}
|
|
226
|
-
catch (err) {
|
|
227
|
-
helpers_1.log.error(err);
|
|
228
|
-
helpers_1.log.error(shapeId);
|
|
229
|
-
return [];
|
|
230
223
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
*
|
|
237
|
-
* @param {ISegmentShape[]} segmentsArr - Original shape points segment between two stops
|
|
238
|
-
* @param {number} distance - Minimal distance for two consequent shape points
|
|
239
|
-
* @returns {ISegmentShape[]} - Result array of new shape points
|
|
240
|
-
*/
|
|
241
|
-
this.divideSegmentLine = (segmentArr, distance = config_1.config.vehiclePositions.stepBetweenPoints) => {
|
|
242
|
-
const shapeId = segmentArr[0].shape_id;
|
|
243
|
-
const shapeCount = segmentArr.length;
|
|
244
|
-
const startShapeDistTraveled = segmentArr[0].shape_dist_traveled;
|
|
245
|
-
const endShapeDistTraveled = segmentArr[shapeCount - 1].shape_dist_traveled;
|
|
246
|
-
const shapeDistLength = endShapeDistTraveled - startShapeDistTraveled;
|
|
247
|
-
const segmentLine = turf.lineString(segmentArr.map((s) => {
|
|
248
|
-
return [s.shape_pt_lon, s.shape_pt_lat];
|
|
249
|
-
}));
|
|
250
|
-
// because we dont believe source shape distances, rather compute length with turf.js
|
|
251
|
-
const segmentLength = turf.length(segmentLine);
|
|
252
|
-
const middlePointsCount = Math.floor(segmentLength / distance);
|
|
253
|
-
const distanceOffset = (segmentLength - distance * middlePointsCount) / 2;
|
|
254
|
-
// put first shape point
|
|
255
|
-
const resultSegmentPoints = [
|
|
256
|
-
{
|
|
257
|
-
...segmentArr[0],
|
|
258
|
-
shape_pt_sequence: 1,
|
|
259
|
-
},
|
|
260
|
-
];
|
|
261
|
-
// for each middle point create acording shape point with interpolated origin shape dist traveled
|
|
262
|
-
for (let i = 0; i < middlePointsCount; i++) {
|
|
263
|
-
const currentDistance = i * distance + distanceOffset;
|
|
264
|
-
const currentDistDistance = (shapeDistLength / segmentLength) * currentDistance;
|
|
265
|
-
const newPoint = turf.along(segmentLine, i * distance + distanceOffset);
|
|
266
|
-
resultSegmentPoints.push({
|
|
267
|
-
shape_id: shapeId,
|
|
268
|
-
shape_at_stop: false,
|
|
269
|
-
shape_pt_sequence: resultSegmentPoints.length + 1,
|
|
270
|
-
shape_pt_lat: newPoint.geometry.coordinates[1],
|
|
271
|
-
shape_pt_lon: newPoint.geometry.coordinates[0],
|
|
272
|
-
shape_dist_traveled: startShapeDistTraveled + currentDistDistance,
|
|
273
|
-
});
|
|
224
|
+
let segmentArr = [];
|
|
225
|
+
// concat arrays of stop divided segments with distributed shape points
|
|
226
|
+
for (const segment of segmentShapes) {
|
|
227
|
+
const line = this.divideSegmentLine(segment, isMetro ? this.stepBetweenPointsforMetro : this.stepBetweenPoints);
|
|
228
|
+
segmentArr.push(...line);
|
|
274
229
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
230
|
+
// Make initial shapesGeometryAnchorPoints
|
|
231
|
+
let stopCounter = 0;
|
|
232
|
+
const resultArr = segmentArr.map((segment, index) => {
|
|
233
|
+
let this_stop_sequence;
|
|
234
|
+
let last_stop_sequence;
|
|
235
|
+
let next_stop_sequence;
|
|
236
|
+
if (segment.shape_at_stop) {
|
|
237
|
+
stopCounter++;
|
|
238
|
+
this_stop_sequence = stopCounter;
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
this_stop_sequence = null;
|
|
242
|
+
}
|
|
243
|
+
last_stop_sequence = stopCounter;
|
|
244
|
+
next_stop_sequence = stopCounter + 1;
|
|
245
|
+
const coordinates = [
|
|
246
|
+
this.roundToDecimals(segment.shape_pt_lon),
|
|
247
|
+
this.roundToDecimals(segment.shape_pt_lat),
|
|
248
|
+
];
|
|
279
249
|
return {
|
|
280
|
-
|
|
281
|
-
|
|
250
|
+
index,
|
|
251
|
+
coordinates,
|
|
252
|
+
last_stop_sequence,
|
|
253
|
+
next_stop_sequence,
|
|
254
|
+
shape_dist_traveled: this.roundToDecimals(segment.shape_dist_traveled, 1000),
|
|
255
|
+
this_stop_sequence,
|
|
282
256
|
};
|
|
283
257
|
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
258
|
+
stopCounter++;
|
|
259
|
+
// and lastly shape point for last stop as there is no segment for last stop
|
|
260
|
+
resultArr.push({
|
|
261
|
+
index: resultArr.length,
|
|
262
|
+
coordinates: [
|
|
263
|
+
this.roundToDecimals(shapes[shapes.length - 1].shape_pt_lon),
|
|
264
|
+
this.roundToDecimals(shapes[shapes.length - 1].shape_pt_lat),
|
|
265
|
+
],
|
|
266
|
+
last_stop_sequence: stopCounter,
|
|
267
|
+
next_stop_sequence: stopCounter,
|
|
268
|
+
shape_dist_traveled: this.roundToDecimals(shapes[shapes.length - 1].shape_dist_traveled, 1000),
|
|
269
|
+
this_stop_sequence: stopCounter,
|
|
270
|
+
});
|
|
271
|
+
return resultArr;
|
|
272
|
+
}
|
|
273
|
+
catch (err) {
|
|
274
|
+
helpers_1.log.error(err);
|
|
275
|
+
helpers_1.log.error(shapeId);
|
|
276
|
+
return [];
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Generate new shape points from segment of trip shape along original one
|
|
281
|
+
* - preserving start and end shape points belonging to stops
|
|
282
|
+
* - creates new set of shape points between stops to get same point distance along original shape
|
|
283
|
+
*
|
|
284
|
+
* @param {ISegmentShape[]} segmentsArr - Original shape points segment between two stops
|
|
285
|
+
* @param {number} distance - Minimal distance for two consequent shape points
|
|
286
|
+
* @returns {ISegmentShape[]} - Result array of new shape points
|
|
287
|
+
*/
|
|
288
|
+
divideSegmentLine(segmentArr, distance = config_1.config.vehiclePositions.stepBetweenPoints) {
|
|
289
|
+
const shapeId = segmentArr[0].shape_id;
|
|
290
|
+
const shapeCount = segmentArr.length;
|
|
291
|
+
const minimalDistanceLimit = distance / 2;
|
|
292
|
+
const startShapeDistTraveled = segmentArr[0].shape_dist_traveled;
|
|
293
|
+
const endShapeDistTraveled = segmentArr[shapeCount - 1].shape_dist_traveled;
|
|
294
|
+
const shapeDistLength = endShapeDistTraveled - startShapeDistTraveled;
|
|
295
|
+
const segmentLine = turf.lineString(segmentArr.map((s) => {
|
|
296
|
+
return [s.shape_pt_lon, s.shape_pt_lat];
|
|
297
|
+
}));
|
|
298
|
+
// because we dont believe source shape distances, rather compute length with turf.js
|
|
299
|
+
const segmentLength = turf.length(segmentLine);
|
|
300
|
+
const middlePointsCount = Math.floor(segmentLength / distance);
|
|
301
|
+
const distanceOffset = (segmentLength - distance * middlePointsCount) / 2;
|
|
302
|
+
// put first shape point
|
|
303
|
+
const resultSegmentPoints = [
|
|
304
|
+
{
|
|
305
|
+
...segmentArr[0],
|
|
306
|
+
shape_pt_lat: this.roundToDecimals(segmentArr[0].shape_pt_lat),
|
|
307
|
+
shape_pt_lon: this.roundToDecimals(segmentArr[0].shape_pt_lon),
|
|
308
|
+
shape_dist_traveled: this.roundToDecimals(segmentArr[0].shape_dist_traveled, 1000),
|
|
309
|
+
shape_pt_sequence: 1,
|
|
310
|
+
},
|
|
311
|
+
];
|
|
312
|
+
// for each middle point create acording shape point with interpolated origin shape dist traveled
|
|
313
|
+
for (let i = 0; i < middlePointsCount; i++) {
|
|
314
|
+
const currentDistance = i * distance + distanceOffset;
|
|
315
|
+
const currentDistDistance = (shapeDistLength / segmentLength) * currentDistance;
|
|
316
|
+
if (currentDistDistance < minimalDistanceLimit) {
|
|
317
|
+
// point would be too close, skip it
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
const newPoint = turf.along(segmentLine, i * distance + distanceOffset);
|
|
321
|
+
resultSegmentPoints.push({
|
|
322
|
+
shape_id: shapeId,
|
|
323
|
+
shape_at_stop: false,
|
|
324
|
+
shape_pt_sequence: resultSegmentPoints.length + 1,
|
|
325
|
+
shape_pt_lat: this.roundToDecimals(newPoint.geometry.coordinates[1]),
|
|
326
|
+
shape_pt_lon: this.roundToDecimals(newPoint.geometry.coordinates[0]),
|
|
327
|
+
shape_dist_traveled: this.roundToDecimals(startShapeDistTraveled + currentDistDistance, 1000),
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
return resultSegmentPoints;
|
|
331
|
+
}
|
|
332
|
+
mapGtfsShapesToTripShapes(shapes) {
|
|
333
|
+
return shapes.map((shape) => {
|
|
334
|
+
return {
|
|
335
|
+
dist: shape.shape_dist_traveled,
|
|
336
|
+
coords: [shape.shape_pt_lon, shape.shape_pt_lat],
|
|
337
|
+
};
|
|
338
|
+
});
|
|
288
339
|
}
|
|
289
340
|
}
|
|
290
341
|
exports.DelayComputationManager = DelayComputationManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelayComputationManager.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wEAAqE;AACrE,yEAAsE;AACtE,2EAAoE;AACpE,mEAAuF;AACvF,6EAAwE;AACxE,iDAAmC;AAGnC,MAAa,uBAAuB;IAKhC,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;QAJ7D,4BAAuB,GAAG,gBAAgB,CAAC;QAYnD;;;;;WAKG;QACI,yBAAoB,GAAG,KAAK,EAAE,MAAc,EAAoC,EAAE;YACrF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;YACpF,IAAI,CAAC,QAAQ,EAAE;gBACX,aAAG,CAAC,IAAI,CAAC,mCAAmC,MAAM,gBAAgB,CAAC,CAAC;gBACpE,OAAO,IAAI,CAAC;aACf;YAED,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;YAClD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE;gBACjB,MAAM,IAAI,6BAAY,CAAC,mCAAmC,MAAM,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aAC5G;iBAAM,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE;gBAC5B,MAAM,IAAI,6BAAY,CAAC,mCAAmC,MAAM,oBAAoB,EAAE,IAAI,CA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,mBAAmB;iBACpE,CAAC,CAAC;aACN;YACD,OAAO,mBAAmB,CAAC;QAC/B,CAAC,CAAC;QAEM,8BAAyB,GAAG,CAAC,MAAgB,EAA2B,EAAE;YAC9E,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBACxB,OAAO;oBACH,IAAI,EAAE,KAAK,CAAC,mBAAmB;oBAC/B,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC;iBACnD,CAAC;YACN,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QAvSE,MAAM,YAAY,GAAG,gCAA0B,CAAC,OAAO,CAAgB,qBAAS,CAAC,YAAY,CAAC,CAAC;QAC/F,IAAI,CAAC,iBAAiB,GAAG,eAAM,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;QACnE,IAAI,CAAC,yBAAyB,GAAG,MAAM,CACnC,YAAY,CAAC,QAAQ,CAAC,qEAAqE,EAAE,OAAO,CAAC,CACxG,CAAC;IACN,CAAC;CAmSJ;AA9SD,0DA8SC"}
|
|
1
|
+
{"version":3,"file":"DelayComputationManager.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DelayComputationManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wEAAqE;AACrE,yEAAsE;AACtE,2EAAoE;AACpE,mEAAuF;AACvF,6EAAwE;AACxE,iDAAmC;AAGnC,MAAa,uBAAuB;IAKhC,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;QAJ7D,4BAAuB,GAAG,gBAAgB,CAAC;QAK/C,MAAM,YAAY,GAAG,gCAA0B,CAAC,OAAO,CAAgB,qBAAS,CAAC,YAAY,CAAC,CAAC;QAC/F,IAAI,CAAC,iBAAiB,GAAG,eAAM,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;QACnE,IAAI,CAAC,yBAAyB,GAAG,MAAM,C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