@golemio/pid 6.0.3-dev.2950030701 → 6.1.0-rc.2962175727
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/db/example/19_train_trip_with_cis_platform_code.sql +1 -2
- package/dist/integration-engine/vehicle-positions/ioc/Di.js +2 -2
- package/dist/integration-engine/vehicle-positions/ioc/Di.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/ioc/VPContainerToken.d.ts +1 -1
- package/dist/integration-engine/vehicle-positions/ioc/VPContainerToken.js +1 -1
- package/dist/integration-engine/vehicle-positions/ioc/VPContainerToken.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.d.ts +3 -8
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js +31 -41
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/index.d.ts +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/index.js +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/index.js.map +1 -1
- package/docs/cache/types/redis.md +1 -1
- package/docs/implementation_documentation.md +1 -1
- package/docs/processing/input_realtime_data/http_mpvnet.md +0 -8
- package/package.json +6 -6
- package/db/migrations/postgresql/20261009120000-case-insensitive-assigned-stop-id.js +0 -16
- package/db/migrations/postgresql/20261012120000-cis-stop-platforms-view.js +0 -16
- package/db/migrations/postgresql/sqls/20261009120000-case-insensitive-assigned-stop-id-down.sql +0 -65
- package/db/migrations/postgresql/sqls/20261009120000-case-insensitive-assigned-stop-id-up.sql +0 -66
- package/db/migrations/postgresql/sqls/20261012120000-cis-stop-platforms-view-down.sql +0 -5
- package/db/migrations/postgresql/sqls/20261012120000-cis-stop-platforms-view-up.sql +0 -33
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/CisStopPlatformRepository.d.ts +0 -12
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/CisStopPlatformRepository.js +0 -47
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/CisStopPlatformRepository.js.map +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/CisStopPlatformModel.d.ts +0 -17
- package/dist/schema-definitions/vehicle-positions/models/views/CisStopPlatformModel.js +0 -22
- package/dist/schema-definitions/vehicle-positions/models/views/CisStopPlatformModel.js.map +0 -1
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.d.ts +0 -6
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.js +0 -2
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
-- ropidgtfs_cis_stops_actual
|
|
2
2
|
INSERT INTO ropidgtfs_cis_stops_actual (alt_idos_name,cis,id,jtsk_x,jtsk_y,lat,lon,platform,wheelchair_access,"zone",create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
|
|
3
|
-
('Praha hl.n.',5457076,'142/301',-741816.7,-1043640.06,50.0830956,14.4361944,NULL,'possible','P',NULL,'2024-02-06 05:23:14.828',NULL,NULL,'2024-02-06 05:23:14.828',NULL)
|
|
4
|
-
('Kolín',5453414,'2816/301',-687399.75,-1057319.25,50.0252457,15.21459,NULL,'possible','6',NULL,'2024-02-06 05:23:14.828',NULL,NULL,'2024-02-06 05:23:14.828',NULL);
|
|
3
|
+
('Praha hl.n.',5457076,'142/301',-741816.7,-1043640.06,50.0830956,14.4361944,NULL,'possible','P',NULL,'2024-02-06 05:23:14.828',NULL,NULL,'2024-02-06 05:23:14.828',NULL);
|
|
5
4
|
|
|
6
5
|
-- ropidgtfs_stops_actual
|
|
7
6
|
INSERT INTO ropidgtfs_stops_actual (location_type,parent_station,platform_code,stop_id,stop_lat,stop_lon,stop_name,stop_url,wheelchair_boarding,zone_id,level_id,stop_code,stop_desc,stop_timezone,asw_node_id,asw_stop_id,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
|
|
@@ -34,7 +34,6 @@ import { PublicApiCacheRepository } from "../workers/vehicle-positions/data-acce
|
|
|
34
34
|
import { PublicStopTimeCacheRepository } from "../workers/vehicle-positions/data-access/cache/PublicStopTimeCacheRepository.js";
|
|
35
35
|
import { CachedMetroRailTrackLookup } from "../workers/vehicle-positions/data-access/metro/CachedMetroRailtrackLookup.js";
|
|
36
36
|
import { PublicStopTimeRepository } from "../workers/vehicle-positions/data-access/views/PublicStopTimeRepository.js";
|
|
37
|
-
import { CisStopPlatformRepository } from "../workers/vehicle-positions/data-access/views/CisStopPlatformRepository.js";
|
|
38
37
|
import { PositionsManager } from "../workers/vehicle-positions/helpers/PositionsManager.js";
|
|
39
38
|
import { ValidToCalculator } from "../workers/vehicle-positions/helpers/ValidToCalculator.js";
|
|
40
39
|
import { GtfsTripDataFixerFactory } from "../workers/vehicle-positions/helpers/gtfs-trip-data/GtfsTripDataFixerFactory.js";
|
|
@@ -58,6 +57,7 @@ import { CisStopRepository } from "../workers/vehicle-positions/data-access/CisS
|
|
|
58
57
|
import { MpvMessageTransformation } from "../workers/vehicle-positions/transformations/MpvMessageTransformation.js";
|
|
59
58
|
import { RopidGTFSTripsModel } from "#ie/ropid-gtfs/RopidGTFSTripsModel";
|
|
60
59
|
import { RopidGTFSStopTimesModel } from "#ie/ropid-gtfs/RopidGTFSStopTimesModel";
|
|
60
|
+
import { RopidGTFSCisStopsModel } from "#ie/ropid-gtfs/RopidGTFSCisStopsModel";
|
|
61
61
|
import { BlockStopsRedisRepository, DelayComputationRedisRepository } from "#ie/ropid-gtfs/data-access/cache/index";
|
|
62
62
|
import { CommonRunsRepository } from "../workers/runs/data-access/CommonRunsRepository.js";
|
|
63
63
|
import { RunTripsRedisRepository } from "#ie/ropid-gtfs/data-access/cache/RunTripsRedisRepository";
|
|
@@ -86,7 +86,6 @@ VPContainer.register(VPContainerToken.RegionalBusCisCacheRepository, RegionalBus
|
|
|
86
86
|
VPContainer.register(VPContainerToken.RegionalBusGtfsCacheRepository, RegionalBusGtfsCacheRepository);
|
|
87
87
|
VPContainer.register(VPContainerToken.RegionalBusRunsMessagesRepository, RegionalBusRunsMessagesRepository);
|
|
88
88
|
VPContainer.register(VPContainerToken.PublicStopTimeRepository, PublicStopTimeRepository);
|
|
89
|
-
VPContainer.register(VPContainerToken.CisStopPlatformRepository, CisStopPlatformRepository);
|
|
90
89
|
VPContainer.register(VPContainerToken.PublicApiCacheRepository, PublicApiCacheRepository);
|
|
91
90
|
VPContainer.register(VPContainerToken.PublicStopTimeCacheRepository, PublicStopTimeCacheRepository);
|
|
92
91
|
VPContainer.registerSingleton(VPContainerToken.MetroRailtrackGPSRepository, MetroRailtrackGPSRepository);
|
|
@@ -124,6 +123,7 @@ VPContainer.register(VPContainerToken.MetroShapePointsFixer, MetroShapePointsFix
|
|
|
124
123
|
VPContainer.register(VPContainerToken.MpvMessageTransformation, MpvMessageTransformation);
|
|
125
124
|
VPContainer.register(VPContainerToken.RopidGTFSTripsModel, RopidGTFSTripsModel);
|
|
126
125
|
VPContainer.register(VPContainerToken.RopidGTFSStopTimesModel, RopidGTFSStopTimesModel);
|
|
126
|
+
VPContainer.register(VPContainerToken.RopidGTFSCisStopsModel, RopidGTFSCisStopsModel);
|
|
127
127
|
VPContainer.register(VPContainerToken.DelayComputationRedisRepository, DelayComputationRedisRepository);
|
|
128
128
|
VPContainer.register(VPContainerToken.BlockStopsRedisRepository, BlockStopsRedisRepository);
|
|
129
129
|
VPContainer.register(JISContainerToken.JISEventsRopidGTFSRoutesRepository, JISEventsRopidGTFSRoutesRepository);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/vehicle-positions/ioc/Di.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OA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qB,CAAC,CAAC;AACpF,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,2BAA2B,EAAE,2BAA2B,CAAC,CAAC;AACzG,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;AACrF,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,+BAA+B,EAAE,+BAA+B,CAAC,CAAC;AACjH,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;AACvF,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,uBAAuB,EAAE,uBAAuB,CAAC,CAAC;AACjG,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;AACnF,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;AACjF,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;AAC3F,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC;AACnG,YAAY;AAEZ,iBAAiB;AACjB,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;AAC7F,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;AACrF,YAAY;AAEZ,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -2,7 +2,6 @@ declare const VPContainerToken: {
|
|
|
2
2
|
NotPublicVehiclesRedisRepository: symbol;
|
|
3
3
|
TripRepository: symbol;
|
|
4
4
|
PublicStopTimeRepository: symbol;
|
|
5
|
-
CisStopPlatformRepository: symbol;
|
|
6
5
|
PublicApiCacheRepository: symbol;
|
|
7
6
|
PublicStopTimeCacheRepository: symbol;
|
|
8
7
|
DelayComputationRepository: symbol;
|
|
@@ -52,6 +51,7 @@ declare const VPContainerToken: {
|
|
|
52
51
|
MpvMessageTransformation: symbol;
|
|
53
52
|
RopidGTFSTripsModel: symbol;
|
|
54
53
|
RopidGTFSStopTimesModel: symbol;
|
|
54
|
+
RopidGTFSCisStopsModel: symbol;
|
|
55
55
|
DelayComputationRedisRepository: symbol;
|
|
56
56
|
BlockStopsRedisRepository: symbol;
|
|
57
57
|
CommonRunsRepository: symbol;
|
|
@@ -3,7 +3,6 @@ const VPContainerToken = {
|
|
|
3
3
|
NotPublicVehiclesRedisRepository: Symbol("NotPublicVehiclesRedisRepository"),
|
|
4
4
|
TripRepository: Symbol("TripRepository"),
|
|
5
5
|
PublicStopTimeRepository: Symbol("PublicStopTimeRepository"),
|
|
6
|
-
CisStopPlatformRepository: Symbol("CisStopPlatformRepository"),
|
|
7
6
|
PublicApiCacheRepository: Symbol("PublicApiCacheRepository"),
|
|
8
7
|
PublicStopTimeCacheRepository: Symbol("PublicStopTimeCacheRepository"),
|
|
9
8
|
DelayComputationRepository: Symbol("DelayComputationRepository"),
|
|
@@ -64,6 +63,7 @@ const VPContainerToken = {
|
|
|
64
63
|
//#region ExternalModels
|
|
65
64
|
RopidGTFSTripsModel: Symbol("RopidGTFSTripsModel"),
|
|
66
65
|
RopidGTFSStopTimesModel: Symbol("RopidGTFSStopTimesModel"),
|
|
66
|
+
RopidGTFSCisStopsModel: Symbol("RopidGTFSCisStopsModel"),
|
|
67
67
|
DelayComputationRedisRepository: Symbol("DelayComputationRedisRepository"),
|
|
68
68
|
BlockStopsRedisRepository: Symbol("BlockStopsRedisRepository"),
|
|
69
69
|
CommonRunsRepository: Symbol("CommonRunsRepository"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VPContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/vehicle-positions/ioc/VPContainerToken.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;IACrB,2BAA2B;IAC3B,gCAAgC,EAAE,MAAM,CAAC,kCAAkC,CAAC;IAC5E,cAAc,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACxC,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,
|
|
1
|
+
{"version":3,"file":"VPContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/vehicle-positions/ioc/VPContainerToken.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG;IACrB,2BAA2B;IAC3B,gCAAgC,EAAE,MAAM,CAAC,kCAAkC,CAAC;IAC5E,cAAc,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACxC,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,6BAA6B,EAAE,MAAM,CAAC,+BAA+B,CAAC;IACtE,0BAA0B,EAAE,MAAM,CAAC,4BAA4B,CAAC;IAChE,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IACtD,0BAA0B,EAAE,MAAM,CAAC,4BAA4B,CAAC;IAChE,8BAA8B,EAAE,MAAM,CAAC,gCAAgC,CAAC;IACxE,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D,gBAAgB,EAAE,MAAM,CAAC,kBAAkB,CAAC;IAC5C,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,YAAY;IAEZ,cAAc;IACd,6BAA6B,EAAE,MAAM,CAAC,+BAA+B,CAAC;IACtE,8BAA8B,EAAE,MAAM,CAAC,gCAAgC,CAAC;IACxE,iCAAiC,EAAE,MAAM,CAAC,mCAAmC,CAAC;IAC9E,qCAAqC,EAAE,MAAM,CAAC,uCAAuC,CAAC;IACtF,gBAAgB,EAAE,MAAM,CAAC,kBAAkB,CAAC;IAC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AC;IACtD,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,YAAY;IAEZ,oDAAoD;IACpD,sBAAsB,EAAE,MAAM,CAAC,wBAAwB,CAAC;IACxD,YAAY;CACf,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { RopidGTFSCisStopsModel } from "#ie/ropid-gtfs/RopidGTFSCisStopsModel";
|
|
1
2
|
import { type IMpvMessageInput } from "#sch/vehicle-positions/interfaces/IMpvMessageInterfaces";
|
|
2
3
|
import { type ILogger } from "@golemio/core/dist/helpers/index.js";
|
|
3
4
|
import { AbstractTask } from "@golemio/core/dist/integration-engine/workers/index.js";
|
|
4
5
|
import { type MessageProperties } from "@golemio/core/dist/shared/amqplib.js";
|
|
5
6
|
import { CisStopRepository } from "../data-access/CisStopRepository.js";
|
|
6
|
-
import { CisStopPlatformRepository } from "../data-access/views/CisStopPlatformRepository.js";
|
|
7
7
|
import type { TripsRepository } from "../data-access/TripsRepository.js";
|
|
8
8
|
import { SaveDataToDBValidationSchema } from "../schema/SaveDataToDBSchema.js";
|
|
9
9
|
import { MpvMessageTransformation } from "../transformations/MpvMessageTransformation.js";
|
|
@@ -13,19 +13,14 @@ export declare class SaveDataToDBTask extends AbstractTask<IMpvMessageInput> {
|
|
|
13
13
|
readonly schema: typeof SaveDataToDBValidationSchema;
|
|
14
14
|
private readonly tripsRepository;
|
|
15
15
|
private readonly cisStopRepository;
|
|
16
|
-
private readonly
|
|
16
|
+
private readonly ropidGTFSCisStopsModel;
|
|
17
17
|
private readonly messageTransformation;
|
|
18
18
|
private readonly logger;
|
|
19
|
-
constructor(tripsRepository: TripsRepository, cisStopRepository: CisStopRepository, messageTransformation: MpvMessageTransformation,
|
|
19
|
+
constructor(tripsRepository: TripsRepository, cisStopRepository: CisStopRepository, messageTransformation: MpvMessageTransformation, ropidGTFSCisStopsModel: RopidGTFSCisStopsModel, logger: ILogger);
|
|
20
20
|
protected execute(data: IMpvMessageInput, messageProperties?: MessageProperties): Promise<void>;
|
|
21
21
|
private saveStops;
|
|
22
22
|
private sendDataToUpdateGtfsTripId;
|
|
23
23
|
private sendDataToUpdateDelay;
|
|
24
|
-
/**
|
|
25
|
-
* Synthetic before_track position is placed on the GTFS platform of the current track
|
|
26
|
-
* (`start_cis_stop_platform_code`) when mapped, otherwise on the station coordinates.
|
|
27
|
-
*/
|
|
28
24
|
private preparePositionsFromCisStops;
|
|
29
|
-
private findStationCoordinatesByCis;
|
|
30
25
|
private getTripDataAndSendToUpdateDelay;
|
|
31
26
|
}
|
|
@@ -11,21 +11,23 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
13
|
var SaveDataToDBTask_1;
|
|
14
|
+
import { RopidGTFSCisStopsModel } from "#ie/ropid-gtfs/RopidGTFSCisStopsModel";
|
|
14
15
|
import { VPContainerToken } from "#ie/vehicle-positions/ioc/VPContainerToken";
|
|
15
16
|
import { CoreToken } from "@golemio/core/dist/helpers/ioc/CoreToken.js";
|
|
16
17
|
import { QueueManager } from "@golemio/core/dist/integration-engine/queueprocessors/index.js";
|
|
17
18
|
import { AbstractTask } from "@golemio/core/dist/integration-engine/workers/index.js";
|
|
18
19
|
import GolemioErrorsCore from "@golemio/core/dist/shared/golemio-errors.js";
|
|
19
20
|
const { AbstractGolemioError, GeneralError } = GolemioErrorsCore;
|
|
21
|
+
import SequelizeCore from "@golemio/core/dist/shared/sequelize.js";
|
|
22
|
+
const { Op } = SequelizeCore;
|
|
20
23
|
import { inject, injectable } from "@golemio/core/dist/shared/tsyringe.js";
|
|
21
24
|
import { CisStopRepository } from "../data-access/CisStopRepository.js";
|
|
22
|
-
import { CisStopPlatformRepository } from "../data-access/views/CisStopPlatformRepository.js";
|
|
23
25
|
import TripsMapper from "../data-access/helpers/TripsMapper.js";
|
|
24
26
|
import { SaveDataToDBValidationSchema } from "../schema/SaveDataToDBSchema.js";
|
|
25
27
|
import { MpvMessageTransformation } from "../transformations/MpvMessageTransformation.js";
|
|
26
28
|
import { WORKER_NAME } from "../constants.js";
|
|
27
29
|
let SaveDataToDBTask = SaveDataToDBTask_1 = class SaveDataToDBTask extends AbstractTask {
|
|
28
|
-
constructor(tripsRepository, cisStopRepository, messageTransformation,
|
|
30
|
+
constructor(tripsRepository, cisStopRepository, messageTransformation, ropidGTFSCisStopsModel, logger) {
|
|
29
31
|
super(WORKER_NAME);
|
|
30
32
|
this.queueName = "saveDataToDB";
|
|
31
33
|
this.queueTtl = 5 * 60 * 1000; // 5 minutes
|
|
@@ -33,7 +35,7 @@ let SaveDataToDBTask = SaveDataToDBTask_1 = class SaveDataToDBTask extends Abstr
|
|
|
33
35
|
this.tripsRepository = tripsRepository;
|
|
34
36
|
this.cisStopRepository = cisStopRepository;
|
|
35
37
|
this.messageTransformation = messageTransformation;
|
|
36
|
-
this.
|
|
38
|
+
this.ropidGTFSCisStopsModel = ropidGTFSCisStopsModel;
|
|
37
39
|
this.logger = logger;
|
|
38
40
|
}
|
|
39
41
|
async execute(data, messageProperties) {
|
|
@@ -132,52 +134,40 @@ let SaveDataToDBTask = SaveDataToDBTask_1 = class SaveDataToDBTask extends Abstr
|
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Synthetic before_track position is placed on the GTFS platform of the current track
|
|
137
|
-
* (`start_cis_stop_platform_code`) when mapped, otherwise on the station coordinates.
|
|
138
|
-
*/
|
|
139
137
|
async preparePositionsFromCisStops(tripsWithCisStops, trips, tsText, ts) {
|
|
140
138
|
if (!tripsWithCisStops?.size) {
|
|
141
139
|
return [];
|
|
142
140
|
}
|
|
143
|
-
const tripsById = new Map(trips.map((trip) => [trip.id, trip]));
|
|
144
|
-
const stationsByCis = await this.findStationCoordinatesByCis(Array.from(new Set(tripsWithCisStops.values())));
|
|
145
141
|
const newPositions = [];
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
const trip = tripsById.get(tripId);
|
|
152
|
-
const platformCode = trip?.start_cis_stop_platform_code;
|
|
153
|
-
const coordinates = (platformCode && station.platforms.get(platformCode.toUpperCase())) || station;
|
|
154
|
-
newPositions.push(this.messageTransformation.positionWithCisStopCoords(tripId, coordinates.lat.toString(), coordinates.lon.toString(), tsText, ts,
|
|
142
|
+
const cisList = new Set();
|
|
143
|
+
const cisToTrips = new Map();
|
|
144
|
+
const tripToFirstStopDepartureTime = new Map();
|
|
145
|
+
for (const trip of trips) {
|
|
155
146
|
// we want to have positions of a before_track trip valid_to its departure (start_timestamp)
|
|
156
|
-
trip
|
|
147
|
+
tripToFirstStopDepartureTime.set(trip.id, trip.start_timestamp);
|
|
157
148
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const rows = await this.cisStopPlatformRepository.findByCisList(cisList);
|
|
162
|
-
const stationsByCis = new Map();
|
|
163
|
-
// station rows (platform_code null) first, so platforms can be attached to them
|
|
164
|
-
for (const row of rows) {
|
|
165
|
-
if (row.platform_code === null && !stationsByCis.has(row.cis)) {
|
|
166
|
-
stationsByCis.set(row.cis, { lat: row.lat, lon: row.lon, platforms: new Map() });
|
|
167
|
-
}
|
|
149
|
+
for (const [tripId, cisStop] of tripsWithCisStops.entries()) {
|
|
150
|
+
cisList.add(cisStop);
|
|
151
|
+
cisToTrips.set(cisStop, (cisToTrips.get(cisStop) ?? []).concat([tripId]));
|
|
168
152
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
153
|
+
const rawCisStops = await this.ropidGTFSCisStopsModel.find({
|
|
154
|
+
where: {
|
|
155
|
+
cis: { [Op.in]: Array.from(cisList) },
|
|
156
|
+
id: { [Op.like]: `%/301` }, // We want only asw-code like XYZ/301
|
|
157
|
+
},
|
|
158
|
+
attributes: ["cis", "lat", "lon"],
|
|
159
|
+
raw: true,
|
|
160
|
+
});
|
|
161
|
+
for (const cisStop of rawCisStops) {
|
|
162
|
+
if (cisList.has(cisStop.cis) && cisToTrips.has(cisStop.cis)) {
|
|
163
|
+
cisList.delete(cisStop.cis); // prevents to create positions for the same cis stop returning multiple rows
|
|
164
|
+
for (const tripId of cisToTrips.get(cisStop.cis)) {
|
|
165
|
+
const validTo = tripToFirstStopDepartureTime.get(tripId) ?? null;
|
|
166
|
+
newPositions.push(this.messageTransformation.positionWithCisStopCoords(tripId, cisStop.lat, cisStop.lon, tsText, ts, validTo));
|
|
167
|
+
}
|
|
178
168
|
}
|
|
179
169
|
}
|
|
180
|
-
return
|
|
170
|
+
return newPositions;
|
|
181
171
|
}
|
|
182
172
|
async getTripDataAndSendToUpdateDelay(chunk, positions, firstMessageCreatedAt) {
|
|
183
173
|
try {
|
|
@@ -204,11 +194,11 @@ SaveDataToDBTask = SaveDataToDBTask_1 = __decorate([
|
|
|
204
194
|
__param(0, inject(VPContainerToken.TripRepository)),
|
|
205
195
|
__param(1, inject(VPContainerToken.CisStopRepository)),
|
|
206
196
|
__param(2, inject(VPContainerToken.MpvMessageTransformation)),
|
|
207
|
-
__param(3, inject(VPContainerToken.
|
|
197
|
+
__param(3, inject(VPContainerToken.RopidGTFSCisStopsModel)),
|
|
208
198
|
__param(4, inject(CoreToken.Logger)),
|
|
209
199
|
__metadata("design:paramtypes", [Function, CisStopRepository,
|
|
210
200
|
MpvMessageTransformation,
|
|
211
|
-
|
|
201
|
+
RopidGTFSCisStopsModel, Object])
|
|
212
202
|
], SaveDataToDBTask);
|
|
213
203
|
export { SaveDataToDBTask };
|
|
214
204
|
//# sourceMappingURL=SaveDataToDBTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveDataToDBTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAK9E,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,gEAAgE,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,wDAAwD,CAAC;AACtF,OAAO,iBAAiB,MAAM,6CAA6C,CAAC;AAC5E,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,GAAG,iBAAiB,CAAC;AAGjE,OAAO,
|
|
1
|
+
{"version":3,"file":"SaveDataToDBTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAK9E,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,gEAAgE,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,wDAAwD,CAAC;AACtF,OAAO,iBAAiB,MAAM,6CAA6C,CAAC;AAC5E,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,GAAG,iBAAiB,CAAC;AAGjE,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,MAAM,EAAE,EAAE,EAAE,GAAG,aAAa,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAGhE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,g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AAC,KAAK,CAAC,CAAC;YAC3E,MAAM,YAAY,CAAC,qBAAqB,CACpC,IAAI,CAAC,WAAW,EAChB,aAAa,EACb;gBACI,YAAY;gBACZ,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;aAC/E,EACD;gBACI,SAAS,EAAE,qBAAqB;aACnC,CACJ,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;gBACxC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,YAAY,CACZ,0CAA0C,EAC1C,kBAAgB,CAAC,IAAI,EACrB,KAAK,EACL,SAAS,EACT,KAAK,EACL,IAAI,CAAC,SAAS,CACjB,CACJ,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;CACJ,CAAA;AA9PY,gBAAgB;IAD5B,UAAU,EAAE;IAaJ,WAAA,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAA;IACvC,WAAA,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAC1C,WAAA,MAAM,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,CAAA;IACjD,WAAA,MAAM,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAA;IAC/C,WAAA,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;+CAHsC,iBAAiB;QACN,wBAAwB;QACzB,sBAAsB;GAf1F,gBAAgB,CA8P5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/views/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/views/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
|
@@ -288,7 +288,7 @@ flowchart TD
|
|
|
288
288
|
- `platform_code` - označení zastávky podle GTFS
|
|
289
289
|
- `stop_id` - GTFS id zastávky
|
|
290
290
|
- `stop_name` - název zastávky
|
|
291
|
-
- `assigned_stop_id` - GTFS `stop_id` konkrétního nástupištního záznamu (pro vlaky, kde se podařilo spárovat CIS `cis_stop_platform_code` s nástupištní zastávkou v GTFS); `null` pokud k přiřazení nedošlo nebo nejde o vlak; zdroj: pohled `v_public_vehiclepositions_combined_stop_times` (self-join na `ropidgtfs_stops` přes `parent_station` + `
|
|
291
|
+
- `assigned_stop_id` - GTFS `stop_id` konkrétního nástupištního záznamu (pro vlaky, kde se podařilo spárovat CIS `cis_stop_platform_code` s nástupištní zastávkou v GTFS); `null` pokud k přiřazení nedošlo nebo nejde o vlak; zdroj: pohled `v_public_vehiclepositions_combined_stop_times` (self-join na `ropidgtfs_stops` přes `parent_station` + `platform_code = cis_stop_platform_code`, `location_type = 0`)
|
|
292
292
|
- TTL 1 hodina a 5 minut
|
|
293
293
|
- Automatické promazání dat po úspěšném načtení GTFS jíždních řádů
|
|
294
294
|
- Cca jednou za 5 vteřin se přenačtou stop times pro všechny aktivní spoje. Generování může běžet pouze jednou, po dokončení tasku se spustí znovu (max čekání 4.8 vteřin)
|
|
@@ -1193,7 +1193,7 @@ Pro vlakové spoje, u nichž je v RT datech k dispozici konkrétní nástupišť
|
|
|
1193
1193
|
|
|
1194
1194
|
Tok dat: pohled `v_public_vehiclepositions_combined_stop_times` (sloupec `assigned_stop_id`, snake_case) → cache `IPublicStopTimeCacheDto.assigned_stop_id` (snake_case) → `GenerateFilesTask` (camelCase v protobuf polích).
|
|
1195
1195
|
|
|
1196
|
-
Pohled `v_public_vehiclepositions_combined_stop_times` odvozuje `assigned_stop_id` self-joinem na tabulku `ropidgtfs_stops`: hledá záznam, kde `parent_station` odpovídá stanici obsluhované zastávky, `platform_code` se rovná `cis_stop_platform_code` z RT dat
|
|
1196
|
+
Pohled `v_public_vehiclepositions_combined_stop_times` odvozuje `assigned_stop_id` self-joinem na tabulku `ropidgtfs_stops`: hledá záznam, kde `parent_station` odpovídá stanici obsluhované zastávky, `platform_code` se rovná `cis_stop_platform_code` z RT dat a `location_type = 0` (fyzická nástupištní zastávka). Pokud takový záznam neexistuje, je `assigned_stop_id` null.
|
|
1197
1197
|
|
|
1198
1198
|
_TripUpdate — StopTimeUpdate_
|
|
1199
1199
|
|
|
@@ -113,14 +113,6 @@ Parsování provádí `MpvStopParser.parsePlatformCode()`. Výsledný kód je ul
|
|
|
113
113
|
|
|
114
114
|
Pokud MPVNet zpráva vlaku obsahuje informaci o nástupišti (`$.stan`) pro budoucí zastávku a vlak ještě nemá žádnou aktivní RT polohu, vytvoří se syntetická poloha ve stavu `before_track` na základě dat z této zastávky. Díky tomu lze zobrazit kód nástupiště ještě před fyzickým příjezdem vlaku na stanoviště. Kód nástupiště se parsuje stejným způsobem jako výše (`MpvStopParser.parsePlatformCode()`).
|
|
115
115
|
|
|
116
|
-
Souřadnice syntetické polohy se určují v `SaveDataToDBTask.preparePositionsFromCisStops()` podle první zastávky spoje (`zast[0]`):
|
|
117
|
-
|
|
118
|
-
- souřadnice se čtou z pohledu `v_ropidgtfs_cis_stop_platforms` (`CisStopPlatformRepository`) podle `cis`; pohled pro každou železniční stanici/zastávku (`ropidgtfs_cis_stops` s `platform IS NULL`) vrací řádek se souřadnicemi stanice (`platform_code` null) a řádky se souřadnicemi jejích GTFS nástupišť (přes `ropidgtfs_stops.computed_cis_stop_id` → `parent_station`)
|
|
119
|
-
- pokud je znám kód koleje první zastávky (`start_cis_stop_platform_code`) a v rámci `parent_station` existuje GTFS nástupiště (`location_type = 0`) se shodným `platform_code`, použijí se souřadnice tohoto nástupiště
|
|
120
|
-
- jinak (kolej neznámá nebo nástupiště v GTFS nezmapované) se použijí souřadnice stanice z `ropidgtfs_cis_stops`
|
|
121
|
-
|
|
122
|
-
Kódy kolejí se porovnávají bez ohledu na velikost písmen (MPV posílá např. `1a`, GTFS má `1A`). Při změně koleje před odjezdem vznikne s další MPV zprávou nová poloha na novém nástupišti.
|
|
123
|
-
|
|
124
116
|
```xml
|
|
125
117
|
<?xml version="1.0" encoding="utf-8"?>
|
|
126
118
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/pid",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0-rc.2962175727",
|
|
4
4
|
"description": "Golemio PID Module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"@apideck/portman": "1.29.3",
|
|
85
85
|
"@commitlint/cli": "^11.0.0",
|
|
86
86
|
"@commitlint/config-conventional": "^11.0.0",
|
|
87
|
-
"@golemio/cli": "
|
|
88
|
-
"@golemio/core": "4.
|
|
89
|
-
"@golemio/db-common": "1.2.
|
|
90
|
-
"@golemio/eslint-config": "
|
|
87
|
+
"@golemio/cli": "2.1.0",
|
|
88
|
+
"@golemio/core": "4.1.4",
|
|
89
|
+
"@golemio/db-common": "1.2.4",
|
|
90
|
+
"@golemio/eslint-config": "1.2.0",
|
|
91
91
|
"@swc-node/register": "^1.12.1",
|
|
92
92
|
"@swc/core": "^1.15.10",
|
|
93
93
|
"@types/chai": "^5.2.3",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@golemio/core": "^4.0.1-dev.2 || ^4.0.1"
|
|
124
124
|
},
|
|
125
125
|
"dependencies": {
|
|
126
|
-
"@golemio/ovapi-gtfs-realtime-bindings": "1.4.1
|
|
126
|
+
"@golemio/ovapi-gtfs-realtime-bindings": "1.4.1",
|
|
127
127
|
"@turf/turf": "^6.5.0",
|
|
128
128
|
"cheap-ruler": "^3.0.2",
|
|
129
129
|
"csv-parser": "^3.0.0",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs/promises');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
const runSql = (db, name) =>
|
|
7
|
-
fs.readFile(path.join(__dirname, 'sqls', name), 'utf-8').then((sql) => {
|
|
8
|
-
console.log('received data: ' + sql);
|
|
9
|
-
return db.runSql(sql);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
exports.up = (db) => runSql(db, '20261009120000-case-insensitive-assigned-stop-id-up.sql');
|
|
13
|
-
|
|
14
|
-
exports.down = (db) => runSql(db, '20261009120000-case-insensitive-assigned-stop-id-down.sql');
|
|
15
|
-
|
|
16
|
-
exports._meta = { version: 1 };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs/promises');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
const runSql = (db, name) =>
|
|
7
|
-
fs.readFile(path.join(__dirname, 'sqls', name), 'utf-8').then((sql) => {
|
|
8
|
-
console.log('received data: ' + sql);
|
|
9
|
-
return db.runSql(sql);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
exports.up = (db) => runSql(db, '20261012120000-cis-stop-platforms-view-up.sql');
|
|
13
|
-
|
|
14
|
-
exports.down = (db) => runSql(db, '20261012120000-cis-stop-platforms-view-down.sql');
|
|
15
|
-
|
|
16
|
-
exports._meta = { version: 1 };
|
package/db/migrations/postgresql/sqls/20261009120000-case-insensitive-assigned-stop-id-down.sql
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
create
|
|
2
|
-
or replace view v_public_vehiclepositions_combined_stop_times as
|
|
3
|
-
select
|
|
4
|
-
distinct on (rt_trip_id, stop_sequence) stop_times.rt_trip_id,
|
|
5
|
-
vt.gtfs_trip_id,
|
|
6
|
-
stop_times.stop_sequence,
|
|
7
|
-
stop_times.stop_arr_delay,
|
|
8
|
-
stop_times.stop_dep_delay,
|
|
9
|
-
vt.gtfs_route_type,
|
|
10
|
-
vt.gtfs_route_short_name,
|
|
11
|
-
vt.run_number,
|
|
12
|
-
vt.internal_run_number,
|
|
13
|
-
vt.provider_source_type,
|
|
14
|
-
vt.cis_trip_number,
|
|
15
|
-
vt.vehicle_registration_number,
|
|
16
|
-
stop_times.stop_id,
|
|
17
|
-
vcs.cis_stop_platform_code,
|
|
18
|
-
rs.platform_code,
|
|
19
|
-
rs.stop_name,
|
|
20
|
-
platform.stop_id as assigned_stop_id
|
|
21
|
-
from
|
|
22
|
-
(
|
|
23
|
-
select
|
|
24
|
-
*
|
|
25
|
-
from
|
|
26
|
-
v_public_vehiclepositions_future_stop_times prediction
|
|
27
|
-
union
|
|
28
|
-
all
|
|
29
|
-
select
|
|
30
|
-
*
|
|
31
|
-
from
|
|
32
|
-
v_public_vehiclepositions_past_stop_times history
|
|
33
|
-
) as stop_times
|
|
34
|
-
join vehiclepositions_trips vt on vt.id = stop_times.rt_trip_id
|
|
35
|
-
join vehiclepositions_positions vp on vt.last_position_id = vp.id
|
|
36
|
-
and (
|
|
37
|
-
vp.valid_to is null
|
|
38
|
-
or vp.valid_to >= now()
|
|
39
|
-
)
|
|
40
|
-
and vp.state_position != 'after_track'
|
|
41
|
-
inner join ropidgtfs_stops rs on rs.stop_id = stop_times.stop_id
|
|
42
|
-
left join ropidgtfs_cis_stops rcs on rcs.id = rs.computed_cis_stop_id
|
|
43
|
-
left join vehiclepositions_cis_stops vcs
|
|
44
|
-
on vcs.rt_trip_id = stop_times.rt_trip_id
|
|
45
|
-
and vcs.cis_stop_group_id = rcs.cis
|
|
46
|
-
left join ropidgtfs_stops platform
|
|
47
|
-
on rs.parent_station is not null
|
|
48
|
-
and platform.parent_station = rs.parent_station
|
|
49
|
-
and platform.platform_code = vcs.cis_stop_platform_code
|
|
50
|
-
and platform.location_type = 0
|
|
51
|
-
order by
|
|
52
|
-
rt_trip_id,
|
|
53
|
-
stop_sequence,
|
|
54
|
-
platform.stop_id;
|
|
55
|
-
|
|
56
|
-
create index ropidgtfs_stops_parent_station_platform_code_idx
|
|
57
|
-
on ropidgtfs_stops using btree (parent_station, platform_code);
|
|
58
|
-
|
|
59
|
-
create index ropidgtfs_stops_actual_parent_station_platform_code_idx
|
|
60
|
-
on ropidgtfs_stops_actual using btree (parent_station, platform_code);
|
|
61
|
-
|
|
62
|
-
drop index ropidgtfs_stops_parent_station_upper_platform_code_idx;
|
|
63
|
-
|
|
64
|
-
drop index if exists ropidgtfs_stops_actual_parent_station_upper_platform_code_idx;
|
|
65
|
-
drop index if exists ropidgtfs_stops_tmp_parent_station_upper_idx;
|
package/db/migrations/postgresql/sqls/20261009120000-case-insensitive-assigned-stop-id-up.sql
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
-- MPV and GTFS platform codes differ in case (e.g. 1a vs 1A)
|
|
2
|
-
create
|
|
3
|
-
or replace view v_public_vehiclepositions_combined_stop_times as
|
|
4
|
-
select
|
|
5
|
-
distinct on (rt_trip_id, stop_sequence) stop_times.rt_trip_id,
|
|
6
|
-
vt.gtfs_trip_id,
|
|
7
|
-
stop_times.stop_sequence,
|
|
8
|
-
stop_times.stop_arr_delay,
|
|
9
|
-
stop_times.stop_dep_delay,
|
|
10
|
-
vt.gtfs_route_type,
|
|
11
|
-
vt.gtfs_route_short_name,
|
|
12
|
-
vt.run_number,
|
|
13
|
-
vt.internal_run_number,
|
|
14
|
-
vt.provider_source_type,
|
|
15
|
-
vt.cis_trip_number,
|
|
16
|
-
vt.vehicle_registration_number,
|
|
17
|
-
stop_times.stop_id,
|
|
18
|
-
vcs.cis_stop_platform_code,
|
|
19
|
-
rs.platform_code,
|
|
20
|
-
rs.stop_name,
|
|
21
|
-
platform.stop_id as assigned_stop_id
|
|
22
|
-
from
|
|
23
|
-
(
|
|
24
|
-
select
|
|
25
|
-
*
|
|
26
|
-
from
|
|
27
|
-
v_public_vehiclepositions_future_stop_times prediction
|
|
28
|
-
union
|
|
29
|
-
all
|
|
30
|
-
select
|
|
31
|
-
*
|
|
32
|
-
from
|
|
33
|
-
v_public_vehiclepositions_past_stop_times history
|
|
34
|
-
) as stop_times
|
|
35
|
-
join vehiclepositions_trips vt on vt.id = stop_times.rt_trip_id
|
|
36
|
-
join vehiclepositions_positions vp on vt.last_position_id = vp.id
|
|
37
|
-
and (
|
|
38
|
-
vp.valid_to is null
|
|
39
|
-
or vp.valid_to >= now()
|
|
40
|
-
)
|
|
41
|
-
and vp.state_position != 'after_track'
|
|
42
|
-
inner join ropidgtfs_stops rs on rs.stop_id = stop_times.stop_id
|
|
43
|
-
left join ropidgtfs_cis_stops rcs on rcs.id = rs.computed_cis_stop_id
|
|
44
|
-
left join vehiclepositions_cis_stops vcs
|
|
45
|
-
on vcs.rt_trip_id = stop_times.rt_trip_id
|
|
46
|
-
and vcs.cis_stop_group_id = rcs.cis
|
|
47
|
-
left join ropidgtfs_stops platform
|
|
48
|
-
on rs.parent_station is not null
|
|
49
|
-
and platform.parent_station = rs.parent_station
|
|
50
|
-
and upper(platform.platform_code) = upper(vcs.cis_stop_platform_code)
|
|
51
|
-
and platform.location_type = 0
|
|
52
|
-
order by
|
|
53
|
-
rt_trip_id,
|
|
54
|
-
stop_sequence,
|
|
55
|
-
platform.stop_id;
|
|
56
|
-
|
|
57
|
-
create index ropidgtfs_stops_parent_station_upper_platform_code_idx
|
|
58
|
-
on ropidgtfs_stops using btree (parent_station, upper(platform_code));
|
|
59
|
-
|
|
60
|
-
create index ropidgtfs_stops_actual_parent_station_upper_platform_code_idx
|
|
61
|
-
on ropidgtfs_stops_actual using btree (parent_station, upper(platform_code));
|
|
62
|
-
|
|
63
|
-
drop index ropidgtfs_stops_parent_station_platform_code_idx;
|
|
64
|
-
|
|
65
|
-
drop index if exists ropidgtfs_stops_actual_parent_station_platform_code_idx;
|
|
66
|
-
drop index if exists ropidgtfs_stops_tmp_parent_station_platform_code_idx;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
-- Coordinates of a CIS railway station/halt (cis stop without platform) and of its GTFS platforms.
|
|
2
|
-
-- Row with platform_code null holds the station coordinates (fallback).
|
|
3
|
-
create view v_ropidgtfs_cis_stop_platforms as
|
|
4
|
-
select
|
|
5
|
-
rcs.cis,
|
|
6
|
-
null::varchar as platform_code,
|
|
7
|
-
rcs.lat,
|
|
8
|
-
rcs.lon
|
|
9
|
-
from ropidgtfs_cis_stops rcs
|
|
10
|
-
where rcs.platform is null
|
|
11
|
-
union all
|
|
12
|
-
select distinct
|
|
13
|
-
rcs.cis,
|
|
14
|
-
platform.platform_code,
|
|
15
|
-
platform.stop_lat as lat,
|
|
16
|
-
platform.stop_lon as lon
|
|
17
|
-
from ropidgtfs_cis_stops rcs
|
|
18
|
-
join ropidgtfs_stops rs
|
|
19
|
-
on rs.computed_cis_stop_id = rcs.id
|
|
20
|
-
and rs.parent_station is not null
|
|
21
|
-
join ropidgtfs_stops platform
|
|
22
|
-
on platform.parent_station = rs.parent_station
|
|
23
|
-
and platform.location_type = 0
|
|
24
|
-
and platform.platform_code is not null
|
|
25
|
-
where rcs.platform is null;
|
|
26
|
-
|
|
27
|
-
-- partial index matching the view filter; parent index is copied to _actual by GTFS hot swap
|
|
28
|
-
-- (like ... including all), _actual index covers data until the next GTFS import
|
|
29
|
-
create index ropidgtfs_cis_stops_station_cis_idx
|
|
30
|
-
on ropidgtfs_cis_stops using btree (cis) where platform is null;
|
|
31
|
-
|
|
32
|
-
create index ropidgtfs_cis_stops_actual_station_cis_idx
|
|
33
|
-
on ropidgtfs_cis_stops_actual using btree (cis) where platform is null;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CisStopPlatformModel } from "#sch/vehicle-positions/models/views/index";
|
|
2
|
-
import { type ICisStopPlatformDto } from "#sch/vehicle-positions/models/views/interfaces/ICisStopPlatformDto";
|
|
3
|
-
import { type IModel, PostgresModel } from "@golemio/core/dist/integration-engine/models/index.js";
|
|
4
|
-
import type { ModelStatic } from "@golemio/core/dist/shared/sequelize.js";
|
|
5
|
-
export declare class CisStopPlatformRepository extends PostgresModel implements IModel {
|
|
6
|
-
sequelizeModel: ModelStatic<CisStopPlatformModel>;
|
|
7
|
-
constructor();
|
|
8
|
-
/**
|
|
9
|
-
* Find station and platform coordinates for the given CIS stops.
|
|
10
|
-
*/
|
|
11
|
-
findByCisList(cisList: number[]): Promise<ICisStopPlatformDto[]>;
|
|
12
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { PG_SCHEMA } from "#sch/const";
|
|
11
|
-
import { CisStopPlatformModel } from "#sch/vehicle-positions/models/views/index";
|
|
12
|
-
import { PostgresModel } from "@golemio/core/dist/integration-engine/models/index.js";
|
|
13
|
-
import GolemioErrorsCore from "@golemio/core/dist/shared/golemio-errors.js";
|
|
14
|
-
const { GeneralError } = GolemioErrorsCore;
|
|
15
|
-
import GolemioValidatorCore from "@golemio/core/dist/shared/golemio-validator.js";
|
|
16
|
-
const { JSONSchemaValidator } = GolemioValidatorCore;
|
|
17
|
-
import { injectable } from "@golemio/core/dist/shared/tsyringe.js";
|
|
18
|
-
let CisStopPlatformRepository = class CisStopPlatformRepository extends PostgresModel {
|
|
19
|
-
constructor() {
|
|
20
|
-
super("CisStopPlatformRepository", {
|
|
21
|
-
pgTableName: CisStopPlatformModel.tableName,
|
|
22
|
-
pgSchema: PG_SCHEMA,
|
|
23
|
-
outputSequelizeAttributes: CisStopPlatformModel.attributeModel,
|
|
24
|
-
savingType: "insertOnly",
|
|
25
|
-
sequelizeAdditionalSettings: {
|
|
26
|
-
timestamps: false,
|
|
27
|
-
},
|
|
28
|
-
}, new JSONSchemaValidator("CisStopPlatformReadOnly", {}));
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Find station and platform coordinates for the given CIS stops.
|
|
32
|
-
*/
|
|
33
|
-
async findByCisList(cisList) {
|
|
34
|
-
try {
|
|
35
|
-
return await this.sequelizeModel.findAll({ where: { cis: cisList }, raw: true });
|
|
36
|
-
}
|
|
37
|
-
catch (err) {
|
|
38
|
-
throw new GeneralError("Cannot find CIS stop platforms", this.constructor.name, err, 500);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
CisStopPlatformRepository = __decorate([
|
|
43
|
-
injectable(),
|
|
44
|
-
__metadata("design:paramtypes", [])
|
|
45
|
-
], CisStopPlatformRepository);
|
|
46
|
-
export { CisStopPlatformRepository };
|
|
47
|
-
//# sourceMappingURL=CisStopPlatformRepository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CisStopPlatformRepository.js","sourceRoot":"","sources":["../../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/CisStopPlatformRepository.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAe,aAAa,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,iBAAiB,MAAM,6CAA6C,CAAC;AAC5E,MAAM,EAAE,YAAY,EAAE,GAAG,iBAAiB,CAAC;AAC3C,OAAO,oBAAoB,MAAM,gDAAgD,CAAC;AAClF,MAAM,EAAE,mBAAmB,EAAE,GAAG,oBAAoB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAG5D,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,aAAa;IAGxD;QACI,KAAK,CACD,2BAA2B,EAC3B;YACI,WAAW,EAAE,oBAAoB,CAAC,SAAS;YAC3C,QAAQ,EAAE,SAAS;YACnB,yBAAyB,EAAE,oBAAoB,CAAC,cAAc;YAC9D,UAAU,EAAE,YAAY;YACxB,2BAA2B,EAAE;gBACzB,UAAU,EAAE,KAAK;aACpB;SACJ,EACD,IAAI,mBAAmB,CAAC,yBAAyB,EAAE,EAAE,CAAC,CACzD,CAAC;IACN,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,aAAa,CAAC,OAAiB;QACxC,IAAI,CAAC;YACD,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;QACrF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,IAAI,YAAY,CAAC,gCAAgC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC9F,CAAC;IACL,CAAC;CACJ,CAAA;AA7BY,yBAAyB;IADrC,UAAU,EAAE;;GACA,yBAAyB,CA6BrC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ModelAttributes } from "@golemio/core/dist/shared/sequelize.js";
|
|
2
|
-
import SequelizeCore from "@golemio/core/dist/shared/sequelize.js";
|
|
3
|
-
declare const Model: typeof SequelizeCore.Model;
|
|
4
|
-
import { type ICisStopPlatformDto } from "./interfaces/ICisStopPlatformDto.js";
|
|
5
|
-
/**
|
|
6
|
-
* Coordinates of a CIS station and of its GTFS platforms.
|
|
7
|
-
* Row with `platform_code` null holds the station coordinates.
|
|
8
|
-
*/
|
|
9
|
-
export declare class CisStopPlatformModel extends Model<CisStopPlatformModel> implements ICisStopPlatformDto {
|
|
10
|
-
static tableName: string;
|
|
11
|
-
cis: number;
|
|
12
|
-
platform_code: string | null;
|
|
13
|
-
lat: number;
|
|
14
|
-
lon: number;
|
|
15
|
-
static attributeModel: ModelAttributes<CisStopPlatformModel, ICisStopPlatformDto>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import SequelizeCore from "@golemio/core/dist/shared/sequelize.js";
|
|
2
|
-
const { DataTypes, Model } = SequelizeCore;
|
|
3
|
-
/**
|
|
4
|
-
* Coordinates of a CIS station and of its GTFS platforms.
|
|
5
|
-
* Row with `platform_code` null holds the station coordinates.
|
|
6
|
-
*/
|
|
7
|
-
export class CisStopPlatformModel extends Model {
|
|
8
|
-
}
|
|
9
|
-
CisStopPlatformModel.tableName = "v_ropidgtfs_cis_stop_platforms";
|
|
10
|
-
CisStopPlatformModel.attributeModel = {
|
|
11
|
-
cis: {
|
|
12
|
-
type: DataTypes.INTEGER,
|
|
13
|
-
primaryKey: true,
|
|
14
|
-
},
|
|
15
|
-
platform_code: {
|
|
16
|
-
type: DataTypes.STRING,
|
|
17
|
-
primaryKey: true,
|
|
18
|
-
},
|
|
19
|
-
lat: DataTypes.DOUBLE,
|
|
20
|
-
lon: DataTypes.DOUBLE,
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=CisStopPlatformModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CisStopPlatformModel.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/vehicle-positions/models/views/CisStopPlatformModel.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC;AAG3C;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAA2B;;AACnD,8BAAS,GAAG,gCAAgC,CAAC;AAO7C,mCAAc,GAA+D;IACvF,GAAG,EAAE;QACD,IAAI,EAAE,SAAS,CAAC,OAAO;QACvB,UAAU,EAAE,IAAI;KACnB;IACD,aAAa,EAAE;QACX,IAAI,EAAE,SAAS,CAAC,MAAM;QACtB,UAAU,EAAE,IAAI;KACnB;IACD,GAAG,EAAE,SAAS,CAAC,MAAM;IACrB,GAAG,EAAE,SAAS,CAAC,MAAM;CACxB,CAAC"}
|
package/dist/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICisStopPlatformDto.js","sourceRoot":"","sources":["../../../../../../src/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.ts"],"names":[],"mappings":""}
|