@tak-ps/node-cot 12.17.1 → 12.18.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/lib/data-package.js +64 -16
  3. package/dist/lib/data-package.js.map +1 -1
  4. package/dist/lib/types/iconset.js +12 -4
  5. package/dist/lib/types/iconset.js.map +1 -1
  6. package/dist/lib/xml/basemap.js +1 -1
  7. package/dist/lib/xml/basemap.js.map +1 -1
  8. package/dist/lib/xml/iconset.js +29 -2
  9. package/dist/lib/xml/iconset.js.map +1 -1
  10. package/dist/package.json +1 -1
  11. package/dist/tsconfig.tsbuildinfo +1 -1
  12. package/lib/data-package.ts +70 -17
  13. package/lib/types/iconset.ts +14 -4
  14. package/lib/xml/basemap.ts +2 -2
  15. package/lib/xml/iconset.ts +36 -3
  16. package/lib/xml-document.ts +1 -1
  17. package/package.json +1 -1
  18. package/tsconfig.json +1 -0
  19. package/dist/test/basemaps.test.js +0 -16
  20. package/dist/test/basemaps.test.js.map +0 -1
  21. package/dist/test/chat.test.js +0 -97
  22. package/dist/test/chat.test.js.map +0 -1
  23. package/dist/test/cot-fileshare.test.js +0 -89
  24. package/dist/test/cot-fileshare.test.js.map +0 -1
  25. package/dist/test/cot-itak.test.js +0 -95
  26. package/dist/test/cot-itak.test.js.map +0 -1
  27. package/dist/test/cot-mma.test.js +0 -108
  28. package/dist/test/cot-mma.test.js.map +0 -1
  29. package/dist/test/cot-polyline.test.js +0 -98
  30. package/dist/test/cot-polyline.test.js.map +0 -1
  31. package/dist/test/cot-range-and-bearing.test.js +0 -98
  32. package/dist/test/cot-range-and-bearing.test.js.map +0 -1
  33. package/dist/test/cot-routes.test.js +0 -466
  34. package/dist/test/cot-routes.test.js.map +0 -1
  35. package/dist/test/cot-types.test.js +0 -7
  36. package/dist/test/cot-types.test.js.map +0 -1
  37. package/dist/test/cot-uas-tool.test.js +0 -286
  38. package/dist/test/cot-uas-tool.test.js.map +0 -1
  39. package/dist/test/cot-video.test.js +0 -196
  40. package/dist/test/cot-video.test.js.map +0 -1
  41. package/dist/test/cot_is.test.js +0 -353
  42. package/dist/test/cot_is.test.js.map +0 -1
  43. package/dist/test/data-package.test.js +0 -234
  44. package/dist/test/data-package.test.js.map +0 -1
  45. package/dist/test/diff.test.js +0 -73
  46. package/dist/test/diff.test.js.map +0 -1
  47. package/dist/test/flow-tags.test.js +0 -19
  48. package/dist/test/flow-tags.test.js.map +0 -1
  49. package/dist/test/force-delete.js +0 -46
  50. package/dist/test/force-delete.js.map +0 -1
  51. package/dist/test/from_geojson.test.js +0 -287
  52. package/dist/test/from_geojson.test.js.map +0 -1
  53. package/dist/test/newlines.test.js +0 -79
  54. package/dist/test/newlines.test.js.map +0 -1
  55. package/dist/test/reversal-geojson.test.js +0 -15
  56. package/dist/test/reversal-geojson.test.js.map +0 -1
  57. package/dist/test/reversal-proto.test.js +0 -54
  58. package/dist/test/reversal-proto.test.js.map +0 -1
  59. package/dist/test/stream.js +0 -10
  60. package/dist/test/stream.js.map +0 -1
  61. package/dist/test/taskings-mission.test.js +0 -140
  62. package/dist/test/taskings-mission.test.js.map +0 -1
  63. package/dist/test/util.test.js +0 -25
  64. package/dist/test/util.test.js.map +0 -1
  65. package/dist/test/validation.test.js +0 -13
  66. package/dist/test/validation.test.js.map +0 -1
  67. package/test/basemaps/Bing_Hybrid.xml +0 -12
  68. package/test/basemaps/Bing_Maps.xml +0 -10
  69. package/test/basemaps/USGSBasemap.xml +0 -10
  70. package/test/basemaps/USGSImageryOnly.xml +0 -10
  71. package/test/basemaps/USGSImageryTopo.xml +0 -10
  72. package/test/basemaps/USGSShadedRelief.xml +0 -10
  73. package/test/basemaps/opentopomap.xml +0 -10
  74. package/test/basemaps.test.ts +0 -19
  75. package/test/chat.test.ts +0 -103
  76. package/test/cot-fileshare.test.ts +0 -92
  77. package/test/cot-itak.test.ts +0 -100
  78. package/test/cot-mma.test.ts +0 -111
  79. package/test/cot-polyline.test.ts +0 -103
  80. package/test/cot-range-and-bearing.test.ts +0 -100
  81. package/test/cot-routes.test.ts +0 -468
  82. package/test/cot-types.test.ts +0 -8
  83. package/test/cot-uas-tool.test.ts +0 -295
  84. package/test/cot-video.test.ts +0 -204
  85. package/test/cot_is.test.ts +0 -431
  86. package/test/data-package.test.ts +0 -314
  87. package/test/diff.test.ts +0 -80
  88. package/test/fixtures/archived.geojson +0 -20
  89. package/test/fixtures/attachments.geojson +0 -20
  90. package/test/fixtures/basic.geojson +0 -19
  91. package/test/fixtures/circle.geojson +0 -30
  92. package/test/fixtures/color.geojson +0 -21
  93. package/test/fixtures/fileshare.geojson +0 -28
  94. package/test/fixtures/geofence.geojson +0 -25
  95. package/test/fixtures/hae.geojson +0 -19
  96. package/test/fixtures/icon.geojson +0 -20
  97. package/test/fixtures/linestring.geojson +0 -28
  98. package/test/fixtures/marti-mission.geojson +0 -22
  99. package/test/fixtures/metadata.geojson +0 -24
  100. package/test/fixtures/mission-layer.geojson +0 -31
  101. package/test/fixtures/mission.geojson +0 -25
  102. package/test/fixtures/polygon.geojson +0 -33
  103. package/test/fixtures/props.geojson +0 -22
  104. package/test/fixtures/sensor.geojson +0 -31
  105. package/test/fixtures/video-connection.geojson +0 -27
  106. package/test/fixtures/video.geojson +0 -24
  107. package/test/flow-tags.test.ts +0 -21
  108. package/test/force-delete.ts +0 -50
  109. package/test/from_geojson.test.ts +0 -323
  110. package/test/newlines.test.ts +0 -83
  111. package/test/packages/AttachmentInManifest.zip +0 -0
  112. package/test/packages/COMilePosts.zip +0 -0
  113. package/test/packages/CameraCOTs.zip +0 -0
  114. package/test/packages/QuickPic.zip +0 -0
  115. package/test/reversal-geojson.test.ts +0 -19
  116. package/test/reversal-proto.test.ts +0 -60
  117. package/test/stream.ts +0 -10
  118. package/test/taskings-mission.test.ts +0 -148
  119. package/test/util.test.ts +0 -34
  120. package/test/validation.test.ts +0 -13
@@ -1,295 +0,0 @@
1
- import test from 'tape';
2
- import CoT from '../index.js';
3
-
4
- test('Sensor2Polygon', (t) => {
5
- const cot = CoT.from_geojson({
6
- "id": "298DG19001V0GN",
7
- "path": "/",
8
- "type": "Feature",
9
- "properties": {
10
- "callsign": "UAS-CO-DFPC-Schmidt",
11
- "center": [
12
- -108.04641043504375,
13
- 39.45429166060765,
14
- 1748.037
15
- ],
16
- "type": "a-f-A-M-H-Q",
17
- "how": "m-g",
18
- "time": "2024-11-21T16:07:08Z",
19
- "start": "2024-11-21T16:07:07Z",
20
- "stale": "2024-11-21T16:07:11Z",
21
- "sensor": {
22
- "elevation": 18.5,
23
- "vfov": 41.6,
24
- "north": 187.9000000954,
25
- "roll": 0,
26
- "range": 100,
27
- "azimuth": 7,
28
- "model": "Mavic 2 Enterprise Dual-Visual",
29
- "fov": 66.9,
30
- "type": "r-e",
31
- "version": "0.6"
32
- },
33
- "video": {
34
- "sensor": "UAS-CO-DFPC-Schmidt",
35
- "spi": "UAS-CO-DFPC-Schmidt.SPI1",
36
- "url": "rtsp://video.cotak.gov:8554/771c9e10-2ecb-4770-b6f2-b9669914d07e?tcp"
37
- },
38
- "course": 7.9,
39
- "slope": 0,
40
- "speed": 0,
41
- "flow": {
42
- "TAK-Server-e87a0e02420b44a08f6032bcf1877745": "2024-11-21T16:07:08Z"
43
- },
44
- "metadata": {},
45
- "remarks": "None",
46
- "icon": "a-f-A-M-H-Q"
47
- },
48
- "geometry": {
49
- "type": "Point",
50
- "coordinates": [
51
- -108.04641043504375,
52
- 39.45429166060765,
53
- 1748.037
54
- ]
55
- }
56
- });
57
-
58
- if (!cot.raw.event.detail) {
59
- t.fail('No Detail Section')
60
- } else {
61
- t.deepEquals(cot.sensor(), {
62
- type: 'Polygon',
63
- coordinates: [[
64
- [ -108.04641043504375, 39.45429166060765 ],
65
- [ -108.04626848908208, 39.455184277487476 ],
66
- [ -108.04624742260683, 39.455182129471105 ], [ -108.04622641039066, 39.4551796850677 ],
67
- [ -108.04620545942751, 39.45517694509086 ], [ -108.04618457669096, 39.45517391045262 ], [ -108.0461637691319, 39.45517058216307 ], [ -108.0461430436761, 39.45516696133 ],
68
- [ -108.0461224072221, 39.45516304915865 ],
69
- [ -108.04610186663874, 39.45515884695118 ],
70
- [ -108.04608142876303, 39.4551543561063 ],
71
- [ -108.0460611003977, 39.45514957811881 ],
72
- [ -108.04604088830905, 39.45514451457907 ],
73
- [ -108.0460207992247, 39.45513916717246 ], [ -108.04600083983134, 39.45513353767891 ], [ -108.04598101677242, 39.45512762797219 ], [ -108.04596133664603, 39.455121440019354 ], [ -108.04594180600273, 39.455114975880086 ], [ -108.04592243134323, 39.455108237705964 ], [ -108.04590321911644, 39.45510122773981 ], [ -108.04588417571705, 39.45509394831491 ], [ -108.04586530748368, 39.4550864018542 ], [ -108.04584662069652, 39.455078590869554 ], [ -108.04582812157547, 39.45507051796086 ], [ -108.04580981627791, 39.45506218581518 ], [ -108.04579171089668, 39.45505359720588 ], [ -108.0457738114581, 39.455044754991704 ], [ -108.04575612391994, 39.45503566211575 ], [ -108.04573865416941, 39.455026321604606 ], [ -108.04572140802122, 39.455016736567266 ], [ -108.04570439121566, 39.455006910194115 ], [ -108.04568760941667, 39.454996845755836 ], [ -108.04567106821001, 39.45498654660239 ], [ -108.04565477310123, 39.45497601616186 ], [ -108.04563872951411, 39.454965257939264 ], [ -108.04562294278857, 39.454954275515504 ], [ -108.04560741817915, 39.45494307254605 ], [ -108.04559216085299, 39.454931652759804 ], [ -108.04557717588841, 39.454920019957825 ], [ -108.04556246827298, 39.45490817801209 ], [ -108.04554804290194, 39.45489613086416 ], [ -108.04553390457663, 39.4548838825239 ], [ -108.0455200580028, 39.45487143706817 ], [ -108.04550650778911, 39.45485879863942 ], [ -108.04549325844555, 39.454845971444286 ], [ -108.04548031438193, 39.454832959752295 ], [ -108.04546767990654, 39.45481976789435 ], [ -108.04545535922452, 39.45480640026133 ], [ -108.04544335643659, 39.45479286130261 ], [ -108.04543167553766, 39.454779155524584 ], [ -108.04542032041547, 39.45476528748918 ], [ -108.04540929484936, 39.454751261812326 ], [ -108.04539860250894, 39.454737083162414 ], [ -108.04538824695291, 39.454722756258754 ], [ -108.04537823162786, 39.45470828586999 ], [ -108.04536855986714, 39.45469367681254 ], [ -108.04535923488973, 39.454678933948955 ], [ -108.04535025979919, 39.45466406218633 ], [ -108.0453416375826, 39.454649066474644 ], [ -108.04533337110959, 39.45463395180517 ], [ -108.04532546313139, 39.45461872320871 ], [ -108.04531791627988, 39.45460338575404 ], [ -108.04531073306677, 39.45458794454614 ], [ -108.04530391588266, 39.45457240472452 ], [ -108.0452974669964, 39.45455677146151 ], [ -108.04529138855419, 39.45454104996055 ], [ -108.04641043504375, 39.45429166060765 ] ] ]
74
- });
75
- }
76
-
77
- t.end();
78
- });
79
-
80
- test('Decode iTAK COT UAS Message', (t) => {
81
- const packet = '<event version="2" uid="2983J8B001V013" type="a-f-A-M-H-Q" time="2024-04-24T16:37:38.002Z" start="2024-04-24T16:37:38.002Z" stale="2024-04-24T16:37:41.502Z" > <detail> <_uastool extendedCot="" activeRoute="" > </_uastool> <track course="140.8" slope="0" speed="0" > </track> <sensor elevation="0" vfov="41.6" north="320.8000030518" roll="0" range="300" azimuth="140" model="Mavic 2 Enterprise Dual-Visual" fov="66.9" type="r-e" version="0.6" > </sensor> <spatial> <attitude roll="-0.2" pitch="3.8" yaw="140.8" > </attitude> <spin roll="0" pitch="0.0896860987" yaw="0" > </spin> </spatial> <vehicle goHomeBatteryPercent="15" hal="0" flightTimeRemaining="0" typeTag="_DJI_" batteryRemainingCapacity="2216" isFlying="" flightTime="0" type="DJI" batteryMaxCapacity="3672" voltage="15.71" > </vehicle> <_radio rssi="100" gps="" > </_radio> <waypointCollection> </waypointCollection> <_route sender="ANDROID-c96c2c467371208c" > </_route> <commandedData climbRate="0" > </commandedData> <__video sensor="UAS-CO DFPC Lawrence" spi="UAS-CO DFPC Lawrence.SPI1" url="rtsp://18.254.132.96:8554/money" > </__video> <link uid="ANDROID-c96c2c467371208c" type="a-f-G-U-C" relation="p-p" > </link> <_flow-tags_ TAK-Server-e87a0e02420b44a08f6032bcf1877745="2024-04-24T16:37:38Z" > </_flow-tags_> </detail> <point lat="39.1" lon="-108.6" ce="0" hae="1381.333" le="0" > </point></event>';
82
-
83
- const cot = new CoT(packet);
84
-
85
- if (!cot.raw.event.detail) {
86
- t.fail('No Detail Section')
87
- } else {
88
- t.ok(cot.raw.event.detail['_flow-tags_']);
89
- delete cot.raw.event.detail['_flow-tags_'];
90
-
91
- t.deepEquals(cot.raw, {
92
- "event": {
93
- "_attributes": {
94
- "version": "2",
95
- "uid": "2983J8B001V013",
96
- "type": "a-f-A-M-H-Q",
97
- "time": "2024-04-24T16:37:38.002Z",
98
- "start": "2024-04-24T16:37:38.002Z",
99
- "stale": "2024-04-24T16:37:41.502Z"
100
- },
101
- "detail": {
102
- "_uastool": {
103
- "_attributes": {
104
- "extendedCot": "",
105
- "activeRoute": ""
106
- }
107
- },
108
- "track": {
109
- "_attributes": {
110
- "course": "140.8",
111
- "slope": "0",
112
- "speed": "0"
113
- }
114
- },
115
- "sensor": {
116
- "_attributes": {
117
- "elevation": 0,
118
- "vfov": 41.6,
119
- "north": 320.8000030518,
120
- "roll": 0,
121
- "range": 300,
122
- "azimuth": 140,
123
- "model": "Mavic 2 Enterprise Dual-Visual",
124
- "fov": 66.9,
125
- "type": "r-e",
126
- "version": "0.6"
127
- }
128
- },
129
- "spatial": {
130
- "attitude": {
131
- "_attributes": {
132
- "roll": "-0.2",
133
- "pitch": "3.8",
134
- "yaw": "140.8"
135
- }
136
- },
137
- "spin": {
138
- "_attributes": {
139
- "roll": "0",
140
- "pitch": "0.0896860987",
141
- "yaw": "0"
142
- }
143
- }
144
- },
145
- "vehicle": {
146
- "_attributes": {
147
- "goHomeBatteryPercent": "15",
148
- "hal": "0",
149
- "flightTimeRemaining": "0",
150
- "typeTag": "_DJI_",
151
- "batteryRemainingCapacity": "2216",
152
- "isFlying": "",
153
- "flightTime": "0",
154
- "type": "DJI",
155
- "batteryMaxCapacity": "3672",
156
- "voltage": "15.71"
157
- }
158
- },
159
- "_radio": {
160
- "_attributes": {
161
- "rssi": "100",
162
- "gps": ""
163
- }
164
- },
165
- "waypointCollection": {},
166
- "_route": {
167
- "_attributes": {
168
- "sender": "ANDROID-c96c2c467371208c"
169
- }
170
- },
171
- "commandedData": {
172
- "_attributes": {
173
- "climbRate": "0"
174
- }
175
- },
176
- "__video": {
177
- "_attributes": {
178
- "sensor": "UAS-CO DFPC Lawrence",
179
- "spi": "UAS-CO DFPC Lawrence.SPI1",
180
- "url": "rtsp://18.254.132.96:8554/money"
181
- }
182
- },
183
- "link": {
184
- "_attributes": {
185
- "uid": "ANDROID-c96c2c467371208c",
186
- "type": "a-f-G-U-C",
187
- "relation": "p-p"
188
- }
189
- }
190
- },
191
- "point": {
192
- "_attributes": {
193
- "lat": "39.1",
194
- "lon": "-108.6",
195
- "ce": "0",
196
- "hae": "1381.333",
197
- "le": "0"
198
- }
199
- }
200
- }
201
- });
202
-
203
- t.deepEquals(cot.to_geojson(), {
204
- id: '2983J8B001V013',
205
- type: 'Feature',
206
- path: '/',
207
- properties: {
208
- callsign: 'UNKNOWN',
209
- center: [ -108.6, 39.1, 1381.333 ],
210
- type: 'a-f-A-M-H-Q',
211
- how: '',
212
- time: '2024-04-24T16:37:38.002Z',
213
- start: '2024-04-24T16:37:38.002Z',
214
- stale: '2024-04-24T16:37:41.502Z',
215
- video: {
216
- sensor: 'UAS-CO DFPC Lawrence',
217
- spi: 'UAS-CO DFPC Lawrence.SPI1',
218
- url: 'rtsp://18.254.132.96:8554/money'
219
- },
220
- sensor: {
221
- elevation: 0,
222
- vfov: 41.6,
223
- north: 320.8000030518,
224
- roll: 0,
225
- range: 300,
226
- azimuth: 140,
227
- model: 'Mavic 2 Enterprise Dual-Visual',
228
- fov: 66.9,
229
- type: 'r-e',
230
- version: '0.6'
231
- },
232
- course: 140.8,
233
- slope: 0,
234
- speed: 0,
235
- metadata: {}
236
- },
237
- geometry: {
238
- type: 'Point',
239
- coordinates: [ -108.6, 39.1, 1381.333 ]
240
- }
241
- });
242
- }
243
-
244
- t.end();
245
- });
246
-
247
- test('Decode iTAK COT UAS Message 2', (t) => {
248
- const packet = '<event version="2.0" uid="1581F5BKB244G00F011K" type="a-f-A-M-H-Q" how="m-g" time="2024-09-18T22:09:39Z" start="2024-09-18T22:09:39Z" stale="2024-09-18T22:09:42Z" access="Undefined"><point lat="0.0" lon="0.0" hae="-4919.1" ce="0.0" le="0.0"/><detail><contact callsign="UAS-Phoenix 2"/><_uastool extendedCot="true" activeRoute="false"/><track course="-108.90" slope="0.0" speed="0.0"/><sensor elevation="0.0" vfov="47.1000000000" north="431.1000000000" roll="0.0" range="300" azimuth="251.1000000000" model="M30T" fov="75.5000000000" type="r-e" version="0.6"/><spatial><attitude roll="0.2000000000" pitch="-4.2000000000" yaw="-108.9000000000"/><spin roll="0.0" pitch="0.0" yaw="0.0"/></spatial><vehicle goHomeBatteryPercent="20" hal="0.0" flightTimeRemaining="0" typeTag="_DJIV5_" batteryRemainingCapacity="4871" isFlying="false" flightTime="0" type="DJIV5" batteryMaxCapacity="5838" voltage="24.79"/><_radio rssi="100" gps="true"/><waypointCollection/><_route sender="ANDROID-c283321be77c8ec9"/><commandedData climbRate="0.0"/><__video/><link uid="ANDROID-c283321be77c8ec9" type="a-f-G-U-C" relation="p-p"/><_flow-tags_ TAK-Server-e87a0e02420b44a08f6032bcf1877745="2024-09-18T22:09:39Z"/></detail></event>';
249
-
250
- const cot = new CoT(packet);
251
-
252
- if (!cot.raw.event.detail) {
253
- t.fail('No Detail Section')
254
- } else {
255
- t.ok(cot.raw.event.detail['_flow-tags_']);
256
- delete cot.raw.event.detail['_flow-tags_'];
257
-
258
- t.deepEquals(cot.to_geojson(), {
259
- id: '1581F5BKB244G00F011K',
260
- type: 'Feature',
261
- path: '/',
262
- properties: {
263
- callsign: 'UAS-Phoenix 2',
264
- center: [ 0, 0, -4919.1 ],
265
- type: 'a-f-A-M-H-Q',
266
- how: 'm-g',
267
- time: '2024-09-18T22:09:39Z',
268
- start: '2024-09-18T22:09:39Z',
269
- stale: '2024-09-18T22:09:42Z',
270
- sensor: {
271
- elevation: 0.0,
272
- vfov: 47.1000000000,
273
- north: 431.1000000000,
274
- roll: 0.0,
275
- range: 300,
276
- azimuth: 251.1000000000,
277
- fov: 75.5000000000,
278
- model: 'M30T',
279
- type: 'r-e',
280
- version: '0.6'
281
- },
282
- course: -108.9,
283
- slope: 0,
284
- speed: 0,
285
- metadata: {}
286
- },
287
- geometry: {
288
- type: 'Point',
289
- coordinates: [ 0, 0, -4919.1 ]
290
- }
291
- });
292
- }
293
-
294
- t.end();
295
- });
@@ -1,204 +0,0 @@
1
- import test from 'tape';
2
- import CoT from '../index.js';
3
-
4
- test('CoT.addVideo', (t) => {
5
- const cot = new CoT(`<event version='2.0' uid='0ed16b9e-a0c8-480f-8860-284b9afb2b1d' type='b-m-p-s-p-loc' time='2023-11-15T20:48:16.097Z' start='2023-11-15T20:48:16.097Z' stale='2024-11-14T20:48:16.097Z' how='h-g-i-g-o' access='Undefined'><point lat='38.2089117' lon='-104.6282182' hae='1455.285' ce='9999999.0' le='9999999.0' /></event>`);
6
-
7
- cot.addVideo({ uid: '123', url: 'https://publicstreamer3.cotrip.org/rtplive/123/playlist.m3u8' })
8
-
9
- if (!cot.raw.event.detail) {
10
- throw new Error('Detail Object must be populated');
11
- }
12
-
13
- t.ok(cot.raw.event.detail['_flow-tags_']);
14
- delete cot.raw.event.detail['_flow-tags_'];
15
-
16
- t.deepEquals(cot.raw, {
17
- event: {
18
- _attributes: {
19
- version: '2.0',
20
- uid: '0ed16b9e-a0c8-480f-8860-284b9afb2b1d',
21
- type: 'b-m-p-s-p-loc',
22
- time: '2023-11-15T20:48:16.097Z',
23
- start: '2023-11-15T20:48:16.097Z',
24
- stale: '2024-11-14T20:48:16.097Z',
25
- how: 'h-g-i-g-o',
26
- access: 'Undefined'
27
- },
28
- point: { _attributes: { lat: '38.2089117', lon: '-104.6282182', hae: '1455.285', ce: '9999999.0', le: '9999999.0' } },
29
- detail: {
30
- __video: {
31
- _attributes: {
32
- url: 'https://publicstreamer3.cotrip.org/rtplive/123/playlist.m3u8',
33
- uid: '123'
34
- },
35
- ConnectionEntry: {
36
- _attributes: {
37
- uid: '123',
38
- networkTimeout: 12000,
39
- path: '',
40
- protocol: 'raw',
41
- bufferTime: -1,
42
- address: 'https://publicstreamer3.cotrip.org/rtplive/123/playlist.m3u8',
43
- port: -1,
44
- roverPort: -1,
45
- rtspReliable: 0,
46
- ignoreEmbeddedKLV: false,
47
- alias: 'UNKNOWN'
48
- }
49
- }
50
- }
51
- }
52
- }
53
- });
54
-
55
- t.end();
56
- });
57
-
58
- test('Decode MultiMissionAircraft CoTs', (t) => {
59
- const cot = new CoT(`<event version='2.0' uid='0ed16b9e-a0c8-480f-8860-284b9afb2b1d' type='b-m-p-s-p-loc' time='2023-11-15T20:48:16.097Z' start='2023-11-15T20:48:16.097Z' stale='2024-11-14T20:48:16.097Z' how='h-g-i-g-o' access='Undefined'><point lat='38.2089117' lon='-104.6282182' hae='1455.285' ce='9999999.0' le='9999999.0' /><detail><status readiness='true'/><archive/><__video uid='05bf6c59-c7ea-465f-8337-da16ddcc82d4' url='https://publicstreamer3.cotrip.org/rtplive/123/playlist.m3u8'><ConnectionEntry networkTimeout='12000' uid='05bf6c59-c7ea-465f-8337-da16ddcc82d4' path='' protocol='raw' bufferTime='-1' address='https://publicstreamer3.cotrip.org/rtplive/123/playlist.m3u8' port='-1' roverPort='-1' rtspReliable='0' ignoreEmbeddedKLV='false' alias='I-25 .8 mi S CO-45'/></__video><color argb='-1'/><link uid='ANDROID-94e13cc4880cbcce' production_time='2022-01-31T17:35:49.565Z' type='a-f-G-U-C' parent_callsign='CO-DFPC-54-Schmidt' relation='p-p'/><sensor vfov='45' elevation='0' fovBlue='1.0' fovRed='1.0' strokeWeight='0.0' roll='0' range='100' azimuth='270' rangeLineStrokeWeight='0.0' fov='45' hideFov='true' rangeLineStrokeColor='-3355444' fovGreen='1.0' displayMagneticReference='0' strokeColor='-16777216' rangeLines='100' fovAlpha='0.2980392156862745'/><archive/><contact callsign='I-25 .8 mi S CO-45'/><remarks></remarks><precisionlocation altsrc='DTED2'/></detail></event>`);
60
- if (!cot.raw.event.detail) {
61
- t.fail('No Detail Section')
62
- } else {
63
- t.ok(cot.raw.event.detail['_flow-tags_']);
64
- delete cot.raw.event.detail['_flow-tags_'];
65
-
66
- t.deepEquals({
67
- event: {
68
- _attributes: {
69
- version: '2.0',
70
- uid: '0ed16b9e-a0c8-480f-8860-284b9afb2b1d',
71
- type: 'b-m-p-s-p-loc',
72
- time: '2023-11-15T20:48:16.097Z',
73
- start: '2023-11-15T20:48:16.097Z',
74
- stale: '2024-11-14T20:48:16.097Z',
75
- how: 'h-g-i-g-o',
76
- access: 'Undefined'
77
- },
78
- point: { _attributes: { lat: '38.2089117', lon: '-104.6282182', hae: '1455.285', ce: '9999999.0', le: '9999999.0' } },
79
- detail: {
80
- status: { _attributes: { readiness: 'true' } },
81
- archive: [ {}, {} ],
82
- __video: {
83
- _attributes: {
84
- uid: '05bf6c59-c7ea-465f-8337-da16ddcc82d4',
85
- url: 'https://publicstreamer3.cotrip.org/rtplive/123/playlist.m3u8'
86
- },
87
- ConnectionEntry: {
88
- _attributes: {
89
- networkTimeout: 12000,
90
- uid: '05bf6c59-c7ea-465f-8337-da16ddcc82d4',
91
- path: '',
92
- protocol: 'raw',
93
- bufferTime: -1,
94
- address: 'https://publicstreamer3.cotrip.org/rtplive/123/playlist.m3u8',
95
- port: -1,
96
- roverPort: -1,
97
- rtspReliable: 0,
98
- ignoreEmbeddedKLV: false,
99
- alias: 'I-25 .8 mi S CO-45'
100
- }
101
- },
102
- },
103
- color: { _attributes: { argb: '-1' } },
104
- link: {
105
- _attributes: {
106
- uid: 'ANDROID-94e13cc4880cbcce',
107
- production_time: '2022-01-31T17:35:49.565Z',
108
- type: 'a-f-G-U-C',
109
- parent_callsign: 'CO-DFPC-54-Schmidt',
110
- relation: 'p-p'
111
- },
112
- },
113
- sensor: {
114
- _attributes: {
115
- vfov: 45,
116
- elevation: 0,
117
- fovBlue: 1.0,
118
- fovRed: 1.0,
119
- strokeWeight: 0.0,
120
- roll: 0,
121
- range: 100,
122
- azimuth: 270,
123
- rangeLineStrokeWeight: 0.0,
124
- fov: 45,
125
- hideFov: true,
126
- rangeLineStrokeColor: -3355444,
127
- fovGreen: 1.0,
128
- displayMagneticReference: 0,
129
- strokeColor: -16777216,
130
- rangeLines: 100,
131
- fovAlpha: 0.2980392156862745
132
- }
133
- },
134
- contact: { _attributes: { callsign: 'I-25 .8 mi S CO-45' } },
135
- remarks: {},
136
- precisionlocation: { _attributes: { altsrc: 'DTED2' } }
137
- }
138
- },
139
- }, cot.raw);
140
-
141
- t.deepEquals({
142
- id: '0ed16b9e-a0c8-480f-8860-284b9afb2b1d',
143
- type: 'Feature',
144
- path: '/',
145
- properties: {
146
- callsign: 'I-25 .8 mi S CO-45',
147
- center: [ -104.6282182, 38.2089117, 1455.285 ],
148
- type: 'b-m-p-s-p-loc',
149
- how: 'h-g-i-g-o',
150
- time: '2023-11-15T20:48:16.097Z',
151
- start: '2023-11-15T20:48:16.097Z',
152
- stale: '2024-11-14T20:48:16.097Z',
153
- sensor: {
154
- vfov: 45,
155
- elevation: 0,
156
- fovBlue: 1.0,
157
- fovRed: 1.0,
158
- strokeWeight: 0.0,
159
- roll: 0,
160
- range: 100,
161
- azimuth: 270,
162
- rangeLineStrokeWeight: 0.0,
163
- fov: 45,
164
- hideFov: true,
165
- rangeLineStrokeColor: -3355444,
166
- fovGreen: 1.0,
167
- displayMagneticReference: 0,
168
- strokeColor: -16777216,
169
- rangeLines: 100,
170
- fovAlpha: 0.2980392156862745
171
- },
172
- video: {
173
- uid: '05bf6c59-c7ea-465f-8337-da16ddcc82d4',
174
- url: 'https://publicstreamer3.cotrip.org/rtplive/123/playlist.m3u8',
175
- connection: {
176
- "networkTimeout": 12000,
177
- "uid": "05bf6c59-c7ea-465f-8337-da16ddcc82d4",
178
- "path": "",
179
- "protocol": "raw",
180
- "bufferTime": -1,
181
- "address": "https://publicstreamer3.cotrip.org/rtplive/123/playlist.m3u8",
182
- "port": -1,
183
- "roverPort": -1,
184
- "rtspReliable": 0,
185
- "ignoreEmbeddedKLV": false,
186
- "alias": "I-25 .8 mi S CO-45"
187
- }
188
- },
189
- archived: true,
190
- status: { readiness: 'true' },
191
- precisionlocation: { altsrc: 'DTED2' },
192
- 'marker-color': '#FFFFFF',
193
- 'marker-opacity': 1,
194
- metadata: {}
195
- },
196
- geometry: {
197
- type: 'Point',
198
- coordinates: [ -104.6282182, 38.2089117, 1455.285 ]
199
- }
200
- }, cot.to_geojson());
201
- }
202
-
203
- t.end();
204
- });