@golemio/pid 2.11.1 → 2.11.2-dev.1135196936
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/12_metro_line_A_gtfs_trips.sql +4 -4
- package/db/example/13_http-propagate-delay.sql +8 -8
- package/dist/helpers/geo/GeoMeasurementHelper.d.ts +17 -0
- package/dist/helpers/geo/GeoMeasurementHelper.js +65 -0
- package/dist/helpers/geo/GeoMeasurementHelper.js.map +1 -0
- package/dist/helpers/geo/interfaces/IGeoMeasurementHelper.d.ts +8 -0
- package/dist/helpers/geo/interfaces/IGeoMeasurementHelper.js +3 -0
- package/dist/helpers/geo/interfaces/IGeoMeasurementHelper.js.map +1 -0
- package/dist/integration-engine/ioc/Di.d.ts +1 -2
- package/dist/integration-engine/ioc/Di.js +7 -5
- package/dist/integration-engine/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ioc/ModuleContainerToken.d.ts +1 -0
- package/dist/integration-engine/ioc/ModuleContainerToken.js +1 -0
- package/dist/integration-engine/ioc/ModuleContainerToken.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js +4 -5
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionCalculator.d.ts +7 -11
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionCalculator.js +27 -97
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionCalculator.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js +25 -23
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/ValidToCalculator.js +4 -5
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/ValidToCalculator.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/anchor-points/AnchorPointSegmenter.d.ts +17 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/anchor-points/AnchorPointSegmenter.js +84 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/anchor-points/AnchorPointSegmenter.js.map +1 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js +24 -22
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/regional-bus/RegionalBusPositionsManager.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/interfaces/VPInterfaces.d.ts +1 -1
- package/dist/output-gateway/public/ioc/Di.js +5 -1
- package/dist/output-gateway/public/ioc/Di.js.map +1 -1
- package/dist/output-gateway/public/ioc/OgModuleToken.d.ts +2 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js +2 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js.map +1 -1
- package/dist/output-gateway/public/service/facade/VehiclePositionsFacade.d.ts +3 -1
- package/dist/output-gateway/public/service/facade/VehiclePositionsFacade.js +3 -3
- package/dist/output-gateway/public/service/facade/VehiclePositionsFacade.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/BoundingBoxHelper.d.ts +6 -3
- package/dist/output-gateway/public/service/helpers/BoundingBoxHelper.js +26 -10
- package/dist/output-gateway/public/service/helpers/BoundingBoxHelper.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/interfaces/IBoundingBoxHelper.d.ts +4 -0
- package/dist/output-gateway/public/service/helpers/interfaces/IBoundingBoxHelper.js +3 -0
- package/dist/output-gateway/public/service/helpers/interfaces/IBoundingBoxHelper.js.map +1 -0
- package/dist/schema-definitions/vehicle-positions/models/VPTripsModel.js +11 -3
- package/dist/schema-definitions/vehicle-positions/models/VPTripsModel.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/interfaces/VPTripsLastPositionInterfaces.d.ts +2 -1
- package/package.json +3 -3
|
@@ -115,10 +115,10 @@ INSERT INTO vehiclepositions_metro_runs_messages (route_name, message_timestamp,
|
|
|
115
115
|
('A', concat(CURRENT_DATE,'T08:20:13Z')::timestamp, '9', '9', '175', '1209', -15, concat(CURRENT_DATE,'T08:19:58Z')::timestamp, (SELECT origin_datetime FROM init_values), (SELECT origin_datetime FROM init_values));
|
|
116
116
|
|
|
117
117
|
INSERT INTO vehiclepositions_trips (cis_line_id,cis_trip_number,run_number,cis_line_short_name,created_at,gtfs_route_id,gtfs_route_short_name,gtfs_trip_id,id,updated_at,start_cis_stop_id,start_cis_stop_platform_code,start_time,start_timestamp,vehicle_type_id,wheelchair_accessible,create_batch_id,created_by,update_batch_id,updated_by,agency_name_scheduled,origin_route_name,agency_name_real,vehicle_registration_number,gtfs_trip_headsign,start_asw_stop_id,gtfs_route_type,gtfs_block_id,last_position_id,is_canceled,end_timestamp,gtfs_trip_short_name,last_position_context,provider_source_type) VALUES
|
|
118
|
-
(NULL,NULL,5,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_78_220321',concat(CURRENT_DATE,'T10:32:35+02:00_991_78_220321_5_5'),concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,'10:32:35',concat(CURRENT_DATE,'T08:32:35Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Skalka',NULL,1,NULL,30,NULL,concat(CURRENT_DATE,'T09:00:40Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"
|
|
119
|
-
(NULL,NULL,5,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_77_220901',concat(CURRENT_DATE,'T09:55:10+02:00_991_77_220901_5_5'),concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,'09:55:10',concat(CURRENT_DATE,'T07:55:10Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Nemocnice Motol',NULL,1,NULL,29,NULL,concat(CURRENT_DATE,'T08:26:20Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"
|
|
120
|
-
(NULL,NULL,5,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_124_201230',concat(CURRENT_DATE,'T11:02:40+02:00_991_124_201230_5_5'),concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,'11:02:40',concat(CURRENT_DATE,'T09:02:40Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Nemocnice Motol',NULL,1,NULL,31,NULL,concat(CURRENT_DATE,'T09:31:20Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"
|
|
121
|
-
(NULL,NULL,9,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_294_220901',concat(CURRENT_DATE,'T10:04:35+02:00_991_294_220901_9_9'),concat(CURRENT_DATE,'T06:14:51Z')::timestamp,NULL,NULL,'10:04:35',concat(CURRENT_DATE,'T08:04:35Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Skalka',NULL,1,NULL,32,NULL,concat(CURRENT_DATE,'T08:32:40Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"
|
|
118
|
+
(NULL,NULL,5,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_78_220321',concat(CURRENT_DATE,'T10:32:35+02:00_991_78_220321_5_5'),concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,'10:32:35',concat(CURRENT_DATE,'T08:32:35Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Skalka',NULL,1,NULL,30,NULL,concat(CURRENT_DATE,'T09:00:40Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"', concat(CURRENT_DATE,'T10:32:35+02:00_991_78_220321_5_5'), '"}')::json, '3'),
|
|
119
|
+
(NULL,NULL,5,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_77_220901',concat(CURRENT_DATE,'T09:55:10+02:00_991_77_220901_5_5'),concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,'09:55:10',concat(CURRENT_DATE,'T07:55:10Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Nemocnice Motol',NULL,1,NULL,29,NULL,concat(CURRENT_DATE,'T08:26:20Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"', concat(CURRENT_DATE,'T09:55:10+02:00_991_77_220901_5_5'), '"}')::json, '3'),
|
|
120
|
+
(NULL,NULL,5,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_124_201230',concat(CURRENT_DATE,'T11:02:40+02:00_991_124_201230_5_5'),concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,'11:02:40',concat(CURRENT_DATE,'T09:02:40Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Nemocnice Motol',NULL,1,NULL,31,NULL,concat(CURRENT_DATE,'T09:31:20Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"', concat(CURRENT_DATE,'T11:02:40+02:00_991_124_201230_5_5'), '"}')::json, '3'),
|
|
121
|
+
(NULL,NULL,9,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_294_220901',concat(CURRENT_DATE,'T10:04:35+02:00_991_294_220901_9_9'),concat(CURRENT_DATE,'T06:14:51Z')::timestamp,NULL,NULL,'10:04:35',concat(CURRENT_DATE,'T08:04:35Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Skalka',NULL,1,NULL,32,NULL,concat(CURRENT_DATE,'T08:32:40Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"', concat(CURRENT_DATE,'T10:04:35+02:00_991_294_220901_9_9'), '"}')::json, '3');
|
|
122
122
|
|
|
123
123
|
INSERT INTO vehiclepositions_positions (created_at,delay,delay_stop_arrival,delay_stop_departure,next_stop_id,shape_dist_traveled,is_canceled,lat,lng,origin_time,origin_timestamp,is_tracked,trips_id,create_batch_id,created_by,update_batch_id,updated_at,updated_by,id,bearing,cis_last_stop_id,cis_last_stop_sequence,last_stop_id,last_stop_sequence,next_stop_sequence,speed,last_stop_arrival_time,last_stop_departure_time,next_stop_arrival_time,next_stop_departure_time,asw_last_stop_id,state_process,state_position,this_stop_id,this_stop_sequence,tcp_event,last_stop_headsign,last_stop_name,next_stop_name,this_stop_name,valid_to) VALUES
|
|
124
124
|
(concat(CURRENT_DATE,'T09:14:32Z')::timestamp,NULL,NULL,NULL,'U306Z101P',0,NULL,50.09837,14.36282,'10:20:08',concat(CURRENT_DATE,'T08:20:08Z')::timestamptz,false,concat(CURRENT_DATE,'T10:32:35+02:00_991_78_220321_5_5'),NULL,NULL,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,NULL,26,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,concat(CURRENT_DATE,'T08:32:35Z')::timestamp,concat(CURRENT_DATE,'T08:32:35Z')::timestamp,NULL,'processed','before_track','U157Z102P',NULL,NULL,NULL,NULL,NULL,NULL,concat(CURRENT_DATE,'T09:40:00Z')::timestamp),
|
|
@@ -153,14 +153,14 @@ VALUES
|
|
|
153
153
|
WITH init_values AS (SELECT NOW()::DATE AS now_date)
|
|
154
154
|
INSERT INTO "vehiclepositions_trips" ("cis_line_id","cis_trip_number","run_number","internal_run_number","cis_line_short_name","created_at","gtfs_route_id","gtfs_route_short_name","gtfs_trip_id","id","updated_at","start_cis_stop_id","start_cis_stop_platform_code","start_time","start_timestamp","vehicle_type_id","wheelchair_accessible","create_batch_id","created_by","update_batch_id","updated_by","agency_name_scheduled","origin_route_name","internal_route_name","agency_name_real","vehicle_registration_number","gtfs_trip_headsign","start_asw_stop_id","gtfs_route_type","gtfs_block_id","last_position_id","is_canceled","end_timestamp","gtfs_trip_short_name","last_position_context")
|
|
155
155
|
VALUES
|
|
156
|
-
--(E'100212',1044,2,E'212',E'2022-12-23 11:54:16.664+01',E'L212',E'212',E'212_365_221211',E'2022-12-23T11:24:00Z_100212_212_1044',E'2022-12-23 13:01:17.635+01',58701,E'A',E'12:24:00',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '12:24:00')*1000,3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212',E'STENBUS',1712,E'Nádraží Klánovice-sever',NULL,3,NULL,1564165759,FALSE,1671795000000,NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671795011000,"firstPositionDelay":11},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564165759","lastPositionOriginTimestamp":1671796852000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":196,"delay":36,"id":"1563938739","lat":50.08797,"lng":14.66552,"origin_time":"12:30:36","origin_timestamp":1671795036000,"shape_dist_traveled":2.408,"is_tracked":true,"is_canceled":false,"state_position":"at_stop","state_process":"processed","tcp_event":null,"this_stop_sequence":7,"last_stop_sequence":7,"last_stop_id":"U454Z4P","last_stop_arrival_time":1671795000000,"last_stop_departure_time":1671795000000,"next_stop_id":"U454Z4P","next_stop_name":"Nádraží Klánovice-sever","last_stop_name":"Nádraží Klánovice-sever","next_stop_sequence":7,"next_stop_arrival_time":1671795000000,"next_stop_departure_time":1671795000000,"this_stop_id":"U454Z4P","this_stop_name":"Nádraží Klánovice-sever","valid_to":1671795336000},"geometry":{"type":"Point","coordinates":[14.66552,50.08797]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"
|
|
157
|
-
--(E'100212',1043,2,E'212',E'2022-12-23 12:01:12.172+01',E'L212',E'212',E'212_366_221211',E'2022-12-23T11:31:00Z_100212_212_1043',E'2022-12-23 13:07:38.147+01',27935,E'C',E'12:31:00',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '12:31:00')*1000,3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212',E'STENBUS',1712,E'Nepasické náměstí',NULL,3,NULL,1564213175,FALSE,1671795360000,NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671795477000,"firstPositionDelay":117},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564213175","lastPositionOriginTimestamp":1671797202000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":38,"delay":117,"id":"1563990184","lat":50.1036,"lng":14.6586,"origin_time":"12:37:57","origin_timestamp":1671795477000,"shape_dist_traveled":2.491,"is_tracked":true,"is_canceled":false,"state_position":"at_stop","state_process":"processed","tcp_event":null,"this_stop_sequence":6,"last_stop_sequence":6,"last_stop_id":"U4107Z1P","last_stop_arrival_time":1671795360000,"last_stop_departure_time":1671795360000,"next_stop_id":"U4107Z1P","next_stop_name":"Nepasické náměstí","last_stop_name":"Nepasické náměstí","next_stop_sequence":6,"next_stop_arrival_time":1671795360000,"next_stop_departure_time":1671795360000,"this_stop_id":"U4107Z1P","this_stop_name":"Nepasické náměstí","valid_to":1671795777000},"geometry":{"type":"Point","coordinates":[14.6586,50.1036]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"
|
|
158
|
-
--(E'100212',1046,2,E'212',E'2022-12-23 12:24:16.404+01',E'L212',E'212',E'212_367_221211',E'2022-12-23T11:54:00Z_100212_212_1046',E'2022-12-23 13:30:11.782+01',58701,E'A',E'12:54:00',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '12:54:00')*1000,3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212',E'STENBUS',1712,E'Nádraží Klánovice-sever',NULL,3,NULL,1564383076,FALSE,1671796800000,NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671796785000,"firstPositionDelay":-15},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564383076","lastPositionOriginTimestamp":1671798580000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":196,"delay":-15,"id":"1564155786","lat":50.08828,"lng":14.66574,"origin_time":"12:59:45","origin_timestamp":1671796785000,"shape_dist_traveled":2.408,"is_tracked":true,"is_canceled":false,"state_position":"at_stop","state_process":"processed","tcp_event":null,"this_stop_sequence":7,"last_stop_sequence":7,"last_stop_id":"U454Z4P","last_stop_arrival_time":1671796800000,"last_stop_departure_time":1671796800000,"next_stop_id":"U454Z4P","next_stop_name":"Nádraží Klánovice-sever","last_stop_name":"Nádraží Klánovice-sever","next_stop_sequence":7,"next_stop_arrival_time":1671796800000,"next_stop_departure_time":1671796800000,"this_stop_id":"U454Z4P","this_stop_name":"Nádraží Klánovice-sever","valid_to":1671797085000},"geometry":{"type":"Point","coordinates":[14.66574,50.08828]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"
|
|
159
|
-
--(E'100212',1045,2,E'212',E'2022-12-23 12:31:20.392+01',E'L212',E'212',E'212_368_221211',E'2022-12-23T12:01:00Z_100212_212_1045',E'2022-12-23 13:36:04.603+01',27935,E'C',E'13:01:00',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '13:01:00')*1000,3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212',E'STENBUS',1712,E'Nepasické náměstí',NULL,3,NULL,1564424455,FALSE,1671797160000,NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671797087000,"firstPositionDelay":-13},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564424455","lastPositionOriginTimestamp":1671798943000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":359,"delay":-7,"id":"1564202112","lat":50.10244,"lng":14.65803,"origin_time":"13:05:33","origin_timestamp":1671797133000,"shape_dist_traveled":2.289,"is_tracked":true,"is_canceled":false,"state_position":"on_track","state_process":"processed","tcp_event":null,"last_stop_sequence":5,"last_stop_id":"U4137Z1P","last_stop_arrival_time":1671797100000,"last_stop_departure_time":1671797100000,"next_stop_id":"U4107Z1P","next_stop_name":"Nepasické náměstí","last_stop_name":"Všestarská","next_stop_sequence":6,"next_stop_arrival_time":1671797160000,"next_stop_departure_time":1671797160000,"valid_to":1671797433000},"geometry":{"type":"Point","coordinates":[14.65803,50.10244]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"
|
|
160
|
-
(E'100212',1044,2,2,E'212',E'2022-12-23 11:54:16.664+01',E'L212',E'212',E'212_365_221211',E'2022-12-23T11:24:00Z_100212_212_1044',E'2022-12-23 13:01:17.635+01',58701,E'A',E'12:24:00',((SELECT now_date FROM init_values) + INTERVAL '12:24:00') at time zone 'Europe/Prague',3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212','212',E'STENBUS',1712,E'Nádraží Klánovice-sever',NULL,3,NULL,1564165759,FALSE,((SELECT now_date FROM init_values) + INTERVAL '12:30:00' ) at time zone 'Europe/Prague',NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671795011000,"firstPositionDelay":11},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564165759","lastPositionOriginTimestamp":1671796852000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":196,"delay":36,"id":"1563938739","lat":50.08797,"lng":14.66552,"origin_time":"12:30:36","origin_timestamp":1671795036000,"shape_dist_traveled":2.408,"is_tracked":false,"is_canceled":false,"state_position":"after_track","state_process":"processed","tcp_event":null,"this_stop_sequence":7,"last_stop_sequence":7,"last_stop_id":"U454Z4P","last_stop_arrival_time":1671795000000,"last_stop_departure_time":1671795000000,"next_stop_id":"U454Z4P","next_stop_name":"Nádraží Klánovice-sever","last_stop_name":"Nádraží Klánovice-sever","next_stop_sequence":7,"next_stop_arrival_time":1671795000000,"next_stop_departure_time":1671795000000,"this_stop_id":"U454Z4P","this_stop_name":"Nádraží Klánovice-sever","valid_to":1671795336000},"geometry":{"type":"Point","coordinates":[14.66552,50.08797]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"
|
|
161
|
-
(E'100212',1043,2,2,E'212',E'2022-12-23 12:01:12.172+01',E'L212',E'212',E'212_366_221211',E'2022-12-23T11:31:00Z_100212_212_1043',E'2022-12-23 13:07:38.147+01',27935,E'C',E'12:31:00',((SELECT now_date FROM init_values) + INTERVAL '12:31:00') at time zone 'Europe/Prague',3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212','212',E'STENBUS',1712,E'Nepasické náměstí',NULL,3,NULL,1564213175,FALSE,((SELECT now_date FROM init_values) + INTERVAL '12:36:00') at time zone 'Europe/Prague',NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671795477000,"firstPositionDelay":117},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564213175","lastPositionOriginTimestamp":1671797202000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":38,"delay":117,"id":"1563990184","lat":50.1036,"lng":14.6586,"origin_time":"12:37:57","origin_timestamp":1671795477000,"shape_dist_traveled":2.491,"is_tracked":false,"is_canceled":false,"state_position":"after_track","state_process":"processed","tcp_event":null,"this_stop_sequence":6,"last_stop_sequence":6,"last_stop_id":"U4107Z1P","last_stop_arrival_time":1671795360000,"last_stop_departure_time":1671795360000,"next_stop_id":"U4107Z1P","next_stop_name":"Nepasické náměstí","last_stop_name":"Nepasické náměstí","next_stop_sequence":6,"next_stop_arrival_time":1671795360000,"next_stop_departure_time":1671795360000,"this_stop_id":"U4107Z1P","this_stop_name":"Nepasické náměstí","valid_to":1671795777000},"geometry":{"type":"Point","coordinates":[14.6586,50.1036]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"
|
|
162
|
-
(E'100212',1046,2,2,E'212',E'2022-12-23 12:24:16.404+01',E'L212',E'212',E'212_367_221211',E'2022-12-23T11:54:00Z_100212_212_1046',E'2022-12-23 13:30:11.782+01',58701,E'A',E'12:54:00',((SELECT now_date FROM init_values) + INTERVAL '12:54:00') at time zone 'Europe/Prague',3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212','212',E'STENBUS',1712,E'Nádraží Klánovice-sever',NULL,3,NULL,1564383076,FALSE,((SELECT now_date FROM init_values) + INTERVAL '13:00:00') at time zone 'Europe/Prague',NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671796785000,"firstPositionDelay":-15},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564383076","lastPositionOriginTimestamp":1671798580000,"lastPositionTracking":null,"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"
|
|
163
|
-
(E'100212',1045,2,2,E'212',E'2022-12-23 12:31:20.392+01',E'L212',E'212',E'212_368_221211',E'2022-12-23T12:01:00Z_100212_212_1045',E'2022-12-23 13:36:04.603+01',27935,E'C',E'13:01:00',((SELECT now_date FROM init_values) + INTERVAL '13:01:00') at time zone 'Europe/Prague',3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212','212',E'STENBUS',1712,E'Nepasické náměstí',NULL,3,NULL,1564424455,FALSE,((SELECT now_date FROM init_values) + INTERVAL '13:06:00') at time zone 'Europe/Prague',NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671797087000,"firstPositionDelay":-13},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564424455","lastPositionOriginTimestamp":1671798943000,"lastPositionTracking":null,"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"
|
|
156
|
+
--(E'100212',1044,2,E'212',E'2022-12-23 11:54:16.664+01',E'L212',E'212',E'212_365_221211',E'2022-12-23T11:24:00Z_100212_212_1044',E'2022-12-23 13:01:17.635+01',58701,E'A',E'12:24:00',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '12:24:00')*1000,3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212',E'STENBUS',1712,E'Nádraží Klánovice-sever',NULL,3,NULL,1564165759,FALSE,1671795000000,NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671795011000,"firstPositionDelay":11},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564165759","lastPositionOriginTimestamp":1671796852000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":196,"delay":36,"id":"1563938739","lat":50.08797,"lng":14.66552,"origin_time":"12:30:36","origin_timestamp":1671795036000,"shape_dist_traveled":2.408,"is_tracked":true,"is_canceled":false,"state_position":"at_stop","state_process":"processed","tcp_event":null,"this_stop_sequence":7,"last_stop_sequence":7,"last_stop_id":"U454Z4P","last_stop_arrival_time":1671795000000,"last_stop_departure_time":1671795000000,"next_stop_id":"U454Z4P","next_stop_name":"Nádraží Klánovice-sever","last_stop_name":"Nádraží Klánovice-sever","next_stop_sequence":7,"next_stop_arrival_time":1671795000000,"next_stop_departure_time":1671795000000,"this_stop_id":"U454Z4P","this_stop_name":"Nádraží Klánovice-sever","valid_to":1671795336000},"geometry":{"type":"Point","coordinates":[14.66552,50.08797]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"lastPositionState":"after_track","tripId":"2022-12-23T11:24:00Z_100212_212_1044"}'),
|
|
157
|
+
--(E'100212',1043,2,E'212',E'2022-12-23 12:01:12.172+01',E'L212',E'212',E'212_366_221211',E'2022-12-23T11:31:00Z_100212_212_1043',E'2022-12-23 13:07:38.147+01',27935,E'C',E'12:31:00',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '12:31:00')*1000,3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212',E'STENBUS',1712,E'Nepasické náměstí',NULL,3,NULL,1564213175,FALSE,1671795360000,NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671795477000,"firstPositionDelay":117},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564213175","lastPositionOriginTimestamp":1671797202000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":38,"delay":117,"id":"1563990184","lat":50.1036,"lng":14.6586,"origin_time":"12:37:57","origin_timestamp":1671795477000,"shape_dist_traveled":2.491,"is_tracked":true,"is_canceled":false,"state_position":"at_stop","state_process":"processed","tcp_event":null,"this_stop_sequence":6,"last_stop_sequence":6,"last_stop_id":"U4107Z1P","last_stop_arrival_time":1671795360000,"last_stop_departure_time":1671795360000,"next_stop_id":"U4107Z1P","next_stop_name":"Nepasické náměstí","last_stop_name":"Nepasické náměstí","next_stop_sequence":6,"next_stop_arrival_time":1671795360000,"next_stop_departure_time":1671795360000,"this_stop_id":"U4107Z1P","this_stop_name":"Nepasické náměstí","valid_to":1671795777000},"geometry":{"type":"Point","coordinates":[14.6586,50.1036]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"2022-12-23T11:31:00Z_100212_212_1043"}'),
|
|
158
|
+
--(E'100212',1046,2,E'212',E'2022-12-23 12:24:16.404+01',E'L212',E'212',E'212_367_221211',E'2022-12-23T11:54:00Z_100212_212_1046',E'2022-12-23 13:30:11.782+01',58701,E'A',E'12:54:00',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '12:54:00')*1000,3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212',E'STENBUS',1712,E'Nádraží Klánovice-sever',NULL,3,NULL,1564383076,FALSE,1671796800000,NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671796785000,"firstPositionDelay":-15},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564383076","lastPositionOriginTimestamp":1671798580000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":196,"delay":-15,"id":"1564155786","lat":50.08828,"lng":14.66574,"origin_time":"12:59:45","origin_timestamp":1671796785000,"shape_dist_traveled":2.408,"is_tracked":true,"is_canceled":false,"state_position":"at_stop","state_process":"processed","tcp_event":null,"this_stop_sequence":7,"last_stop_sequence":7,"last_stop_id":"U454Z4P","last_stop_arrival_time":1671796800000,"last_stop_departure_time":1671796800000,"next_stop_id":"U454Z4P","next_stop_name":"Nádraží Klánovice-sever","last_stop_name":"Nádraží Klánovice-sever","next_stop_sequence":7,"next_stop_arrival_time":1671796800000,"next_stop_departure_time":1671796800000,"this_stop_id":"U454Z4P","this_stop_name":"Nádraží Klánovice-sever","valid_to":1671797085000},"geometry":{"type":"Point","coordinates":[14.66574,50.08828]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"lastPositionState":"after_track","tripId":"2022-12-23T11:54:00Z_100212_212_1046"}'),
|
|
159
|
+
--(E'100212',1045,2,E'212',E'2022-12-23 12:31:20.392+01',E'L212',E'212',E'212_368_221211',E'2022-12-23T12:01:00Z_100212_212_1045',E'2022-12-23 13:36:04.603+01',27935,E'C',E'13:01:00',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '13:01:00')*1000,3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212',E'STENBUS',1712,E'Nepasické náměstí',NULL,3,NULL,1564424455,FALSE,1671797160000,NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671797087000,"firstPositionDelay":-13},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564424455","lastPositionOriginTimestamp":1671798943000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":359,"delay":-7,"id":"1564202112","lat":50.10244,"lng":14.65803,"origin_time":"13:05:33","origin_timestamp":1671797133000,"shape_dist_traveled":2.289,"is_tracked":true,"is_canceled":false,"state_position":"on_track","state_process":"processed","tcp_event":null,"last_stop_sequence":5,"last_stop_id":"U4137Z1P","last_stop_arrival_time":1671797100000,"last_stop_departure_time":1671797100000,"next_stop_id":"U4107Z1P","next_stop_name":"Nepasické náměstí","last_stop_name":"Všestarská","next_stop_sequence":6,"next_stop_arrival_time":1671797160000,"next_stop_departure_time":1671797160000,"valid_to":1671797433000},"geometry":{"type":"Point","coordinates":[14.65803,50.10244]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"lastPositionState":"after_track","tripId":"2022-12-23T12:01:00Z_100212_212_1045"}');
|
|
160
|
+
(E'100212',1044,2,2,E'212',E'2022-12-23 11:54:16.664+01',E'L212',E'212',E'212_365_221211',E'2022-12-23T11:24:00Z_100212_212_1044',E'2022-12-23 13:01:17.635+01',58701,E'A',E'12:24:00',((SELECT now_date FROM init_values) + INTERVAL '12:24:00') at time zone 'Europe/Prague',3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212','212',E'STENBUS',1712,E'Nádraží Klánovice-sever',NULL,3,NULL,1564165759,FALSE,((SELECT now_date FROM init_values) + INTERVAL '12:30:00' ) at time zone 'Europe/Prague',NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671795011000,"firstPositionDelay":11},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564165759","lastPositionOriginTimestamp":1671796852000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":196,"delay":36,"id":"1563938739","lat":50.08797,"lng":14.66552,"origin_time":"12:30:36","origin_timestamp":1671795036000,"shape_dist_traveled":2.408,"is_tracked":false,"is_canceled":false,"state_position":"after_track","state_process":"processed","tcp_event":null,"this_stop_sequence":7,"last_stop_sequence":7,"last_stop_id":"U454Z4P","last_stop_arrival_time":1671795000000,"last_stop_departure_time":1671795000000,"next_stop_id":"U454Z4P","next_stop_name":"Nádraží Klánovice-sever","last_stop_name":"Nádraží Klánovice-sever","next_stop_sequence":7,"next_stop_arrival_time":1671795000000,"next_stop_departure_time":1671795000000,"this_stop_id":"U454Z4P","this_stop_name":"Nádraží Klánovice-sever","valid_to":1671795336000},"geometry":{"type":"Point","coordinates":[14.66552,50.08797]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"lastPositionState":"after_track","tripId":"2022-12-23T11:24:00Z_100212_212_1044"}'),
|
|
161
|
+
(E'100212',1043,2,2,E'212',E'2022-12-23 12:01:12.172+01',E'L212',E'212',E'212_366_221211',E'2022-12-23T11:31:00Z_100212_212_1043',E'2022-12-23 13:07:38.147+01',27935,E'C',E'12:31:00',((SELECT now_date FROM init_values) + INTERVAL '12:31:00') at time zone 'Europe/Prague',3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212','212',E'STENBUS',1712,E'Nepasické náměstí',NULL,3,NULL,1564213175,FALSE,((SELECT now_date FROM init_values) + INTERVAL '12:36:00') at time zone 'Europe/Prague',NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671795477000,"firstPositionDelay":117},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564213175","lastPositionOriginTimestamp":1671797202000,"lastPositionTracking":{"type":"Feature","properties":{"bearing":38,"delay":117,"id":"1563990184","lat":50.1036,"lng":14.6586,"origin_time":"12:37:57","origin_timestamp":1671795477000,"shape_dist_traveled":2.491,"is_tracked":false,"is_canceled":false,"state_position":"after_track","state_process":"processed","tcp_event":null,"this_stop_sequence":6,"last_stop_sequence":6,"last_stop_id":"U4107Z1P","last_stop_arrival_time":1671795360000,"last_stop_departure_time":1671795360000,"next_stop_id":"U4107Z1P","next_stop_name":"Nepasické náměstí","last_stop_name":"Nepasické náměstí","next_stop_sequence":6,"next_stop_arrival_time":1671795360000,"next_stop_departure_time":1671795360000,"this_stop_id":"U4107Z1P","this_stop_name":"Nepasické náměstí","valid_to":1671795777000},"geometry":{"type":"Point","coordinates":[14.6586,50.1036]}},"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"2022-12-23T11:31:00Z_100212_212_1043"}'),
|
|
162
|
+
(E'100212',1046,2,2,E'212',E'2022-12-23 12:24:16.404+01',E'L212',E'212',E'212_367_221211',E'2022-12-23T11:54:00Z_100212_212_1046',E'2022-12-23 13:30:11.782+01',58701,E'A',E'12:54:00',((SELECT now_date FROM init_values) + INTERVAL '12:54:00') at time zone 'Europe/Prague',3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212','212',E'STENBUS',1712,E'Nádraží Klánovice-sever',NULL,3,NULL,1564383076,FALSE,((SELECT now_date FROM init_values) + INTERVAL '13:00:00') at time zone 'Europe/Prague',NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671796785000,"firstPositionDelay":-15},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564383076","lastPositionOriginTimestamp":1671798580000,"lastPositionTracking":null,"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"lastPositionState":"after_track","tripId":"2022-12-23T11:54:00Z_100212_212_1046"}'),
|
|
163
|
+
(E'100212',1045,2,2,E'212',E'2022-12-23 12:31:20.392+01',E'L212',E'212',E'212_368_221211',E'2022-12-23T12:01:00Z_100212_212_1045',E'2022-12-23 13:36:04.603+01',27935,E'C',E'13:01:00',((SELECT now_date FROM init_values) + INTERVAL '13:01:00') at time zone 'Europe/Prague',3,TRUE,NULL,NULL,NULL,NULL,E'STENBUS',E'212','212',E'STENBUS',1712,E'Nepasické náměstí',NULL,3,NULL,1564424455,FALSE,((SELECT now_date FROM init_values) + INTERVAL '13:06:00') at time zone 'Europe/Prague',NULL,E'{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":1671797087000,"firstPositionDelay":-13},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionId":"1564424455","lastPositionOriginTimestamp":1671798943000,"lastPositionTracking":null,"lastPositionCanceled":false,"lastPositionBeforeTrackDelayed":null,"lastPositionState":"after_track","tripId":"2022-12-23T12:01:00Z_100212_212_1045"}');
|
|
164
164
|
|
|
165
165
|
--(E'2022-12-23 12:36:58.062+01',NULL,9,NULL,NULL,2.408,FALSE,50.10024,14.66322,E'12:36:27',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '12:36:27')*1000,0,E'2022-12-23T11:24:00Z_100212_212_1044',NULL,NULL,NULL,E'2022-12-23 12:36:59.26+01',NULL,1563981366,297,27935,7,E'U454Z4P',7,NULL,28,1671795000000,1671795000000,NULL,NULL,NULL,E'processed',E'after_track',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1671795687000),
|
|
166
166
|
--(E'2022-12-23 12:36:58.062+01',87,NULL,87,E'U4107Z1P',1.887,FALSE,50.10024,14.66322,E'12:36:27',EXTRACT(EPOCH FROM (SELECT now_date FROM init_values) + INTERVAL '12:36:27')*1000,2,E'2022-12-23T11:31:00Z_100212_212_1043',NULL,NULL,NULL,E'2022-12-23 12:36:59.261+01',NULL,1563981365,270,59545,5,E'U4137Z1P',5,6,28,1671795300000,1671795300000,1671795360000,1671795360000,NULL,E'processed',E'at_stop',E'U4137Z1P',5,NULL,NULL,E'Všestarská',NULL,NULL,1671795687000),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Position } from "@golemio/core/dist/shared/geojson";
|
|
2
|
+
import { BBox, Point } from "cheap-ruler";
|
|
3
|
+
import { IGeoMeasurementHelper } from "./interfaces/IGeoMeasurementHelper";
|
|
4
|
+
export declare class GeoMeasurementHelper implements IGeoMeasurementHelper {
|
|
5
|
+
private rulerInstanceDict;
|
|
6
|
+
constructor();
|
|
7
|
+
/** Get distance in kilometers between two points */
|
|
8
|
+
getDistanceInKilometers(pointA: Point | Position, pointB: Point | Position): number;
|
|
9
|
+
/** Get distance in meters between two points */
|
|
10
|
+
getDistanceInMeters(pointA: Point | Position, pointB: Point | Position): number;
|
|
11
|
+
/** Get buffered bounding box in kilometers */
|
|
12
|
+
getBufferedBBoxInKilometers(point: Point | Position, bufferInKm: number): BBox;
|
|
13
|
+
/** Check if point is inside bounding box */
|
|
14
|
+
isPointInBBox(point: Point | Position, bbox: BBox): boolean;
|
|
15
|
+
private getRulerInstance;
|
|
16
|
+
private getValidPoint;
|
|
17
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GeoMeasurementHelper = void 0;
|
|
16
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
17
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
18
|
+
const cheap_ruler_1 = __importDefault(require("cheap-ruler"));
|
|
19
|
+
const APPROXIMATION_LATITUDE = 50.0;
|
|
20
|
+
let GeoMeasurementHelper = exports.GeoMeasurementHelper = class GeoMeasurementHelper {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.rulerInstanceDict = new Map();
|
|
23
|
+
}
|
|
24
|
+
/** Get distance in kilometers between two points */
|
|
25
|
+
getDistanceInKilometers(pointA, pointB) {
|
|
26
|
+
const validPointA = this.getValidPoint(pointA);
|
|
27
|
+
const validPointB = this.getValidPoint(pointB);
|
|
28
|
+
return this.getRulerInstance("kilometers").distance(validPointA, validPointB);
|
|
29
|
+
}
|
|
30
|
+
/** Get distance in meters between two points */
|
|
31
|
+
getDistanceInMeters(pointA, pointB) {
|
|
32
|
+
const validPointA = this.getValidPoint(pointA);
|
|
33
|
+
const validPointB = this.getValidPoint(pointB);
|
|
34
|
+
return this.getRulerInstance("meters").distance(validPointA, validPointB);
|
|
35
|
+
}
|
|
36
|
+
/** Get buffered bounding box in kilometers */
|
|
37
|
+
getBufferedBBoxInKilometers(point, bufferInKm) {
|
|
38
|
+
const validPoint = this.getValidPoint(point);
|
|
39
|
+
return this.getRulerInstance("kilometers").bufferPoint(validPoint, bufferInKm);
|
|
40
|
+
}
|
|
41
|
+
/** Check if point is inside bounding box */
|
|
42
|
+
isPointInBBox(point, bbox) {
|
|
43
|
+
const validPoint = this.getValidPoint(point);
|
|
44
|
+
return this.getRulerInstance("kilometers").insideBBox(validPoint, bbox);
|
|
45
|
+
}
|
|
46
|
+
getRulerInstance(unit) {
|
|
47
|
+
let ruler = this.rulerInstanceDict.get(unit);
|
|
48
|
+
if (!ruler) {
|
|
49
|
+
ruler = new cheap_ruler_1.default(APPROXIMATION_LATITUDE, unit);
|
|
50
|
+
this.rulerInstanceDict.set(unit, ruler);
|
|
51
|
+
}
|
|
52
|
+
return ruler;
|
|
53
|
+
}
|
|
54
|
+
getValidPoint(point) {
|
|
55
|
+
if (point.length !== 2) {
|
|
56
|
+
throw new golemio_errors_1.GeneralError("getValidPoint: invalid point " + JSON.stringify(point), this.constructor.name, undefined, 422);
|
|
57
|
+
}
|
|
58
|
+
return point;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.GeoMeasurementHelper = GeoMeasurementHelper = __decorate([
|
|
62
|
+
(0, tsyringe_1.injectable)(),
|
|
63
|
+
__metadata("design:paramtypes", [])
|
|
64
|
+
], GeoMeasurementHelper);
|
|
65
|
+
//# sourceMappingURL=GeoMeasurementHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeoMeasurementHelper.js","sourceRoot":"","sources":["../../../src/helpers/geo/GeoMeasurementHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,6EAAwE;AACxE,iEAAgE;AAChE,8DAAsD;AAItD,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAG7B,IAAM,oBAAoB,kCAA1B,MAAM,oBAAoB;IAG7B;QACI,IAAI,CAAC,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;IACvC,CAAC;IAED,oDAAoD;IAC7C,uBAAuB,CAAC,MAAwB,EAAE,MAAwB;QAC7E,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAClF,CAAC;IAED,gDAAgD;IACzC,mBAAmB,CAAC,MAAwB,EAAE,MAAwB;QACzE,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC9E,CAAC;IAED,8CAA8C;IACvC,2BAA2B,CAAC,KAAuB,EAAE,UAAkB;QAC1E,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACnF,CAAC;IAED,4CAA4C;IACrC,aAAa,CAAC,KAAuB,EAAE,IAAU;QACpD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC5E,CAAC;IAEO,gBAAgB,CAAC,IAAU;QAC/B,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,EAAE;YACR,KAAK,GAAG,IAAI,qBAAU,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;YACrD,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;SAC3C;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,aAAa,CAAC,KAAuB;QACzC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,MAAM,IAAI,6BAAY,CAClB,+BAA+B,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EACvD,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,SAAS,EACT,GAAG,CACN,CAAC;SACL;QAED,OAAO,KAAc,CAAC;IAC1B,CAAC;CACJ,CAAA;+BAvDY,oBAAoB;IADhC,IAAA,qBAAU,GAAE;;GACA,oBAAoB,CAuDhC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Position } from "@golemio/core/dist/shared/geojson";
|
|
2
|
+
import { BBox, Point } from "cheap-ruler";
|
|
3
|
+
export interface IGeoMeasurementHelper {
|
|
4
|
+
getDistanceInKilometers(pointA: Point | Position, pointB: Point | Position): number;
|
|
5
|
+
getDistanceInMeters(pointA: Point | Position, pointB: Point | Position): number;
|
|
6
|
+
getBufferedBBoxInKilometers(point: Point | Position, bufferInKm: number): BBox;
|
|
7
|
+
isPointInBBox(point: Point | Position, bbox: BBox): boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IGeoMeasurementHelper.js","sourceRoot":"","sources":["../../../../src/helpers/geo/interfaces/IGeoMeasurementHelper.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PidContainer = void 0;
|
|
4
|
+
const GeoMeasurementHelper_1 = require("../../helpers/geo/GeoMeasurementHelper");
|
|
4
5
|
const DeparturePresetsRepository_1 = require("../ropid-gtfs/data-access/DeparturePresetsRepository");
|
|
5
6
|
const RopidDeparturesPresetsTransformation_1 = require("../ropid-gtfs/transformations/RopidDeparturesPresetsTransformation");
|
|
6
7
|
const PresetLogRepository_1 = require("../ropid-gtfs/workers/presets/data-access/PresetLogRepository");
|
|
7
|
-
const GrafanaLokiDataSourceProvider_1 = require("../ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider");
|
|
8
8
|
const PresetLogDataSourceFactory_1 = require("../ropid-gtfs/workers/presets/datasources/PresetLogDataSourceFactory");
|
|
9
|
+
const GrafanaLokiDataSourceProvider_1 = require("../ropid-gtfs/workers/presets/datasources/grafana-loki/GrafanaLokiDataSourceProvider");
|
|
9
10
|
const LogFilter_1 = require("../ropid-gtfs/workers/presets/helpers/LogFilter");
|
|
10
11
|
const RopidMonitoringService_1 = require("../ropid-gtfs/workers/presets/helpers/RopidMonitoringService");
|
|
11
12
|
const PresetLogTransformation_1 = require("../ropid-gtfs/workers/presets/transformations/PresetLogTransformation");
|
|
@@ -15,6 +16,11 @@ const ModuleContainerToken_1 = require("./ModuleContainerToken");
|
|
|
15
16
|
const PidContainer = Di_1.IntegrationEngineContainer.createChildContainer();
|
|
16
17
|
exports.PidContainer = PidContainer;
|
|
17
18
|
//#endregion
|
|
19
|
+
//#region Helpers
|
|
20
|
+
PidContainer.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.GeoMeasurementHelper, GeoMeasurementHelper_1.GeoMeasurementHelper);
|
|
21
|
+
PidContainer.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.PresetLogFilter, LogFilter_1.LogFilter);
|
|
22
|
+
PidContainer.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.RopidMonitoringService, RopidMonitoringService_1.RopidMonitoringService);
|
|
23
|
+
//#endregion
|
|
18
24
|
//#region Datasources
|
|
19
25
|
PidContainer.register(ModuleContainerToken_1.ModuleContainerToken.GrafanaLokiDataSourceProvider, GrafanaLokiDataSourceProvider_1.GrafanaLokiDataSourceProvider);
|
|
20
26
|
PidContainer.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.PresetLogDataSourceFactory, PresetLogDataSourceFactory_1.PresetLogDataSourceFactory);
|
|
@@ -26,8 +32,4 @@ PidContainer.register(ModuleContainerToken_1.ModuleContainerToken.PresetLogRepos
|
|
|
26
32
|
//#region Transformations
|
|
27
33
|
PidContainer.register(ModuleContainerToken_1.ModuleContainerToken.RopidDeparturesPresetsTransformation, RopidDeparturesPresetsTransformation_1.RopidDeparturesPresetsTransformation);
|
|
28
34
|
PidContainer.register(ModuleContainerToken_1.ModuleContainerToken.PresetLogTransformation, PresetLogTransformation_1.PresetLogTransformation);
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region Helpers
|
|
31
|
-
PidContainer.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.PresetLogFilter, LogFilter_1.LogFilter);
|
|
32
|
-
PidContainer.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.RopidMonitoringService, RopidMonitoringService_1.RopidMonitoringService);
|
|
33
35
|
//# sourceMappingURL=Di.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/integration-engine/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,qGAAmG;AACnG,6HAA2H;AAC3H,uGAAqG;AACrG,wIAAsI;AACtI
|
|
1
|
+
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/integration-engine/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,iFAAyE;AACzE,qGAAmG;AACnG,6HAA2H;AAC3H,uGAAqG;AACrG,qHAAmH;AACnH,wIAAsI;AACtI,+EAA6E;AAC7E,yGAAuG;AACvG,mHAAiH;AACjH,qEAA0F;AAC1F,iEAA8D;AAE9D,wBAAwB;AACxB,MAAM,YAAY,GAAG,+BAA0B,CAAC,oBAAoB,EAAE,CAAC;AAwB9D,oCAAY;AAvBrB,YAAY;AAEZ,iBAAiB;AACjB,YAAY,CAAC,iBAAiB,CAAC,2CAAoB,CAAC,oBAAoB,EAAE,2CAAoB,CAAC,CAAC;AAChG,YAAY,CAAC,iBAAiB,CAAC,2CAAoB,CAAC,eAAe,EAAE,qBAAS,CAAC,CAAC;AAChF,YAAY,CAAC,iBAAiB,CAAC,2CAAoB,CAAC,sBAAsB,EAAE,+CAAsB,CAAC,CAAC;AACpG,YAAY;AAEZ,qBAAqB;AACrB,YAAY,CAAC,QAAQ,CAAC,2CAAoB,CAAC,6BAA6B,EAAE,6DAA6B,CAAC,CAAC;AACzG,YAAY,CAAC,iBAAiB,CAAC,2CAAoB,CAAC,0BAA0B,EAAE,uDAA0B,CAAC,CAAC;AAC5G,YAAY;AAEZ,qBAAqB;AACrB,YAAY,CAAC,QAAQ,CAAC,2CAAoB,CAAC,0BAA0B,EAAE,uDAA0B,CAAC,CAAC;AACnG,YAAY,CAAC,QAAQ,CAAC,2CAAoB,CAAC,mBAAmB,EAAE,yCAAmB,CAAC,CAAC;AACrF,YAAY;AAEZ,yBAAyB;AACzB,YAAY,CAAC,QAAQ,CAAC,2CAAoB,CAAC,oCAAoC,EAAE,2EAAoC,CAAC,CAAC;AACvH,YAAY,CAAC,QAAQ,CAAC,2CAAoB,CAAC,uBAAuB,EAAE,iDAAuB,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ModuleContainerToken = void 0;
|
|
4
4
|
const ModuleContainerToken = {
|
|
5
|
+
GeoMeasurementHelper: Symbol(),
|
|
5
6
|
DeparturePresetsRepository: Symbol(),
|
|
6
7
|
RopidDeparturesPresetsTransformation: Symbol(),
|
|
7
8
|
GrafanaLokiDataSourceProvider: Symbol(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleContainerToken.js","sourceRoot":"","sources":["../../../src/integration-engine/ioc/ModuleContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAAG;IACzB,0BAA0B,EAAE,MAAM,EAAE;IACpC,oCAAoC,EAAE,MAAM,EAAE;IAC9C,6BAA6B,EAAE,MAAM,EAAE;IACvC,0BAA0B,EAAE,MAAM,EAAE;IACpC,uBAAuB,EAAE,MAAM,EAAE;IACjC,mBAAmB,EAAE,MAAM,EAAE;IAC7B,eAAe,EAAE,MAAM,EAAE;IACzB,sBAAsB,EAAE,MAAM,EAAE;CACnC,CAAC;AAEO,oDAAoB"}
|
|
1
|
+
{"version":3,"file":"ModuleContainerToken.js","sourceRoot":"","sources":["../../../src/integration-engine/ioc/ModuleContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAAG;IACzB,oBAAoB,EAAE,MAAM,EAAE;IAC9B,0BAA0B,EAAE,MAAM,EAAE;IACpC,oCAAoC,EAAE,MAAM,EAAE;IAC9C,6BAA6B,EAAE,MAAM,EAAE;IACvC,0BAA0B,EAAE,MAAM,EAAE;IACpC,uBAAuB,EAAE,MAAM,EAAE;IACjC,mBAAmB,EAAE,MAAM,EAAE;IAC7B,eAAe,EAAE,MAAM,EAAE;IACzB,sBAAsB,EAAE,MAAM,EAAE;CACnC,CAAC;AAEO,oDAAoB"}
|
package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
3
|
+
const ModuleContainerToken_1 = require("../../../../ioc/ModuleContainerToken");
|
|
4
|
+
const Di_1 = require("../../../ioc/Di");
|
|
7
5
|
class DPPUtils {
|
|
8
6
|
static isOnTheWayFromGarage(originTimestamp, firstSegment, currentCoordinates, firstStopCoordinates) {
|
|
7
|
+
const geoHelper = Di_1.VPContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.GeoMeasurementHelper);
|
|
9
8
|
if (originTimestamp.getTime() < new Date(firstSegment.start_timestamp).valueOf() - this.TIME_THRESHOLD_IN_MS) {
|
|
10
|
-
const distanceFromFirstStop =
|
|
9
|
+
const distanceFromFirstStop = geoHelper.getDistanceInKilometers(currentCoordinates, firstStopCoordinates);
|
|
11
10
|
return distanceFromFirstStop > this.DISTANCE_THRESHOLD_IN_KM;
|
|
12
11
|
}
|
|
13
12
|
return false;
|
package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DPPUtils.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DPPUtils.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.ts"],"names":[],"mappings":";;AACA,+EAAoE;AACpE,wCAA2D;AAK3D,MAAqB,QAAQ;IAiCjB,MAAM,CAAC,oBAAoB,CAC/B,eAAqB,EACrB,YAA0B,EAC1B,kBAAoC,EACpC,oBAAsC;QAEtC,MAAM,SAAS,GAAG,gBAAW,CAAC,OAAO,CAAwB,2CAAoB,CAAC,oBAAoB,CAAC,CAAC;QAExG,IAAI,eAAe,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,oBAAoB,EAAE;YAC1G,MAAM,qBAAqB,GAAG,SAAS,CAAC,uBAAuB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;YAC1G,OAAO,qBAAqB,GAAG,IAAI,CAAC,wBAAwB,CAAC;SAChE;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,MAAM,CAAC,kBAAkB,CAC7B,WAAyB,EACzB,UAAkB,EAClB,SAAkB,EAClB,oBAAuE;QAEvE,qGAAqG;QACrG,+GAA+G;QAC/G,OAAO,WAAW,CAAC,OAAO,KAAK,UAAU,IAAI,CAAC,SAAS,IAAI,oBAAoB,IAAI,IAAI,CAAC;IAC5F,CAAC;;AAzDa,wBAAe,GAAG,UAAU,CAAC;AAC7B,6BAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACrC,iCAAwB,GAAG,GAAG,CAAC;AAE7C,4FAA4F;AAC9E,oBAAW,GAAG,CACxB,mBAA2B,EAC3B,eAAqB,EACrB,cAAsB,EACtB,kBAAoC,EACpC,oBAAsC,EACtC,QAAoC,EACpC,UAAkB,EAClB,oBAAuE,EACvE,SAAkB,EACX,EAAE;;IACT,uFAAuF;IACvF,qFAAqF;IACrF,IAAI,mBAAmB,KAAK,QAAQ,CAAC,eAAe;QAAE,OAAO,KAAK,CAAC;IACnE,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,MAAM,QAAQ,GAAG,MAAA,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,OAAO,EAAE,IAAI,cAAc,CAAC,0CAAE,IAAI,CAAC;IACvG,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC;IACjE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3C,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAExD,OAAO,CACH,QAAQ,CAAC,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,CAAC;QACtG,QAAQ,CAAC,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,oBAAoB,CAAC,CACxF,CAAC;AACN,CAAC,CAAC;kBA/Be,QAAQ"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import * as turf from "@turf/turf";
|
|
2
1
|
import { Feature, Point } from "@turf/turf";
|
|
3
2
|
import { ICurrentPositionProperties, IShapeAnchorPoint } from "../interfaces/VPInterfaces";
|
|
4
3
|
export default class PositionCalculator {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* @returns {IShapeAnchorPoint[]} - Result closest point for each segment
|
|
13
|
-
*/
|
|
14
|
-
static getClosestPoints: (ptsInRadius: IShapeAnchorPoint[][], currentPosition: turf.helpers.Feature<turf.helpers.Point, ICurrentPositionProperties>) => Promise<IShapeAnchorPoint[]>;
|
|
4
|
+
private geoHelper;
|
|
5
|
+
private currentPosition;
|
|
6
|
+
constructor(currentPosition: Feature<Point, ICurrentPositionProperties>);
|
|
7
|
+
/** Find all shape points in polygon circle, get segments with consequenting points */
|
|
8
|
+
getShapePointsAroundPosition: (tripShapePoints: IShapeAnchorPoint[], lastStopSequence: number | null) => IShapeAnchorPoint[][];
|
|
9
|
+
/** Picks only one closest point for each segment/array of points of shape */
|
|
10
|
+
getClosestPoints: (ptsInRadius: IShapeAnchorPoint[][]) => IShapeAnchorPoint[];
|
|
15
11
|
}
|
|
@@ -1,107 +1,37 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
var _a;
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
3
|
+
const ModuleContainerToken_1 = require("../../../../ioc/ModuleContainerToken");
|
|
4
|
+
const Di_1 = require("../../../ioc/Di");
|
|
5
|
+
const AnchorPointSegmenter_1 = require("./anchor-points/AnchorPointSegmenter");
|
|
19
6
|
class PositionCalculator {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (ptsInRadius[segmentIndex] !== undefined) {
|
|
38
|
-
segmentIndex++;
|
|
7
|
+
constructor(currentPosition) {
|
|
8
|
+
/** Find all shape points in polygon circle, get segments with consequenting points */
|
|
9
|
+
this.getShapePointsAroundPosition = (tripShapePoints, lastStopSequence) => {
|
|
10
|
+
const anchorPointSegmenter = new AnchorPointSegmenter_1.AnchorPointSegmenter(tripShapePoints, this.currentPosition);
|
|
11
|
+
return anchorPointSegmenter.getAnchorPointsInRadius(lastStopSequence);
|
|
12
|
+
};
|
|
13
|
+
/** Picks only one closest point for each segment/array of points of shape */
|
|
14
|
+
this.getClosestPoints = (ptsInRadius) => {
|
|
15
|
+
let closestPts = [];
|
|
16
|
+
for (const shapePoints of ptsInRadius) {
|
|
17
|
+
let closestPoint = null;
|
|
18
|
+
let closestDistance = Infinity;
|
|
19
|
+
for (const point of shapePoints) {
|
|
20
|
+
const distance = this.geoHelper.getDistanceInKilometers(this.currentPosition.geometry.coordinates, point.coordinates);
|
|
21
|
+
if (distance < closestDistance) {
|
|
22
|
+
closestPoint = point;
|
|
23
|
+
closestDistance = distance;
|
|
39
24
|
}
|
|
40
|
-
lastWasIn = true;
|
|
41
25
|
}
|
|
42
|
-
if (
|
|
43
|
-
|
|
26
|
+
if (closestPoint !== null) {
|
|
27
|
+
closestPts.push(closestPoint);
|
|
44
28
|
}
|
|
45
|
-
ptsInRadius[segmentIndex].push(tripShapePoints[i]);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
lastWasIn = false;
|
|
49
29
|
}
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
return closestPts;
|
|
31
|
+
};
|
|
32
|
+
this.geoHelper = Di_1.VPContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.GeoMeasurementHelper);
|
|
33
|
+
this.currentPosition = currentPosition;
|
|
52
34
|
}
|
|
53
|
-
|
|
54
|
-
integration_engine_1.log.error(
|
|
55
|
-
// eslint-disable-next-line max-len
|
|
56
|
-
`Unable to calculate getShapePointsAroundPosition for tripId: ${tripId}, tripShapePoints.length: ${tripShapePoints.length}, error message: ${err.message}`);
|
|
57
|
-
return [];
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Picks only one closest point for each segment/array of points of shape
|
|
62
|
-
*
|
|
63
|
-
* @param {IShapeAnchorPoint[][]} ptsInRadius - Feature Point of current position
|
|
64
|
-
* @param {Feature<Point, ICurrentPositionProperties>} currentPosition - Feature Point of current position
|
|
65
|
-
* @returns {IShapeAnchorPoint[]} - Result closest point for each segment
|
|
66
|
-
*/
|
|
67
|
-
PositionCalculator.getClosestPoints = (ptsInRadius, currentPosition) => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
-
const closestPts = [];
|
|
69
|
-
const innerPtsInRadiusIterator = (i, options, cb) => {
|
|
70
|
-
// end of iteration
|
|
71
|
-
if (ptsInRadius[i].length === options.k) {
|
|
72
|
-
return cb(options.nPt);
|
|
73
|
-
}
|
|
74
|
-
const distance = ruler.distance(currentPosition.geometry.coordinates, ptsInRadius[i][options.k].coordinates);
|
|
75
|
-
if (distance < options.nPt.distance) {
|
|
76
|
-
options.nPt = ptsInRadius[i][options.k];
|
|
77
|
-
options.nPt.distance = distance;
|
|
78
|
-
}
|
|
79
|
-
// next step
|
|
80
|
-
options.k++;
|
|
81
|
-
innerPtsInRadiusIterator(i, options, cb);
|
|
82
|
-
};
|
|
83
|
-
const ptsInRadiusIterator = (i, cb) => {
|
|
84
|
-
// end of iteration
|
|
85
|
-
if (ptsInRadius.length === i) {
|
|
86
|
-
return cb();
|
|
87
|
-
}
|
|
88
|
-
const nPt = { distance: Infinity };
|
|
89
|
-
innerPtsInRadiusIterator(i, {
|
|
90
|
-
k: 0,
|
|
91
|
-
nPt,
|
|
92
|
-
}, (res) => {
|
|
93
|
-
// so now you have all possible nearest points on shape
|
|
94
|
-
// (could be more if shape line is overlaping itself)
|
|
95
|
-
closestPts.push(res);
|
|
96
|
-
// next step
|
|
97
|
-
ptsInRadiusIterator(i + 1, cb);
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
return new Promise((resolve) => {
|
|
101
|
-
ptsInRadiusIterator(0, () => {
|
|
102
|
-
resolve(closestPts);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
});
|
|
35
|
+
}
|
|
106
36
|
exports.default = PositionCalculator;
|
|
107
37
|
//# sourceMappingURL=PositionCalculator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PositionCalculator.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionCalculator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PositionCalculator.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionCalculator.ts"],"names":[],"mappings":";;AACA,+EAAoE;AACpE,wCAA2D;AAG3D,+EAA4E;AAE5E,MAAqB,kBAAkB;IAInC,YAAY,eAA2D;QAKvE,sFAAsF;QAC/E,iCAA4B,GAAG,CAClC,eAAoC,EACpC,gBAA+B,EACV,EAAE;YACvB,MAAM,oBAAoB,GAAG,IAAI,2CAAoB,CAAC,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YAC7F,OAAO,oBAAoB,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;QAC1E,CAAC,CAAC;QAEF,6EAA6E;QACtE,qBAAgB,GAAG,CAAC,WAAkC,EAAuB,EAAE;YAClF,IAAI,UAAU,GAAwB,EAAE,CAAC;YAEzC,KAAK,MAAM,WAAW,IAAI,WAAW,EAAE;gBACnC,IAAI,YAAY,GAA6B,IAAI,CAAC;gBAClD,IAAI,eAAe,GAAG,QAAQ,CAAC;gBAE/B,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE;oBAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CACnD,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,EACzC,KAAK,CAAC,WAAW,CACpB,CAAC;oBAEF,IAAI,QAAQ,GAAG,eAAe,EAAE;wBAC5B,YAAY,GAAG,KAAK,CAAC;wBACrB,eAAe,GAAG,QAAQ,CAAC;qBAC9B;iBACJ;gBAED,IAAI,YAAY,KAAK,IAAI,EAAE;oBACvB,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;iBACjC;aACJ;YAED,OAAO,UAAU,CAAC;QACtB,CAAC,CAAC;QAvCE,IAAI,CAAC,SAAS,GAAG,gBAAW,CAAC,OAAO,CAAwB,2CAAoB,CAAC,oBAAoB,CAAC,CAAC;QACvG,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IAC3C,CAAC;CAsCJ;AA7CD,qCA6CC"}
|