@golemio/ndic 1.1.4-dev.856047480 → 1.1.4-dev.872604229
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/00_reset.sql +1 -0
- package/db/example/01_reset3rdParty.sql +0 -9
- package/db/example/02_sql_dump.sql +0 -8
- package/db/migrations/postgresql/20230515142731-regions-traffic-restrictions.js +53 -0
- package/db/migrations/postgresql/sqls/20230515142731-regions-traffic-restrictions-down.sql +3 -0
- package/db/migrations/postgresql/sqls/20230515142731-regions-traffic-restrictions-up.sql +110 -0
- package/dist/integration-engine/LegacyNdicWorker.d.ts +13 -0
- package/dist/integration-engine/LegacyNdicWorker.js +69 -0
- package/dist/integration-engine/LegacyNdicWorker.js.map +1 -0
- package/dist/integration-engine/NdicWorker.d.ts +3 -16
- package/dist/integration-engine/NdicWorker.js +7 -97
- package/dist/integration-engine/NdicWorker.js.map +1 -1
- package/dist/integration-engine/helpers/LteCze90PointsChecker.d.ts +8 -0
- package/dist/integration-engine/helpers/LteCze90PointsChecker.js +40 -0
- package/dist/integration-engine/helpers/LteCze90PointsChecker.js.map +1 -0
- package/dist/integration-engine/helpers/TrafficRestrictionsHelper.d.ts +7 -0
- package/dist/integration-engine/helpers/TrafficRestrictionsHelper.js +58 -0
- package/dist/integration-engine/helpers/TrafficRestrictionsHelper.js.map +1 -0
- package/dist/integration-engine/index.d.ts +3 -1
- package/dist/integration-engine/index.js +4 -1
- package/dist/integration-engine/index.js.map +1 -1
- package/dist/integration-engine/ioc/ContainerToken.d.ts +4 -0
- package/dist/integration-engine/ioc/ContainerToken.js +8 -0
- package/dist/integration-engine/ioc/ContainerToken.js.map +1 -0
- package/dist/integration-engine/ioc/Di.d.ts +3 -0
- package/dist/integration-engine/ioc/Di.js +18 -0
- package/dist/integration-engine/ioc/Di.js.map +1 -0
- package/dist/integration-engine/models/RsdTmcPointsModel.js +16 -2
- package/dist/integration-engine/models/RsdTmcPointsModel.js.map +1 -1
- package/dist/integration-engine/queueDefinitions.js +3 -3
- package/dist/integration-engine/queueDefinitions.js.map +1 -1
- package/dist/integration-engine/tasks/RegionsDataRetention.d.ts +6 -0
- package/dist/integration-engine/tasks/RegionsDataRetention.js +34 -0
- package/dist/integration-engine/tasks/RegionsDataRetention.js.map +1 -0
- package/dist/integration-engine/tasks/SaveTrafficRestrictionsRegions.d.ts +14 -0
- package/dist/integration-engine/tasks/SaveTrafficRestrictionsRegions.js +50 -0
- package/dist/integration-engine/tasks/SaveTrafficRestrictionsRegions.js.map +1 -0
- package/dist/integration-engine/tasks/schema/TrafficRestrictionsRegionsSchema.d.ts +18 -0
- package/dist/integration-engine/tasks/schema/TrafficRestrictionsRegionsSchema.js +29 -0
- package/dist/integration-engine/tasks/schema/TrafficRestrictionsRegionsSchema.js.map +1 -0
- package/dist/integration-engine/transformations/TrafficRestrictionsInterface.d.ts +1 -1
- package/dist/output-gateway/TrafficRouter.d.ts +2 -1
- package/dist/output-gateway/TrafficRouter.js +5 -4
- package/dist/output-gateway/TrafficRouter.js.map +1 -1
- package/dist/output-gateway/models/TrafficRestrictionsModel.js +2 -2
- package/dist/output-gateway/models/TrafficRestrictionsModel.js.map +1 -1
- package/dist/output-gateway/models/index.d.ts +0 -1
- package/dist/output-gateway/models/index.js +0 -1
- package/dist/output-gateway/models/index.js.map +1 -1
- package/dist/output-gateway/transformations/OutputTrafficRestrictionsTransformation.d.ts +4 -3
- package/dist/output-gateway/transformations/OutputTrafficRestrictionsTransformation.js +13 -11
- package/dist/output-gateway/transformations/OutputTrafficRestrictionsTransformation.js.map +1 -1
- package/dist/schema-definitions/index.js +0 -7
- package/dist/schema-definitions/index.js.map +1 -1
- package/docs/implementation_documentation.md +36 -5
- package/docs/ndic_erdiagram.png +0 -0
- package/package.json +4 -2
- package/dist/output-gateway/models/RsdTmcOsmMappingModel.d.ts +0 -17
- package/dist/output-gateway/models/RsdTmcOsmMappingModel.js +0 -71
- package/dist/output-gateway/models/RsdTmcOsmMappingModel.js.map +0 -1
package/db/example/00_reset.sql
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
drop table if exists public.rsd_tmc_osm_mapping;
|
|
2
|
-
CREATE TABLE public.rsd_tmc_osm_mapping (
|
|
3
|
-
lt_start int8 NULL,
|
|
4
|
-
lt_end int8 NULL,
|
|
5
|
-
osm_path text NULL
|
|
6
|
-
);
|
|
7
|
-
CREATE INDEX rsd_tmc_osm_mapping_idx ON public.rsd_tmc_osm_mapping USING btree (lt_start, lt_end);
|
|
8
|
-
|
|
9
|
-
|
|
10
1
|
-- Drop table
|
|
11
2
|
|
|
12
3
|
DROP TABLE if exists public.rsd_tmc_points;
|
|
@@ -9,11 +9,3 @@ VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}':
|
|
|
9
9
|
INSERT INTO ndic_traffic_restrictions
|
|
10
10
|
(exchange, publication_time, publication_creator, situation_id, situation_version, situation_version_time, situation_confidentiality, situation_information_status, situation_urgency, situation_record_version, situation_record_type, situation_record_id, situation_record_creation_time, situation_record_version_time, probability_of_occurrence, "source", validity_status, validity_overall_start_time, validity_overall_end_time, impact_capacity_remaining, impact_number_of_lanes_restricted, impact_number_of_operational_lanes, impact_original_number_of_lanes, impact_traffic_constriction_type, impact_delays_type, impact_delay_time_value, cause, general_public_comment, group_of_locations_type, supplementary_positional_description, destination, alert_c_linear, linear_within_linear_element, global_network_linear, linear_extension, geom_gn_line, geom_openlr_line, situation_record_extension, number_of_obstructions, mobility_of_obstruction, compliance_option, applicable_for_traffic_direction, applicable_for_traffic_type, places_at_which_applicable, for_vehicles_with_characteristics_of, roadworks_duration, roadworks_scale, under_traffic, urgent_roadworks, mobility, subjects, maintenance_vehicles, abnormal_traffic_type, accident_type, group_of_vehicles_involved, car_park_identity, car_park_occupancy, number_of_vacant_parking_spaces, driving_condition_type, construction_work_type, disturbance_activity_type, environmental_obstruction_type, general_instruction_to_road_users_type, general_message_to_road_users, general_network_management_type, traffic_manually_directed_by, infrastructure_damage_type, road_maintenance_type, non_weather_related_road_condition_type, poor_environment_type, public_event_type, rerouting_management_type, rerouting_itinerary_description, signed_rerouting, entry, "exit", road_or_junction_number, road_or_carriageway_or_lane_management_type, minimum_car_occupancy, roadside_assistance_type, speed_management_type, temporary_speed_limit, vehicle_obstruction_type, obstructing_vehicle, winter_equipment_management_type, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, geom_alert_c_line, alert_c_direction)
|
|
11
11
|
VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}'::json, '2021-06-21 09:53:37.000', '{"country":"cz","nationalIdentifier":"NDIC"}'::json, 'd5321261-0cf1-47ae-a1d6-39cb8aab3874', '6', '2021-06-21 09:52:49.000', 'noRestriction', 'real', 'urgent', '6', 'MaintenanceWorks', 'd5321261-0cf1-47ae-a1d6-39cb8aab3874_MaintenanceWorks', '2021-06-21 09:53:27.000', '2021-06-21 09:52:49.000', 'certain', '{"sourceIdentification":"RSD","sourceName":{"values":{"value":{"$":{"lang":"cs"}}}}}', 'definedByValidityTimeSpec', '2021-06-21 07:15:00.000', '2021-06-24 09:53:27.000', NULL, 1, 2, 2, NULL, NULL, NULL, NULL, '{"comment":{"values":{"value":{"_":"D1, mezi km 52 a 49, ve směru Praha, práce na silnici, zpevněná krajnice uzavřena, Od 21.06.2021 07:15 Do 21.06.2021 17:00, Sečení trávy strojně., sekání trávy a údržba travních porostů, pracovní místo DM - Krátkodobé pohyblivé (mobilní), zdroj: ŘSD","$":{"lang":"cs"}}}}}', 'Linear', '{"affectedCarriagewayAndLanes":{"carriageway":"mainCarriageway","lane":["hardShoulder","hardShoulder"]}}'::json, NULL, '{"$":{"xsi:type":"AlertCMethod2Linear"},"alertCLocationCountryCode":"CZ","alertCLocationTableNumber":"25","alertCLocationTableVersion":"8.0","alertCDirection":{"alertCDirectionCoded":"negative"},"alertCMethod2PrimaryPointLocation":{"alertCLocation":{"specificLocation":"1279"}},"alertCMethod2SecondaryPointLocation":{"alertCLocation":{"specificLocation":"25540"}}}'::json, '{"directionRelativeOnLinearSection":"opposite","linearElement":{"roadNumber":"D1"},"fromPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"52000"},"toPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"48999"}}'::json, '{"networkVersion":{"values":{"value":{"_":"20.12","$":{"lang":"cs"}}}},"linearGeometryType":"continuous","startPoint":{"sjtskPointCoordinates":{"sjtskX":"-705367.665475001","sjtskY":"-1085484.320675"}},"endPoint":{"sjtskPointCoordinates":{"sjtskX":"-708220.292120583","sjtskY":"-1085240.94330743"}},"linearWithinLinearGNElement":[{"sectionId":"716168","directionRelativeOnLinearSection":"aligned","orderOfSection":"0","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.25"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3731284","directionRelativeOnLinearSection":"aligned","orderOfSection":"1","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3731283","directionRelativeOnLinearSection":"aligned","orderOfSection":"2","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3776298","directionRelativeOnLinearSection":"aligned","orderOfSection":"3","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3737940","directionRelativeOnLinearSection":"aligned","orderOfSection":"4","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709908","directionRelativeOnLinearSection":"aligned","orderOfSection":"5","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709909","directionRelativeOnLinearSection":"aligned","orderOfSection":"6","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3663080","directionRelativeOnLinearSection":"aligned","orderOfSection":"7","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"1358023","directionRelativeOnLinearSection":"aligned","orderOfSection":"8","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3663072","directionRelativeOnLinearSection":"aligned","orderOfSection":"9","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3721196","directionRelativeOnLinearSection":"aligned","orderOfSection":"10","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3721193","directionRelativeOnLinearSection":"aligned","orderOfSection":"11","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3513651","directionRelativeOnLinearSection":"aligned","orderOfSection":"12","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.801408450704281"}}]}'::json, '{"openlrExtendedLinear":{"firstDirection":{"openlrLocationReferencePoint":{"openlrCoordinate":{"latitude":"49.751823499059107","longitude":"15.024250722599788"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"304"},"openlrPathAttributes":{"openlrLowestFRCToNextLRPoint":"FRC0","openlrDistanceToNextLRPoint":"3918"}},"openlrLastLocationReferencePoint":{"openlrCoordinate":{"latitude":"49.754080738289225","longitude":"14.973070308369639"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"128"}},"openlrOffsets":{"openlrPositiveOffset":"606","openlrNegativeOffset":"321"}}}}'::json, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'roadworks', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-06-21 09:53:37.380', NULL, NULL, '2021-06-21 09:53:37.380', NULL, NULL, NULL);
|
|
12
|
-
|
|
13
|
-
-- TO DO Add data for rsd_tmc_osm_mapping
|
|
14
|
-
INSERT INTO public.rsd_tmc_osm_mapping
|
|
15
|
-
(lt_start, lt_end, osm_path)
|
|
16
|
-
VALUES(1279, 25540, '[74256918, 191823166, 191823171, 74269338, 262869174, 189021819, 189021825, 74177021, 189021808, 191834725, 189021814, 189021813, 191834765, 191823161, 5506226185, 191823018, 74084348, 74282499, 1600950538, 156250951, 1600950600, 156250948, 1600950646, 74177697, 74238396, 74244807, 156250944, 156250941, 976485311, 74153579, 156250937, 156250932, 74168337, 74279965, 151003135]');
|
|
17
|
-
INSERT INTO public.rsd_tmc_osm_mapping
|
|
18
|
-
(lt_start, lt_end, osm_path)
|
|
19
|
-
VALUES(25631, 25632, '[156250932, 156250937, 74153579, 976485311]');
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dbm;
|
|
4
|
+
var type;
|
|
5
|
+
var seed;
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
var Promise;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* We receive the dbmigrate dependency from dbmigrate initially.
|
|
12
|
+
* This enables us to not have to rely on NODE_PATH.
|
|
13
|
+
*/
|
|
14
|
+
exports.setup = function(options, seedLink) {
|
|
15
|
+
dbm = options.dbmigrate;
|
|
16
|
+
type = dbm.dataType;
|
|
17
|
+
seed = seedLink;
|
|
18
|
+
Promise = options.Promise;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.up = function(db) {
|
|
22
|
+
var filePath = path.join(__dirname, 'sqls', '20230515142731-regions-traffic-restrictions-up.sql');
|
|
23
|
+
return new Promise( function( resolve, reject ) {
|
|
24
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
25
|
+
if (err) return reject(err);
|
|
26
|
+
console.log('received data: ' + data);
|
|
27
|
+
|
|
28
|
+
resolve(data);
|
|
29
|
+
});
|
|
30
|
+
})
|
|
31
|
+
.then(function(data) {
|
|
32
|
+
return db.runSql(data);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.down = function(db) {
|
|
37
|
+
var filePath = path.join(__dirname, 'sqls', '20230515142731-regions-traffic-restrictions-down.sql');
|
|
38
|
+
return new Promise( function( resolve, reject ) {
|
|
39
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
40
|
+
if (err) return reject(err);
|
|
41
|
+
console.log('received data: ' + data);
|
|
42
|
+
|
|
43
|
+
resolve(data);
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
.then(function(data) {
|
|
47
|
+
return db.runSql(data);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports._meta = {
|
|
52
|
+
"version": 1
|
|
53
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
CREATE TABLE ndic_traffic_restrictions_regions (
|
|
2
|
+
exchange json NULL,
|
|
3
|
+
publication_time timestamptz NULL,
|
|
4
|
+
publication_creator json NULL,
|
|
5
|
+
situation_id varchar(100) NOT NULL,
|
|
6
|
+
situation_version varchar(100) NOT NULL,
|
|
7
|
+
situation_version_time timestamptz NULL,
|
|
8
|
+
situation_confidentiality varchar(100) NULL,
|
|
9
|
+
situation_information_status varchar(100) NULL,
|
|
10
|
+
situation_urgency varchar(100) NULL,
|
|
11
|
+
situation_record_version varchar(100) NOT NULL,
|
|
12
|
+
situation_record_type varchar(100) NOT NULL,
|
|
13
|
+
situation_record_id varchar(100) NOT NULL,
|
|
14
|
+
situation_record_creation_time timestamptz NOT NULL,
|
|
15
|
+
situation_record_version_time timestamptz NOT NULL,
|
|
16
|
+
probability_of_occurrence varchar(100) NULL,
|
|
17
|
+
"source" varchar(100) NULL,
|
|
18
|
+
validity_status varchar(100) NULL,
|
|
19
|
+
validity_overall_start_time timestamptz NULL,
|
|
20
|
+
validity_overall_end_time timestamptz NULL,
|
|
21
|
+
impact_capacity_remaining float4 NULL,
|
|
22
|
+
impact_number_of_lanes_restricted int4 NULL,
|
|
23
|
+
impact_number_of_operational_lanes int4 NULL,
|
|
24
|
+
impact_original_number_of_lanes int4 NULL,
|
|
25
|
+
impact_traffic_constriction_type varchar(100) NULL,
|
|
26
|
+
impact_delays_type varchar(100) NULL,
|
|
27
|
+
impact_delay_time_value float4 NULL,
|
|
28
|
+
cause json NULL,
|
|
29
|
+
general_public_comment text NULL,
|
|
30
|
+
group_of_locations_type varchar(100) NULL,
|
|
31
|
+
supplementary_positional_description json NULL,
|
|
32
|
+
destination json NULL,
|
|
33
|
+
alert_c_linear json NULL,
|
|
34
|
+
linear_within_linear_element json NULL,
|
|
35
|
+
global_network_linear json NULL,
|
|
36
|
+
linear_extension json NULL,
|
|
37
|
+
geom_gn_line public.geometry NULL,
|
|
38
|
+
geom_openlr_line public.geometry NULL,
|
|
39
|
+
situation_record_extension json NULL,
|
|
40
|
+
number_of_obstructions int4 NULL,
|
|
41
|
+
mobility_of_obstruction json NULL,
|
|
42
|
+
compliance_option varchar(100) NULL,
|
|
43
|
+
applicable_for_traffic_direction varchar(100) NULL,
|
|
44
|
+
applicable_for_traffic_type varchar(100) NULL,
|
|
45
|
+
places_at_which_applicable varchar(100) NULL,
|
|
46
|
+
for_vehicles_with_characteristics_of json NULL,
|
|
47
|
+
roadworks_duration varchar(100) NULL,
|
|
48
|
+
roadworks_scale varchar(100) NULL,
|
|
49
|
+
under_traffic bool NULL,
|
|
50
|
+
urgent_roadworks bool NULL,
|
|
51
|
+
mobility json NULL,
|
|
52
|
+
subjects json NULL,
|
|
53
|
+
maintenance_vehicles json NULL,
|
|
54
|
+
abnormal_traffic_type varchar(100) NULL,
|
|
55
|
+
accident_type varchar(100) NULL,
|
|
56
|
+
group_of_vehicles_involved json NULL,
|
|
57
|
+
car_park_identity text NULL,
|
|
58
|
+
car_park_occupancy varchar(100) NULL,
|
|
59
|
+
number_of_vacant_parking_spaces int4 NULL,
|
|
60
|
+
driving_condition_type varchar(100) NULL,
|
|
61
|
+
construction_work_type varchar(100) NULL,
|
|
62
|
+
disturbance_activity_type varchar(100) NULL,
|
|
63
|
+
environmental_obstruction_type varchar(100) NULL,
|
|
64
|
+
general_instruction_to_road_users_type varchar(100) NULL,
|
|
65
|
+
general_message_to_road_users json NULL,
|
|
66
|
+
general_network_management_type varchar(100) NULL,
|
|
67
|
+
traffic_manually_directed_by varchar(100) NULL,
|
|
68
|
+
infrastructure_damage_type varchar(100) NULL,
|
|
69
|
+
road_maintenance_type varchar(100) NULL,
|
|
70
|
+
non_weather_related_road_condition_type varchar(100) NULL,
|
|
71
|
+
poor_environment_type varchar(100) NULL,
|
|
72
|
+
public_event_type varchar(100) NULL,
|
|
73
|
+
rerouting_management_type varchar(100) NULL,
|
|
74
|
+
rerouting_itinerary_description json NULL,
|
|
75
|
+
signed_rerouting bool NULL,
|
|
76
|
+
entry text NULL,
|
|
77
|
+
"exit" text NULL,
|
|
78
|
+
road_or_junction_number text NULL,
|
|
79
|
+
road_or_carriageway_or_lane_management_type varchar(100) NULL,
|
|
80
|
+
minimum_car_occupancy int4 NULL,
|
|
81
|
+
roadside_assistance_type varchar(100) NULL,
|
|
82
|
+
speed_management_type varchar(100) NULL,
|
|
83
|
+
temporary_speed_limit float4 NULL,
|
|
84
|
+
vehicle_obstruction_type varchar(100) NULL,
|
|
85
|
+
obstructing_vehicle json NULL,
|
|
86
|
+
winter_equipment_management_type varchar(100) NULL,
|
|
87
|
+
create_batch_id int8 NULL,
|
|
88
|
+
created_at timestamptz NULL,
|
|
89
|
+
created_by varchar(150) NULL,
|
|
90
|
+
update_batch_id int8 NULL,
|
|
91
|
+
updated_at timestamptz NULL,
|
|
92
|
+
updated_by varchar(150) NULL,
|
|
93
|
+
geom_alert_c_line public.geometry NULL,
|
|
94
|
+
alert_c_direction varchar(100) NULL,
|
|
95
|
+
CONSTRAINT ndic_traffic_restrictions_regions_pk PRIMARY KEY (situation_record_id, situation_record_version_time)
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
CREATE PROCEDURE regions_data_retention(dataretentionminutes integer)
|
|
99
|
+
LANGUAGE plpgsql
|
|
100
|
+
AS $procedure$
|
|
101
|
+
begin
|
|
102
|
+
delete from ndic.ndic_traffic_restrictions_regions where situation_record_version_time < (NOW() - (dataretentionminutes || ' minutes')::interval);
|
|
103
|
+
end;
|
|
104
|
+
$procedure$
|
|
105
|
+
;
|
|
106
|
+
|
|
107
|
+
create view v_traffic_restrictions_all as
|
|
108
|
+
select * from ndic_traffic_restrictions
|
|
109
|
+
union all
|
|
110
|
+
select * from ndic_traffic_restrictions_regions
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseWorker } from "@golemio/core/dist/integration-engine";
|
|
2
|
+
export declare class LegacyNdicWorker extends BaseWorker {
|
|
3
|
+
private readonly queuePrefix;
|
|
4
|
+
private ndicTrafficInfoTransformation;
|
|
5
|
+
private ndicTrafficRestrictionsTransformation;
|
|
6
|
+
private ndicTrafficInfoModel;
|
|
7
|
+
private ndicTrafficRestrictionsModel;
|
|
8
|
+
constructor();
|
|
9
|
+
saveTrafficInfo: (msg: any) => Promise<void>;
|
|
10
|
+
saveTrafficRestrictions: (msg: any) => Promise<void>;
|
|
11
|
+
private uniqueInfoArray;
|
|
12
|
+
private populateWithGeomAlertCLineInfo;
|
|
13
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LegacyNdicWorker = void 0;
|
|
13
|
+
const TrafficInfoTransformation_1 = require("./transformations/TrafficInfoTransformation");
|
|
14
|
+
const TrafficRestrictionsTransformation_1 = require("./transformations/TrafficRestrictionsTransformation");
|
|
15
|
+
const _sch_1 = require("../schema-definitions");
|
|
16
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
17
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
18
|
+
const TrafficRestrictionsHelper_1 = require("./helpers/TrafficRestrictionsHelper");
|
|
19
|
+
class LegacyNdicWorker extends integration_engine_1.BaseWorker {
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
this.saveTrafficInfo = (msg) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const data = JSON.parse(msg.content.toString());
|
|
24
|
+
const transformedData = yield this.ndicTrafficInfoTransformation.transform(data);
|
|
25
|
+
const dataToSave = yield this.populateWithGeomAlertCLineInfo(transformedData);
|
|
26
|
+
yield this.ndicTrafficInfoModel.save(this.uniqueInfoArray(dataToSave));
|
|
27
|
+
});
|
|
28
|
+
this.saveTrafficRestrictions = (msg) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const data = JSON.parse(msg.content.toString());
|
|
30
|
+
const transformedData = yield this.ndicTrafficRestrictionsTransformation.transform(data);
|
|
31
|
+
const dataToSave = yield TrafficRestrictionsHelper_1.TrafficRestrictionsHelper.populateWithGeomAlertCLineRestrictions(transformedData);
|
|
32
|
+
yield this.ndicTrafficRestrictionsModel.save(TrafficRestrictionsHelper_1.TrafficRestrictionsHelper.uniqueRestrictionsArray(dataToSave));
|
|
33
|
+
});
|
|
34
|
+
this.uniqueInfoArray = (arr) => {
|
|
35
|
+
const constraintsArr = [];
|
|
36
|
+
const resultArr = [];
|
|
37
|
+
for (const obj of arr) {
|
|
38
|
+
if (!constraintsArr.includes(obj.situation_id + obj.situation_record_type + obj.situation_record_version_time)) {
|
|
39
|
+
constraintsArr.push(obj.situation_id + obj.situation_record_type + obj.situation_record_version_time);
|
|
40
|
+
resultArr.push(obj);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return resultArr;
|
|
44
|
+
};
|
|
45
|
+
this.populateWithGeomAlertCLineInfo = (transformedData) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
for (const dataObj of transformedData) {
|
|
47
|
+
dataObj.geom_alert_c_line = yield TrafficRestrictionsHelper_1.TrafficRestrictionsHelper.parseGeomAlertCLine(dataObj.alert_c_linear);
|
|
48
|
+
}
|
|
49
|
+
return transformedData;
|
|
50
|
+
});
|
|
51
|
+
this.queuePrefix = integration_engine_1.config.RABBIT_EXCHANGE_NAME + "." + _sch_1.Ndic.name.toLowerCase();
|
|
52
|
+
this.ndicTrafficInfoTransformation = new TrafficInfoTransformation_1.TrafficInfoTransformation();
|
|
53
|
+
this.ndicTrafficRestrictionsTransformation = new TrafficRestrictionsTransformation_1.TrafficRestrictionsTransformation();
|
|
54
|
+
this.ndicTrafficInfoModel = new integration_engine_1.PostgresModel(_sch_1.Ndic.traffic_info.name + "Model", {
|
|
55
|
+
outputSequelizeAttributes: _sch_1.Ndic.traffic_info.outputSequelizeAttributes,
|
|
56
|
+
pgSchema: _sch_1.Ndic.pgSchema,
|
|
57
|
+
pgTableName: _sch_1.Ndic.traffic_info.pgTableName,
|
|
58
|
+
savingType: "insertOnly",
|
|
59
|
+
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.Ndic.traffic_info.name + "PgModelValidator", _sch_1.Ndic.traffic_info.outputSchema));
|
|
60
|
+
this.ndicTrafficRestrictionsModel = new integration_engine_1.PostgresModel(_sch_1.Ndic.traffic_restrictions.name + "Model", {
|
|
61
|
+
outputSequelizeAttributes: _sch_1.Ndic.traffic_restrictions.outputSequelizeAttributes,
|
|
62
|
+
pgSchema: _sch_1.Ndic.pgSchema,
|
|
63
|
+
pgTableName: _sch_1.Ndic.traffic_restrictions.pgTableName,
|
|
64
|
+
savingType: "insertOnly",
|
|
65
|
+
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.Ndic.traffic_restrictions.name + "PgModelValidator", _sch_1.Ndic.traffic_restrictions.outputSchema));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.LegacyNdicWorker = LegacyNdicWorker;
|
|
69
|
+
//# sourceMappingURL=LegacyNdicWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegacyNdicWorker.js","sourceRoot":"","sources":["../../src/integration-engine/LegacyNdicWorker.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
private readonly queuePrefix;
|
|
5
|
-
private ndicTrafficInfoTransformation;
|
|
6
|
-
private ndicTrafficRestrictionsTransformation;
|
|
7
|
-
private ndicTrafficInfoModel;
|
|
8
|
-
private ndicTrafficRestrictionsModel;
|
|
9
|
-
protected rsdTmcPointsModel: RsdTmcPointsModel;
|
|
1
|
+
import { AbstractWorker } from "@golemio/core/dist/integration-engine";
|
|
2
|
+
export declare class NdicWorker extends AbstractWorker {
|
|
3
|
+
protected name: string;
|
|
10
4
|
constructor();
|
|
11
|
-
saveTrafficInfo: (msg: any) => Promise<void>;
|
|
12
|
-
saveTrafficRestrictions: (msg: any) => Promise<void>;
|
|
13
|
-
private uniqueRestrictionsArray;
|
|
14
|
-
private uniqueInfoArray;
|
|
15
|
-
private populateWithGeomAlertCLineInfo;
|
|
16
|
-
private populateWithGeomAlertCLineRestrictions;
|
|
17
|
-
private parseGeomAlertCLine;
|
|
18
5
|
}
|
|
@@ -1,106 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.NdicWorker = void 0;
|
|
13
|
-
const TrafficInfoTransformation_1 = require("./transformations/TrafficInfoTransformation");
|
|
14
|
-
const TrafficRestrictionsTransformation_1 = require("./transformations/TrafficRestrictionsTransformation");
|
|
15
|
-
const _sch_1 = require("../schema-definitions");
|
|
16
4
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
5
|
+
const SaveTrafficRestrictionsRegions_1 = require("./tasks/SaveTrafficRestrictionsRegions");
|
|
6
|
+
const RegionsDataRetention_1 = require("./tasks/RegionsDataRetention");
|
|
7
|
+
const _sch_1 = require("../schema-definitions");
|
|
8
|
+
class NdicWorker extends integration_engine_1.AbstractWorker {
|
|
20
9
|
constructor() {
|
|
21
10
|
super();
|
|
22
|
-
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
const data = JSON.parse(msg.content.toString());
|
|
26
|
-
const transformedData = yield this.ndicTrafficInfoTransformation.transform(data);
|
|
27
|
-
const dataToSave = yield this.populateWithGeomAlertCLineInfo(transformedData);
|
|
28
|
-
yield this.ndicTrafficInfoModel.save(this.uniqueInfoArray(dataToSave));
|
|
29
|
-
});
|
|
30
|
-
this.saveTrafficRestrictions = (msg) => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const data = JSON.parse(msg.content.toString());
|
|
32
|
-
const transformedData = yield this.ndicTrafficRestrictionsTransformation.transform(data);
|
|
33
|
-
const dataToSave = yield this.populateWithGeomAlertCLineRestrictions(transformedData);
|
|
34
|
-
yield this.ndicTrafficRestrictionsModel.save(this.uniqueRestrictionsArray(dataToSave));
|
|
35
|
-
});
|
|
36
|
-
this.uniqueRestrictionsArray = (arr) => {
|
|
37
|
-
const constraintsArr = [];
|
|
38
|
-
const resultArr = [];
|
|
39
|
-
for (const obj of arr) {
|
|
40
|
-
if (!constraintsArr.includes(obj.situation_record_id + obj.situation_record_version_time)) {
|
|
41
|
-
constraintsArr.push(obj.situation_record_id + obj.situation_record_version_time);
|
|
42
|
-
resultArr.push(obj);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return resultArr;
|
|
46
|
-
};
|
|
47
|
-
this.uniqueInfoArray = (arr) => {
|
|
48
|
-
const constraintsArr = [];
|
|
49
|
-
const resultArr = [];
|
|
50
|
-
for (const obj of arr) {
|
|
51
|
-
if (!constraintsArr.includes(obj.situation_id + obj.situation_record_type + obj.situation_record_version_time)) {
|
|
52
|
-
constraintsArr.push(obj.situation_id + obj.situation_record_type + obj.situation_record_version_time);
|
|
53
|
-
resultArr.push(obj);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return resultArr;
|
|
57
|
-
};
|
|
58
|
-
this.populateWithGeomAlertCLineInfo = (transformedData) => __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
for (const dataObj of transformedData) {
|
|
60
|
-
dataObj.geom_alert_c_line = yield this.parseGeomAlertCLine(dataObj.alert_c_linear);
|
|
61
|
-
}
|
|
62
|
-
return transformedData;
|
|
63
|
-
});
|
|
64
|
-
this.populateWithGeomAlertCLineRestrictions = (transformedData) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
for (const dataObj of transformedData) {
|
|
66
|
-
dataObj.geom_alert_c_line = yield this.parseGeomAlertCLine(dataObj.alert_c_linear);
|
|
67
|
-
}
|
|
68
|
-
return transformedData;
|
|
69
|
-
});
|
|
70
|
-
this.parseGeomAlertCLine = (alertCLinearObj) => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
if (!alertCLinearObj)
|
|
72
|
-
return undefined;
|
|
73
|
-
const primaryPointSpecificLocation = alertCLinearObj.alertCMethod2PrimaryPointLocation.alertCLocation.specificLocation;
|
|
74
|
-
const secondaryPointSpecificLocation = alertCLinearObj.alertCMethod2SecondaryPointLocation.alertCLocation.specificLocation;
|
|
75
|
-
const primaryPointObj = yield this.rsdTmcPointsModel.GetOne(primaryPointSpecificLocation);
|
|
76
|
-
const secondaryPointObj = yield this.rsdTmcPointsModel.GetOne(secondaryPointSpecificLocation);
|
|
77
|
-
if (primaryPointObj && secondaryPointObj) {
|
|
78
|
-
const coordinatesArr = [
|
|
79
|
-
[primaryPointObj.wgs84_x.replace(",", "."), primaryPointObj.wgs84_y.replace(",", ".")],
|
|
80
|
-
[secondaryPointObj.wgs84_x.replace(",", "."), secondaryPointObj.wgs84_y.replace(",", ".")],
|
|
81
|
-
];
|
|
82
|
-
return {
|
|
83
|
-
coordinates: coordinatesArr,
|
|
84
|
-
type: "LineString",
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
return undefined;
|
|
88
|
-
});
|
|
89
|
-
this.queuePrefix = integration_engine_1.config.RABBIT_EXCHANGE_NAME + "." + _sch_1.Ndic.name.toLowerCase();
|
|
90
|
-
this.ndicTrafficInfoTransformation = new TrafficInfoTransformation_1.TrafficInfoTransformation();
|
|
91
|
-
this.ndicTrafficRestrictionsTransformation = new TrafficRestrictionsTransformation_1.TrafficRestrictionsTransformation();
|
|
92
|
-
this.ndicTrafficInfoModel = new integration_engine_1.PostgresModel(_sch_1.Ndic.traffic_info.name + "Model", {
|
|
93
|
-
outputSequelizeAttributes: _sch_1.Ndic.traffic_info.outputSequelizeAttributes,
|
|
94
|
-
pgSchema: _sch_1.Ndic.pgSchema,
|
|
95
|
-
pgTableName: _sch_1.Ndic.traffic_info.pgTableName,
|
|
96
|
-
savingType: "insertOnly",
|
|
97
|
-
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.Ndic.traffic_info.name + "PgModelValidator", _sch_1.Ndic.traffic_info.outputSchema));
|
|
98
|
-
this.ndicTrafficRestrictionsModel = new integration_engine_1.PostgresModel(_sch_1.Ndic.traffic_restrictions.name + "Model", {
|
|
99
|
-
outputSequelizeAttributes: _sch_1.Ndic.traffic_restrictions.outputSequelizeAttributes,
|
|
100
|
-
pgSchema: _sch_1.Ndic.pgSchema,
|
|
101
|
-
pgTableName: _sch_1.Ndic.traffic_restrictions.pgTableName,
|
|
102
|
-
savingType: "insertOnly",
|
|
103
|
-
}, new golemio_validator_1.JSONSchemaValidator(_sch_1.Ndic.traffic_restrictions.name + "PgModelValidator", _sch_1.Ndic.traffic_restrictions.outputSchema));
|
|
11
|
+
this.name = _sch_1.Ndic.name;
|
|
12
|
+
this.registerTask(new SaveTrafficRestrictionsRegions_1.SaveTrafficRestrictionsRegions(this.getQueuePrefix()));
|
|
13
|
+
this.registerTask(new RegionsDataRetention_1.RegionsDataRetention(this.getQueuePrefix()));
|
|
104
14
|
}
|
|
105
15
|
}
|
|
106
16
|
exports.NdicWorker = NdicWorker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NdicWorker.js","sourceRoot":"","sources":["../../src/integration-engine/NdicWorker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NdicWorker.js","sourceRoot":"","sources":["../../src/integration-engine/NdicWorker.ts"],"names":[],"mappings":";;;AAAA,8EAAuE;AACvE,2FAAwF;AACxF,uEAAoE;AACpE,gDAA4B;AAE5B,MAAa,UAAW,SAAQ,mCAAc;IAG1C;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAW,WAAI,CAAC,IAAI,CAAC;QAK/B,IAAI,CAAC,YAAY,CAAC,IAAI,+DAA8B,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC7E,IAAI,CAAC,YAAY,CAAC,IAAI,2CAAoB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;CACJ;AATD,gCASC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ITrafficRestrictionsModel } from "../transformations/TrafficRestrictionsInterface";
|
|
2
|
+
export declare class LteCze90PointsChecker {
|
|
3
|
+
private filtrationLookup;
|
|
4
|
+
private relevantLcds;
|
|
5
|
+
constructor();
|
|
6
|
+
initialize(): Promise<void>;
|
|
7
|
+
shouldSave(input: ITrafficRestrictionsModel): boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LteCze90PointsChecker = void 0;
|
|
13
|
+
const Di_1 = require("@golemio/traffic-common/dist/integration-engine/ioc/Di");
|
|
14
|
+
const ModuleContainerToken_1 = require("@golemio/traffic-common/dist/integration-engine/ioc/ModuleContainerToken");
|
|
15
|
+
class LteCze90PointsChecker {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.relevantLcds = [];
|
|
18
|
+
this.filtrationLookup = Di_1.TrafficCommonContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.LteCze90PointsSjtskInAreaRepository);
|
|
19
|
+
}
|
|
20
|
+
initialize() {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
this.relevantLcds = (yield this.filtrationLookup.getFiltrationData()).map((element) => element.lcd);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
shouldSave(input) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const primaryPointSpecificLocation = (_a = input.alert_c_linear) === null || _a === void 0 ? void 0 : _a.alertCMethod2PrimaryPointLocation.alertCLocation.specificLocation;
|
|
28
|
+
const secondaryPointSpecificLocation = (_b = input.alert_c_linear) === null || _b === void 0 ? void 0 : _b.alertCMethod2SecondaryPointLocation.alertCLocation.specificLocation;
|
|
29
|
+
if (primaryPointSpecificLocation === undefined ||
|
|
30
|
+
primaryPointSpecificLocation == null ||
|
|
31
|
+
secondaryPointSpecificLocation === undefined ||
|
|
32
|
+
secondaryPointSpecificLocation === null) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return (this.relevantLcds.includes(Number(primaryPointSpecificLocation)) ||
|
|
36
|
+
this.relevantLcds.includes(Number(secondaryPointSpecificLocation)));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.LteCze90PointsChecker = LteCze90PointsChecker;
|
|
40
|
+
//# sourceMappingURL=LteCze90PointsChecker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LteCze90PointsChecker.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/LteCze90PointsChecker.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+EAAgG;AAChG,mHAAsI;AAGtI,MAAa,qBAAqB;IAI9B;QAFQ,iBAAY,GAAa,EAAE,CAAC;QAGhC,IAAI,CAAC,gBAAgB,GAAG,2BAAsB,CAAC,OAAO,CAClD,2CAAkB,CAAC,mCAAmC,CACzD,CAAC;IACN,CAAC;IAEY,UAAU;;YACnB,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACxG,CAAC;KAAA;IAEM,UAAU,CAAC,KAAgC;;QAC9C,MAAM,4BAA4B,GAC9B,MAAA,KAAK,CAAC,cAAc,0CAAE,iCAAiC,CAAC,cAAc,CAAC,gBAAgB,CAAC;QAC5F,MAAM,8BAA8B,GAChC,MAAA,KAAK,CAAC,cAAc,0CAAE,mCAAmC,CAAC,cAAc,CAAC,gBAAgB,CAAC;QAE9F,IACI,4BAA4B,KAAK,SAAS;YAC1C,4BAA4B,IAAI,IAAI;YACpC,8BAA8B,KAAK,SAAS;YAC5C,8BAA8B,KAAK,IAAI,EACzC;YACE,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,CACH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC;YAChE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,CACrE,CAAC;IACN,CAAC;CACJ;AAlCD,sDAkCC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ITrafficRestrictionsModel } from "../transformations/TrafficRestrictionsInterface";
|
|
2
|
+
import { LineString } from "@golemio/core/dist/shared/geojson";
|
|
3
|
+
export declare class TrafficRestrictionsHelper {
|
|
4
|
+
static uniqueRestrictionsArray: (arr: ITrafficRestrictionsModel[]) => ITrafficRestrictionsModel[];
|
|
5
|
+
static populateWithGeomAlertCLineRestrictions: (transformedData: ITrafficRestrictionsModel[]) => Promise<ITrafficRestrictionsModel[]>;
|
|
6
|
+
static parseGeomAlertCLine: (alertCLinearObj: Record<string, any> | undefined) => Promise<LineString | undefined>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var _a;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.TrafficRestrictionsHelper = void 0;
|
|
14
|
+
const ContainerToken_1 = require("../ioc/ContainerToken");
|
|
15
|
+
const Di_1 = require("../ioc/Di");
|
|
16
|
+
class TrafficRestrictionsHelper {
|
|
17
|
+
}
|
|
18
|
+
exports.TrafficRestrictionsHelper = TrafficRestrictionsHelper;
|
|
19
|
+
_a = TrafficRestrictionsHelper;
|
|
20
|
+
//#region Public Methods
|
|
21
|
+
TrafficRestrictionsHelper.uniqueRestrictionsArray = (arr) => {
|
|
22
|
+
const constraintsArr = [];
|
|
23
|
+
const resultArr = [];
|
|
24
|
+
for (const obj of arr) {
|
|
25
|
+
if (!constraintsArr.includes(obj.situation_record_id + obj.situation_record_version_time)) {
|
|
26
|
+
constraintsArr.push(obj.situation_record_id + obj.situation_record_version_time);
|
|
27
|
+
resultArr.push(obj);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return resultArr;
|
|
31
|
+
};
|
|
32
|
+
TrafficRestrictionsHelper.populateWithGeomAlertCLineRestrictions = (transformedData) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
for (const dataObj of transformedData) {
|
|
34
|
+
dataObj.geom_alert_c_line = yield _a.parseGeomAlertCLine(dataObj.alert_c_linear);
|
|
35
|
+
}
|
|
36
|
+
return transformedData;
|
|
37
|
+
});
|
|
38
|
+
TrafficRestrictionsHelper.parseGeomAlertCLine = (alertCLinearObj) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
if (!alertCLinearObj)
|
|
40
|
+
return undefined;
|
|
41
|
+
const rsTmcRepository = Di_1.NdicContainer.resolve(ContainerToken_1.ModuleContainerToken.RsdTmcPointsRepository);
|
|
42
|
+
const primaryPointSpecificLocation = alertCLinearObj.alertCMethod2PrimaryPointLocation.alertCLocation.specificLocation;
|
|
43
|
+
const secondaryPointSpecificLocation = alertCLinearObj.alertCMethod2SecondaryPointLocation.alertCLocation.specificLocation;
|
|
44
|
+
const primaryPointObj = yield rsTmcRepository.GetOne(primaryPointSpecificLocation);
|
|
45
|
+
const secondaryPointObj = yield rsTmcRepository.GetOne(secondaryPointSpecificLocation);
|
|
46
|
+
if (primaryPointObj && secondaryPointObj) {
|
|
47
|
+
const coordinatesArr = [
|
|
48
|
+
[Number(primaryPointObj.wgs84_x.replace(",", ".")), Number(primaryPointObj.wgs84_y.replace(",", "."))],
|
|
49
|
+
[Number(secondaryPointObj.wgs84_x.replace(",", ".")), Number(secondaryPointObj.wgs84_y.replace(",", "."))],
|
|
50
|
+
];
|
|
51
|
+
return {
|
|
52
|
+
coordinates: coordinatesArr,
|
|
53
|
+
type: "LineString",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=TrafficRestrictionsHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrafficRestrictionsHelper.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/TrafficRestrictionsHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,0DAA8D;AAC9D,kCAA2C;AAK3C,MAAa,yBAAyB;;AAAtC,8DAiDC;;AAhDG,wBAAwB;AACV,iDAAuB,GAAG,CAAC,GAAgC,EAAE,EAAE;IACzE,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,MAAM,SAAS,GAAgC,EAAE,CAAC;IAClD,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACnB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,mBAAmB,GAAG,GAAG,CAAC,6BAA6B,CAAC,EAAE;YACvF,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,GAAG,GAAG,CAAC,6BAA6B,CAAC,CAAC;YACjF,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;KACJ;IACD,OAAO,SAAS,CAAC;AACrB,CAAE,CAAA;AAEY,gEAAsC,GAAG,CACnD,eAA4C,EACR,EAAE;IACtC,KAAK,MAAM,OAAO,IAAI,eAAe,EAAE;QACnC,OAAO,CAAC,iBAAiB,GAAG,MAAM,EAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;KACtF;IACD,OAAO,eAAe,CAAC;AAC3B,CAAC,CAAC,CAAA;AAEY,6CAAmB,GAAG,CAChC,eAAgD,EACjB,EAAE;IACjC,IAAI,CAAC,eAAe;QAAE,OAAO,SAAS,CAAC;IAEvC,MAAM,eAAe,GAAG,kBAAa,CAAC,OAAO,CAAoB,qCAAoB,CAAC,sBAAsB,CAAC,CAAC;IAC9G,MAAM,4BAA4B,GAAG,eAAe,CAAC,iCAAiC,CAAC,cAAc,CAAC,gBAAgB,CAAC;IACvH,MAAM,8BAA8B,GAChC,eAAe,CAAC,mCAAmC,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAExF,MAAM,eAAe,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC;IACnF,MAAM,iBAAiB,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC;IAEvF,IAAI,eAAe,IAAI,iBAAiB,EAAE;QACtC,MAAM,cAAc,GAAe;YAC/B,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACtG,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;SAC7G,CAAC;QACF,OAAO;YACH,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,YAAY;SACP,CAAC;KACnB;IACD,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC,CAAA"}
|
|
@@ -14,7 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.workers = void 0;
|
|
18
|
+
const NdicWorker_1 = require("./NdicWorker");
|
|
17
19
|
/* ie/index.ts */
|
|
18
|
-
__exportStar(require("./
|
|
20
|
+
__exportStar(require("./LegacyNdicWorker"), exports);
|
|
19
21
|
__exportStar(require("./queueDefinitions"), exports);
|
|
22
|
+
exports.workers = [NdicWorker_1.NdicWorker];
|
|
20
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration-engine/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration-engine/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA0C;AAE1C,iBAAiB;AACjB,qDAAmC;AACnC,qDAAmC;AAEtB,QAAA,OAAO,GAAG,CAAC,uBAAU,CAAC,CAAC"}
|