@tak-ps/node-cot 13.6.0 → 14.0.0

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.
@@ -0,0 +1,325 @@
1
+ import Err from '@openaddresses/batch-error';
2
+ import Ellipse from '@turf/ellipse';
3
+ import Truncate from '@turf/truncate';
4
+ import { destination } from '@turf/destination';
5
+ import Color from '../utils/color.js';
6
+ import JSONCoT from '../types/types.js';
7
+ import CoT from '../cot.js';
8
+ // GeoJSON Geospatial ops will truncate to the below
9
+ const COORDINATE_PRECISION = 6;
10
+ /**
11
+ * Return a GeoJSON Feature from an XML CoT message
12
+ */
13
+ export async function to_geojson(cot) {
14
+ const raw = JSON.parse(JSON.stringify(cot.raw));
15
+ if (!raw.event.detail)
16
+ raw.event.detail = {};
17
+ if (!raw.event.detail.contact)
18
+ raw.event.detail.contact = { _attributes: { callsign: 'UNKNOWN' } };
19
+ if (!raw.event.detail.contact._attributes)
20
+ raw.event.detail.contact._attributes = { callsign: 'UNKNOWN' };
21
+ const feat = {
22
+ id: raw.event._attributes.uid,
23
+ type: 'Feature',
24
+ properties: {
25
+ callsign: raw.event.detail.contact._attributes.callsign || 'UNKNOWN',
26
+ center: [Number(raw.event.point._attributes.lon), Number(raw.event.point._attributes.lat), Number(raw.event.point._attributes.hae)],
27
+ type: raw.event._attributes.type,
28
+ how: raw.event._attributes.how || '',
29
+ time: raw.event._attributes.time,
30
+ start: raw.event._attributes.start,
31
+ stale: raw.event._attributes.stale,
32
+ },
33
+ geometry: {
34
+ type: 'Point',
35
+ coordinates: [Number(raw.event.point._attributes.lon), Number(raw.event.point._attributes.lat), Number(raw.event.point._attributes.hae)]
36
+ }
37
+ };
38
+ const contact = JSON.parse(JSON.stringify(raw.event.detail.contact._attributes));
39
+ delete contact.callsign;
40
+ if (Object.keys(contact).length) {
41
+ feat.properties.contact = contact;
42
+ }
43
+ if (cot.creator()) {
44
+ feat.properties.creator = cot.creator();
45
+ }
46
+ if (raw.event.detail.remarks && raw.event.detail.remarks._text) {
47
+ feat.properties.remarks = raw.event.detail.remarks._text;
48
+ }
49
+ if (raw.event.detail.fileshare) {
50
+ feat.properties.fileshare = raw.event.detail.fileshare._attributes;
51
+ if (feat.properties.fileshare && typeof feat.properties.fileshare.sizeInBytes === 'string') {
52
+ feat.properties.fileshare.sizeInBytes = parseInt(feat.properties.fileshare.sizeInBytes);
53
+ }
54
+ }
55
+ if (raw.event.detail.__milsym) {
56
+ feat.properties.milsym = {
57
+ id: raw.event.detail.__milsym._attributes.id
58
+ };
59
+ }
60
+ if (raw.event.detail.sensor) {
61
+ feat.properties.sensor = raw.event.detail.sensor._attributes;
62
+ }
63
+ if (raw.event.detail.range) {
64
+ feat.properties.range = raw.event.detail.range._attributes.value;
65
+ }
66
+ if (raw.event.detail.bearing) {
67
+ feat.properties.bearing = raw.event.detail.bearing._attributes.value;
68
+ }
69
+ if (raw.event.detail.labels_on && raw.event.detail.labels_on._attributes && raw.event.detail.labels_on._attributes.value !== undefined) {
70
+ feat.properties.labels = raw.event.detail.labels_on._attributes.value;
71
+ }
72
+ if (raw.event.detail.__video && raw.event.detail.__video._attributes) {
73
+ feat.properties.video = raw.event.detail.__video._attributes;
74
+ if (raw.event.detail.__video.ConnectionEntry) {
75
+ feat.properties.video.connection = raw.event.detail.__video.ConnectionEntry._attributes;
76
+ }
77
+ }
78
+ if (raw.event.detail.__geofence) {
79
+ feat.properties.geofence = raw.event.detail.__geofence._attributes;
80
+ }
81
+ if (raw.event.detail.ackrequest) {
82
+ feat.properties.ackrequest = raw.event.detail.ackrequest._attributes;
83
+ }
84
+ if (raw.event.detail.attachment_list) {
85
+ feat.properties.attachments = JSON.parse(raw.event.detail.attachment_list._attributes.hashes);
86
+ }
87
+ if (raw.event.detail.link) {
88
+ if (!Array.isArray(raw.event.detail.link))
89
+ raw.event.detail.link = [raw.event.detail.link];
90
+ feat.properties.links = raw.event.detail.link.filter((link) => {
91
+ return !!link._attributes.url;
92
+ }).map((link) => {
93
+ return link._attributes;
94
+ });
95
+ if (!feat.properties.links || !feat.properties.links.length)
96
+ delete feat.properties.links;
97
+ }
98
+ if (raw.event.detail.archive) {
99
+ feat.properties.archived = true;
100
+ }
101
+ if (raw.event.detail.__chat) {
102
+ feat.properties.chat = {
103
+ ...raw.event.detail.__chat._attributes,
104
+ chatgrp: raw.event.detail.__chat.chatgrp
105
+ };
106
+ }
107
+ if (raw.event.detail.track && raw.event.detail.track._attributes) {
108
+ if (raw.event.detail.track._attributes.course)
109
+ feat.properties.course = Number(raw.event.detail.track._attributes.course);
110
+ if (raw.event.detail.track._attributes.slope)
111
+ feat.properties.slope = Number(raw.event.detail.track._attributes.slope);
112
+ if (raw.event.detail.track._attributes.course)
113
+ feat.properties.speed = Number(raw.event.detail.track._attributes.speed);
114
+ }
115
+ if (raw.event.detail.marti && raw.event.detail.marti.dest) {
116
+ if (!Array.isArray(raw.event.detail.marti.dest))
117
+ raw.event.detail.marti.dest = [raw.event.detail.marti.dest];
118
+ const dest = raw.event.detail.marti.dest.map((d) => {
119
+ return { ...d._attributes };
120
+ });
121
+ feat.properties.dest = dest.length === 1 ? dest[0] : dest;
122
+ }
123
+ if (raw.event.detail.usericon && raw.event.detail.usericon._attributes && raw.event.detail.usericon._attributes.iconsetpath) {
124
+ feat.properties.icon = raw.event.detail.usericon._attributes.iconsetpath;
125
+ }
126
+ if (raw.event.detail.uid && raw.event.detail.uid._attributes && raw.event.detail.uid._attributes.Droid) {
127
+ feat.properties.droid = raw.event.detail.uid._attributes.Droid;
128
+ }
129
+ if (raw.event.detail.takv && raw.event.detail.takv._attributes) {
130
+ feat.properties.takv = raw.event.detail.takv._attributes;
131
+ }
132
+ if (raw.event.detail.__group && raw.event.detail.__group._attributes) {
133
+ feat.properties.group = raw.event.detail.__group._attributes;
134
+ }
135
+ if (raw.event.detail['_flow-tags_'] && raw.event.detail['_flow-tags_']._attributes) {
136
+ feat.properties.flow = raw.event.detail['_flow-tags_']._attributes;
137
+ }
138
+ if (raw.event.detail.status && raw.event.detail.status._attributes) {
139
+ feat.properties.status = raw.event.detail.status._attributes;
140
+ }
141
+ if (raw.event.detail.mission && raw.event.detail.mission._attributes) {
142
+ const mission = {
143
+ ...raw.event.detail.mission._attributes
144
+ };
145
+ if (raw.event.detail.mission && raw.event.detail.mission.MissionChanges) {
146
+ const changes = Array.isArray(raw.event.detail.mission.MissionChanges)
147
+ ? raw.event.detail.mission.MissionChanges
148
+ : [raw.event.detail.mission.MissionChanges];
149
+ mission.missionChanges = [];
150
+ for (const change of changes) {
151
+ mission.missionChanges.push({
152
+ contentUid: change.MissionChange.contentUid._text,
153
+ creatorUid: change.MissionChange.creatorUid._text,
154
+ isFederatedChange: change.MissionChange.isFederatedChange._text,
155
+ missionName: change.MissionChange.missionName._text,
156
+ timestamp: change.MissionChange.timestamp._text,
157
+ type: change.MissionChange.type._text,
158
+ details: {
159
+ ...change.MissionChange.details._attributes,
160
+ ...change.MissionChange.details.location
161
+ ? change.MissionChange.details.location._attributes
162
+ : {}
163
+ }
164
+ });
165
+ }
166
+ }
167
+ if (raw.event.detail.mission && raw.event.detail.mission.missionLayer) {
168
+ const missionLayer = {};
169
+ if (raw.event.detail.mission.missionLayer.name && raw.event.detail.mission.missionLayer.name._text) {
170
+ missionLayer.name = raw.event.detail.mission.missionLayer.name._text;
171
+ }
172
+ if (raw.event.detail.mission.missionLayer.parentUid && raw.event.detail.mission.missionLayer.parentUid._text) {
173
+ missionLayer.parentUid = raw.event.detail.mission.missionLayer.parentUid._text;
174
+ }
175
+ if (raw.event.detail.mission.missionLayer.type && raw.event.detail.mission.missionLayer.type._text) {
176
+ missionLayer.type = raw.event.detail.mission.missionLayer.type._text;
177
+ }
178
+ if (raw.event.detail.mission.missionLayer.uid && raw.event.detail.mission.missionLayer.uid._text) {
179
+ missionLayer.uid = raw.event.detail.mission.missionLayer.uid._text;
180
+ }
181
+ mission.missionLayer = missionLayer;
182
+ }
183
+ feat.properties.mission = mission;
184
+ }
185
+ if (raw.event.detail.precisionlocation && raw.event.detail.precisionlocation._attributes) {
186
+ feat.properties.precisionlocation = raw.event.detail.precisionlocation._attributes;
187
+ }
188
+ if (raw.event.detail.strokeColor && raw.event.detail.strokeColor._attributes && raw.event.detail.strokeColor._attributes.value) {
189
+ const stroke = new Color(Number(raw.event.detail.strokeColor._attributes.value));
190
+ feat.properties.stroke = stroke.as_hex();
191
+ feat.properties['stroke-opacity'] = stroke.as_opacity() / 255;
192
+ }
193
+ if (raw.event.detail.strokeWeight && raw.event.detail.strokeWeight._attributes && raw.event.detail.strokeWeight._attributes.value) {
194
+ feat.properties['stroke-width'] = Number(raw.event.detail.strokeWeight._attributes.value);
195
+ }
196
+ if (raw.event.detail.strokeStyle && raw.event.detail.strokeStyle._attributes && raw.event.detail.strokeStyle._attributes.value) {
197
+ feat.properties['stroke-style'] = raw.event.detail.strokeStyle._attributes.value;
198
+ }
199
+ if (raw.event.detail.color) {
200
+ let color = null;
201
+ if (Array.isArray(raw.event.detail.color) && raw.event.detail.color.length > 1) {
202
+ color = raw.event.detail.color[0];
203
+ if (!color._attributes)
204
+ color._attributes = {};
205
+ for (let i = raw.event.detail.color.length - 1; i >= 1; i--) {
206
+ if (raw.event.detail.color[i]._attributes) {
207
+ Object.assign(color._attributes, raw.event.detail.color[i]._attributes);
208
+ }
209
+ }
210
+ }
211
+ else if (Array.isArray(raw.event.detail.color) && raw.event.detail.color.length === 1) {
212
+ color = raw.event.detail.color[0];
213
+ }
214
+ else if (!Array.isArray(raw.event.detail.color)) {
215
+ color = raw.event.detail.color;
216
+ }
217
+ if (color && color._attributes && color._attributes.argb) {
218
+ const parsedColor = new Color(Number(color._attributes.argb));
219
+ feat.properties['marker-color'] = parsedColor.as_hex();
220
+ feat.properties['marker-opacity'] = parsedColor.as_opacity() / 255;
221
+ }
222
+ }
223
+ // Line, Polygon style types
224
+ if (['u-d-f', 'u-d-r', 'b-m-r', 'u-rb-a'].includes(raw.event._attributes.type) && Array.isArray(raw.event.detail.link)) {
225
+ const coordinates = [];
226
+ for (const l of raw.event.detail.link) {
227
+ if (!l._attributes.point)
228
+ continue;
229
+ coordinates.push(l._attributes.point.split(',').map((p) => { return Number(p.trim()); }).splice(0, 2).reverse());
230
+ }
231
+ // Range & Bearing Line
232
+ if (raw.event._attributes.type === 'u-rb-a') {
233
+ const detail = cot.detail();
234
+ if (!detail.range)
235
+ throw new Error('Range value not provided');
236
+ if (!detail.bearing)
237
+ throw new Error('Bearing value not provided');
238
+ // TODO Support inclination
239
+ const dest = destination(cot.position(), detail.range._attributes.value / 1000, detail.bearing._attributes.value).geometry.coordinates;
240
+ feat.geometry = {
241
+ type: 'LineString',
242
+ coordinates: [cot.position(), dest]
243
+ };
244
+ }
245
+ else if (raw.event._attributes.type === 'u-d-r' || (coordinates[0][0] === coordinates[coordinates.length - 1][0] && coordinates[0][1] === coordinates[coordinates.length - 1][1])) {
246
+ if (raw.event._attributes.type === 'u-d-r') {
247
+ // CoT rectangles are only 4 points - GeoJSON needs to be closed
248
+ coordinates.push(coordinates[0]);
249
+ }
250
+ feat.geometry = {
251
+ type: 'Polygon',
252
+ coordinates: [coordinates]
253
+ };
254
+ if (raw.event.detail.fillColor && raw.event.detail.fillColor._attributes && raw.event.detail.fillColor._attributes.value) {
255
+ const fill = new Color(Number(raw.event.detail.fillColor._attributes.value));
256
+ feat.properties['fill-opacity'] = fill.as_opacity() / 255;
257
+ feat.properties['fill'] = fill.as_hex();
258
+ }
259
+ }
260
+ else {
261
+ feat.geometry = {
262
+ type: 'LineString',
263
+ coordinates
264
+ };
265
+ }
266
+ }
267
+ else if (raw.event._attributes.type.startsWith('u-d-c-c') || raw.event._attributes.type.startsWith('u-r-b-c-c')) {
268
+ if (!raw.event.detail.shape)
269
+ throw new Err(400, null, `${raw.event._attributes.type} (Circle) must define shape value`);
270
+ if (!raw.event.detail.shape.ellipse
271
+ || !raw.event.detail.shape.ellipse._attributes)
272
+ throw new Err(400, null, `${raw.event._attributes.type} (Circle) must define ellipse shape value`);
273
+ const ellipse = {
274
+ major: Number(raw.event.detail.shape.ellipse._attributes.major),
275
+ minor: Number(raw.event.detail.shape.ellipse._attributes.minor),
276
+ angle: Number(raw.event.detail.shape.ellipse._attributes.angle)
277
+ };
278
+ feat.geometry = Truncate(Ellipse(feat.geometry.coordinates, Number(ellipse.major) / 1000, Number(ellipse.minor) / 1000, {
279
+ angle: ellipse.angle
280
+ }), {
281
+ precision: COORDINATE_PRECISION,
282
+ mutate: true
283
+ }).geometry;
284
+ feat.properties.shape = {};
285
+ feat.properties.shape.ellipse = ellipse;
286
+ }
287
+ else if (raw.event._attributes.type.startsWith('b-m-p-s-p-i')) {
288
+ // TODO: Currently the "shape" tag is only parsed here - asking ARA for clarification if it is a general use tag
289
+ if (raw.event.detail.shape && raw.event.detail.shape.polyline && raw.event.detail.shape.polyline.vertex) {
290
+ const coordinates = [];
291
+ const vertices = Array.isArray(raw.event.detail.shape.polyline.vertex) ? raw.event.detail.shape.polyline.vertex : [raw.event.detail.shape.polyline.vertex];
292
+ for (const v of vertices) {
293
+ coordinates.push([Number(v._attributes.lon), Number(v._attributes.lat)]);
294
+ }
295
+ if (coordinates.length === 1) {
296
+ feat.geometry = { type: 'Point', coordinates: coordinates[0] };
297
+ }
298
+ else if (raw.event.detail.shape.polyline._attributes && raw.event.detail.shape.polyline._attributes.closed === true) {
299
+ coordinates.push(coordinates[0]);
300
+ feat.geometry = { type: 'Polygon', coordinates: [coordinates] };
301
+ }
302
+ else {
303
+ feat.geometry = { type: 'LineString', coordinates };
304
+ }
305
+ }
306
+ if (raw.event.detail.shape
307
+ && raw.event.detail.shape.polyline
308
+ && raw.event.detail.shape.polyline._attributes) {
309
+ if (raw.event.detail.shape.polyline._attributes.fillColor) {
310
+ const fill = new Color(Number(raw.event.detail.shape.polyline._attributes.fillColor));
311
+ feat.properties['fill-opacity'] = fill.as_opacity() / 255;
312
+ feat.properties['fill'] = fill.as_hex();
313
+ }
314
+ if (raw.event.detail.shape.polyline._attributes.color) {
315
+ const stroke = new Color(Number(raw.event.detail.shape.polyline._attributes.color));
316
+ feat.properties.stroke = stroke.as_hex();
317
+ feat.properties['stroke-opacity'] = stroke.as_opacity() / 255;
318
+ }
319
+ }
320
+ }
321
+ feat.properties.metadata = cot.metadata;
322
+ feat.path = cot.path;
323
+ return feat;
324
+ }
325
+ //# sourceMappingURL=to_geojson.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to_geojson.js","sourceRoot":"","sources":["../../../lib/parser/to_geojson.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAe7C,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,OAAO,MAAM,mBAAmB,CAAA;AACvC,OAAO,GAAG,MAAM,WAAW,CAAC;AAE5B,oDAAoD;AACpD,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAQ;IACrC,MAAM,GAAG,GAA2B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACxE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM;QAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;IAC7C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO;QAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,GAAG,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC;IACnG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW;QAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC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