@golemio/pid 6.0.2 → 6.0.3-dev.2946669933
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 +2 -1
- package/db/migrations/postgresql/20261009120000-case-insensitive-assigned-stop-id.js +16 -0
- package/db/migrations/postgresql/20261012120000-cis-stop-platforms-view.js +16 -0
- package/db/migrations/postgresql/sqls/20261009120000-case-insensitive-assigned-stop-id-down.sql +64 -0
- package/db/migrations/postgresql/sqls/20261009120000-case-insensitive-assigned-stop-id-up.sql +65 -0
- package/db/migrations/postgresql/sqls/20261012120000-cis-stop-platforms-view-down.sql +5 -0
- package/db/migrations/postgresql/sqls/20261012120000-cis-stop-platforms-view-up.sql +33 -0
- 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/data-access/views/CisStopPlatformRepository.d.ts +12 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/CisStopPlatformRepository.js +47 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/views/CisStopPlatformRepository.js.map +1 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.d.ts +8 -3
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js +41 -31
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/CisStopPlatformModel.d.ts +17 -0
- package/dist/schema-definitions/vehicle-positions/models/views/CisStopPlatformModel.js +22 -0
- package/dist/schema-definitions/vehicle-positions/models/views/CisStopPlatformModel.js.map +1 -0
- package/dist/schema-definitions/vehicle-positions/models/views/index.d.ts +1 -0
- package/dist/schema-definitions/vehicle-positions/models/views/index.js +1 -0
- package/dist/schema-definitions/vehicle-positions/models/views/index.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.d.ts +6 -0
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.js +2 -0
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.js.map +1 -0
- package/docs/cache/types/redis.md +1 -1
- package/docs/implementation_documentation.md +1 -1
- package/docs/processing/input_realtime_data/http_mpvnet.md +8 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
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)
|
|
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);
|
|
4
5
|
|
|
5
6
|
-- ropidgtfs_stops_actual
|
|
6
7
|
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
|
|
@@ -0,0 +1,16 @@
|
|
|
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 };
|
|
@@ -0,0 +1,16 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
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 ropidgtfs_stops_actual_parent_station_upper_platform_code_idx;
|
|
@@ -0,0 +1,65 @@
|
|
|
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 ropidgtfs_stops_actual_parent_station_platform_code_idx;
|
|
@@ -0,0 +1,33 @@
|
|
|
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;
|
|
@@ -34,6 +34,7 @@ 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";
|
|
37
38
|
import { PositionsManager } from "../workers/vehicle-positions/helpers/PositionsManager.js";
|
|
38
39
|
import { ValidToCalculator } from "../workers/vehicle-positions/helpers/ValidToCalculator.js";
|
|
39
40
|
import { GtfsTripDataFixerFactory } from "../workers/vehicle-positions/helpers/gtfs-trip-data/GtfsTripDataFixerFactory.js";
|
|
@@ -57,7 +58,6 @@ import { CisStopRepository } from "../workers/vehicle-positions/data-access/CisS
|
|
|
57
58
|
import { MpvMessageTransformation } from "../workers/vehicle-positions/transformations/MpvMessageTransformation.js";
|
|
58
59
|
import { RopidGTFSTripsModel } from "#ie/ropid-gtfs/RopidGTFSTripsModel";
|
|
59
60
|
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,6 +86,7 @@ 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);
|
|
89
90
|
VPContainer.register(VPContainerToken.PublicApiCacheRepository, PublicApiCacheRepository);
|
|
90
91
|
VPContainer.register(VPContainerToken.PublicStopTimeCacheRepository, PublicStopTimeCacheRepository);
|
|
91
92
|
VPContainer.registerSingleton(VPContainerToken.MetroRailtrackGPSRepository, MetroRailtrackGPSRepository);
|
|
@@ -123,7 +124,6 @@ VPContainer.register(VPContainerToken.MetroShapePointsFixer, MetroShapePointsFix
|
|
|
123
124
|
VPContainer.register(VPContainerToken.MpvMessageTransformation, MpvMessageTransformation);
|
|
124
125
|
VPContainer.register(VPContainerToken.RopidGTFSTripsModel, RopidGTFSTripsModel);
|
|
125
126
|
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,OAAO,EAAE,gCAAgC,EAAE,MAAM,mEAAmE,CAAC;AACrH,OAAO,EAAE,2BAA2B,EAAE,MAAM,iFAAiF,CAAC;AAE9H,OAAO,EAAE,iCAAiC,EAAE,MAAM,kEAAkE,CAAC;AACrH,OAAO,EAAE,6BAA6B,EAAE,MAAM,oEAAoE,CAAC;AACnH,OAAO,EAAE,8BAA8B,EAAE,MAAM,qEAAqE,CAAC;AACrH,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OA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G,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,6 +2,7 @@ declare const VPContainerToken: {
|
|
|
2
2
|
NotPublicVehiclesRedisRepository: symbol;
|
|
3
3
|
TripRepository: symbol;
|
|
4
4
|
PublicStopTimeRepository: symbol;
|
|
5
|
+
CisStopPlatformRepository: symbol;
|
|
5
6
|
PublicApiCacheRepository: symbol;
|
|
6
7
|
PublicStopTimeCacheRepository: symbol;
|
|
7
8
|
DelayComputationRepository: symbol;
|
|
@@ -51,7 +52,6 @@ declare const VPContainerToken: {
|
|
|
51
52
|
MpvMessageTransformation: symbol;
|
|
52
53
|
RopidGTFSTripsModel: symbol;
|
|
53
54
|
RopidGTFSStopTimesModel: symbol;
|
|
54
|
-
RopidGTFSCisStopsModel: symbol;
|
|
55
55
|
DelayComputationRedisRepository: symbol;
|
|
56
56
|
BlockStopsRedisRepository: symbol;
|
|
57
57
|
CommonRunsRepository: symbol;
|
|
@@ -3,6 +3,7 @@ const VPContainerToken = {
|
|
|
3
3
|
NotPublicVehiclesRedisRepository: Symbol("NotPublicVehiclesRedisRepository"),
|
|
4
4
|
TripRepository: Symbol("TripRepository"),
|
|
5
5
|
PublicStopTimeRepository: Symbol("PublicStopTimeRepository"),
|
|
6
|
+
CisStopPlatformRepository: Symbol("CisStopPlatformRepository"),
|
|
6
7
|
PublicApiCacheRepository: Symbol("PublicApiCacheRepository"),
|
|
7
8
|
PublicStopTimeCacheRepository: Symbol("PublicStopTimeCacheRepository"),
|
|
8
9
|
DelayComputationRepository: Symbol("DelayComputationRepository"),
|
|
@@ -63,7 +64,6 @@ const VPContainerToken = {
|
|
|
63
64
|
//#region ExternalModels
|
|
64
65
|
RopidGTFSTripsModel: Symbol("RopidGTFSTripsModel"),
|
|
65
66
|
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,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,C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AAE,MAAM,CAAC,wBAAwB,CAAC;IAExD,YAAY;IAEZ,6BAA6B;IAC7B,gCAAgC,EAAE,MAAM,CAAC,kCAAkC,CAAC;IAC5E,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,oBAAoB,EAAE,MAAM,CAAC,sBAAsB,CAAC;IACpD,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,gBAAgB,EAAE,MAAM,CAAC,kBAAkB,CAAC;IAC5C,sBAAsB,EAAE,MAAM,CAAC,wBAAwB,CAAC;IACxD,YAAY;IAEZ,kBAAkB;IAElB,oBAAoB;IACpB,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,0BAA0B,EAAE,MAAM,CAAC,4BAA4B,CAAC;IAChE,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,YAAY;IAEZ,iBAAiB;IACjB,6BAA6B,EAAE,MAAM,CAAC,+BAA+B,CAAC;IACtE,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IACtD,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IAChD,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,YAAY;IAEZ,wBAAwB;IACxB,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D
|
|
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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BAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D,+BAA+B,EAAE,MAAM,CAAC,iCAAiC,CAAC;IAC1E,yBAAyB,EAAE,MAAM,CAAC,2BAA2B,CAAC;IAC9D,oBAAoB,EAAE,MAAM,CAAC,sBAAsB,CAAC;IACpD,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,YAAY;IAEZ,eAAe;IACf,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,+BAA+B,EAAE,MAAM,CAAC,iCAAiC,CAAC;IAC1E,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IAChD,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D,gBAAgB,EAAE,MAAM,CAAC,kBAAkB,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC;IAC1C,oBAAoB,EAAE,MAAM,CAAC,sBAAsB,CAAC;IACpD,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,YAAY;IAEZ,YAAY;IAEZ,iBAAiB;IACjB,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import { RopidGTFSCisStopsModel } from "#ie/ropid-gtfs/RopidGTFSCisStopsModel";
|
|
2
1
|
import { type IMpvMessageInput } from "#sch/vehicle-positions/interfaces/IMpvMessageInterfaces";
|
|
3
2
|
import { type ILogger } from "@golemio/core/dist/helpers/index.js";
|
|
4
3
|
import { AbstractTask } from "@golemio/core/dist/integration-engine/workers/index.js";
|
|
5
4
|
import { type MessageProperties } from "@golemio/core/dist/shared/amqplib.js";
|
|
6
5
|
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,14 +13,19 @@ 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 cisStopPlatformRepository;
|
|
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, cisStopPlatformRepository: CisStopPlatformRepository, 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
|
+
*/
|
|
24
28
|
private preparePositionsFromCisStops;
|
|
29
|
+
private findStationCoordinatesByCis;
|
|
25
30
|
private getTripDataAndSendToUpdateDelay;
|
|
26
31
|
}
|
|
@@ -11,23 +11,21 @@ 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";
|
|
15
14
|
import { VPContainerToken } from "#ie/vehicle-positions/ioc/VPContainerToken";
|
|
16
15
|
import { CoreToken } from "@golemio/core/dist/helpers/ioc/CoreToken.js";
|
|
17
16
|
import { QueueManager } from "@golemio/core/dist/integration-engine/queueprocessors/index.js";
|
|
18
17
|
import { AbstractTask } from "@golemio/core/dist/integration-engine/workers/index.js";
|
|
19
18
|
import GolemioErrorsCore from "@golemio/core/dist/shared/golemio-errors.js";
|
|
20
19
|
const { AbstractGolemioError, GeneralError } = GolemioErrorsCore;
|
|
21
|
-
import SequelizeCore from "@golemio/core/dist/shared/sequelize.js";
|
|
22
|
-
const { Op } = SequelizeCore;
|
|
23
20
|
import { inject, injectable } from "@golemio/core/dist/shared/tsyringe.js";
|
|
24
21
|
import { CisStopRepository } from "../data-access/CisStopRepository.js";
|
|
22
|
+
import { CisStopPlatformRepository } from "../data-access/views/CisStopPlatformRepository.js";
|
|
25
23
|
import TripsMapper from "../data-access/helpers/TripsMapper.js";
|
|
26
24
|
import { SaveDataToDBValidationSchema } from "../schema/SaveDataToDBSchema.js";
|
|
27
25
|
import { MpvMessageTransformation } from "../transformations/MpvMessageTransformation.js";
|
|
28
26
|
import { WORKER_NAME } from "../constants.js";
|
|
29
27
|
let SaveDataToDBTask = SaveDataToDBTask_1 = class SaveDataToDBTask extends AbstractTask {
|
|
30
|
-
constructor(tripsRepository, cisStopRepository, messageTransformation,
|
|
28
|
+
constructor(tripsRepository, cisStopRepository, messageTransformation, cisStopPlatformRepository, logger) {
|
|
31
29
|
super(WORKER_NAME);
|
|
32
30
|
this.queueName = "saveDataToDB";
|
|
33
31
|
this.queueTtl = 5 * 60 * 1000; // 5 minutes
|
|
@@ -35,7 +33,7 @@ let SaveDataToDBTask = SaveDataToDBTask_1 = class SaveDataToDBTask extends Abstr
|
|
|
35
33
|
this.tripsRepository = tripsRepository;
|
|
36
34
|
this.cisStopRepository = cisStopRepository;
|
|
37
35
|
this.messageTransformation = messageTransformation;
|
|
38
|
-
this.
|
|
36
|
+
this.cisStopPlatformRepository = cisStopPlatformRepository;
|
|
39
37
|
this.logger = logger;
|
|
40
38
|
}
|
|
41
39
|
async execute(data, messageProperties) {
|
|
@@ -134,40 +132,52 @@ let SaveDataToDBTask = SaveDataToDBTask_1 = class SaveDataToDBTask extends Abstr
|
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
}
|
|
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
|
+
*/
|
|
137
139
|
async preparePositionsFromCisStops(tripsWithCisStops, trips, tsText, ts) {
|
|
138
140
|
if (!tripsWithCisStops?.size) {
|
|
139
141
|
return [];
|
|
140
142
|
}
|
|
143
|
+
const tripsById = new Map(trips.map((trip) => [trip.id, trip]));
|
|
144
|
+
const stationsByCis = await this.findStationCoordinatesByCis(Array.from(new Set(tripsWithCisStops.values())));
|
|
141
145
|
const newPositions = [];
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
for (const [tripId, cis] of tripsWithCisStops.entries()) {
|
|
147
|
+
const station = stationsByCis.get(cis);
|
|
148
|
+
if (!station) {
|
|
149
|
+
continue;
|
|
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,
|
|
146
155
|
// we want to have positions of a before_track trip valid_to its departure (start_timestamp)
|
|
147
|
-
|
|
156
|
+
trip?.start_timestamp ?? null));
|
|
148
157
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
return newPositions;
|
|
159
|
+
}
|
|
160
|
+
async findStationCoordinatesByCis(cisList) {
|
|
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
|
+
}
|
|
152
168
|
}
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
}
|
|
169
|
+
for (const row of rows) {
|
|
170
|
+
const station = stationsByCis.get(row.cis);
|
|
171
|
+
if (!station || row.platform_code === null) {
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
// MPV and GTFS platform codes may differ in case (e.g. 1a vs 1A)
|
|
175
|
+
const platformKey = row.platform_code.toUpperCase();
|
|
176
|
+
if (!station.platforms.has(platformKey)) {
|
|
177
|
+
station.platforms.set(platformKey, { lat: row.lat, lon: row.lon });
|
|
168
178
|
}
|
|
169
179
|
}
|
|
170
|
-
return
|
|
180
|
+
return stationsByCis;
|
|
171
181
|
}
|
|
172
182
|
async getTripDataAndSendToUpdateDelay(chunk, positions, firstMessageCreatedAt) {
|
|
173
183
|
try {
|
|
@@ -194,11 +204,11 @@ SaveDataToDBTask = SaveDataToDBTask_1 = __decorate([
|
|
|
194
204
|
__param(0, inject(VPContainerToken.TripRepository)),
|
|
195
205
|
__param(1, inject(VPContainerToken.CisStopRepository)),
|
|
196
206
|
__param(2, inject(VPContainerToken.MpvMessageTransformation)),
|
|
197
|
-
__param(3, inject(VPContainerToken.
|
|
207
|
+
__param(3, inject(VPContainerToken.CisStopPlatformRepository)),
|
|
198
208
|
__param(4, inject(CoreToken.Logger)),
|
|
199
209
|
__metadata("design:paramtypes", [Function, CisStopRepository,
|
|
200
210
|
MpvMessageTransformation,
|
|
201
|
-
|
|
211
|
+
CisStopPlatformRepository, Object])
|
|
202
212
|
], SaveDataToDBTask);
|
|
203
213
|
export { SaveDataToDBTask };
|
|
204
214
|
//# 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,
|
|
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,EAA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BACxC,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;AAxQY,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,yBAAyB,CAAC,CAAA;IAClD,WAAA,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;+CAHsC,iBAAiB;QACN,wBAAwB;QACnB,yBAAyB;GAfnG,gBAAgB,CAwQ5B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -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;AACzC,cAAc,2BAA2B,CAAC"}
|
package/dist/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ICisStopPlatformDto.js","sourceRoot":"","sources":["../../../../../../src/schema-definitions/vehicle-positions/models/views/interfaces/ICisStopPlatformDto.ts"],"names":[],"mappings":""}
|
|
@@ -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` + `platform_code = cis_stop_platform_code`, `location_type = 0`)
|
|
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` + `upper(platform_code) = upper(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)
|
|
@@ -1184,7 +1184,7 @@ Pro vlakové spoje, u nichž je v RT datech k dispozici konkrétní nástupišť
|
|
|
1184
1184
|
|
|
1185
1185
|
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).
|
|
1186
1186
|
|
|
1187
|
-
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.
|
|
1187
|
+
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 (bez ohledu na velikost písmen, `upper()` na obou stranách) a `location_type = 0` (fyzická nástupištní zastávka). Pokud takový záznam neexistuje, je `assigned_stop_id` null.
|
|
1188
1188
|
|
|
1189
1189
|
_TripUpdate — StopTimeUpdate_
|
|
1190
1190
|
|
|
@@ -113,6 +113,14 @@ 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
|
+
|
|
116
124
|
```xml
|
|
117
125
|
<?xml version="1.0" encoding="utf-8"?>
|
|
118
126
|
|