deeptwins-engine-3d 0.1.44 → 0.1.45
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/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +4 -3
- package/dist/esm/lowAltitude/FlightRiskEvaluation.d.ts +26 -0
- package/dist/esm/lowAltitude/FlightRiskEvaluation.js +552 -383
- package/dist/esm/videoFusion/BaseVideo.js +1 -3
- package/dist/esm/visualization/PointCluster.js +40 -13
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +1 -1
|
@@ -1,383 +1,552 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
//
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
//
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
//
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
//
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
//
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
//
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
//
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
//
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
//
|
|
323
|
-
//
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
//
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
//
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
//
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
//
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
1
|
+
var _excluded = ["bounds", "alt"];
|
|
2
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
13
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
16
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
19
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
20
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
25
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
|
+
import { flatten, getCoords } from '@turf/turf';
|
|
27
|
+
import * as Cesium from 'deeptwins-cesium';
|
|
28
|
+
import { merge } from 'lodash';
|
|
29
|
+
import { DEFAULT_GRID_VT_OPTIONS, LAYER_EVENT_TYPE } from "../constant";
|
|
30
|
+
import BaseSource from "../graphicLayer/BaseSource";
|
|
31
|
+
import { ShapeSection, translateSource } from "../tool/common";
|
|
32
|
+
import fetch from "../tool/fetch";
|
|
33
|
+
import * as utils from "../tool/utils";
|
|
34
|
+
var API_HOST = 'https://els-yunjing.amap.com';
|
|
35
|
+
var API_KEY = 'd1dc38f19b7bfc453e870a80be359cd5';
|
|
36
|
+
// 接口定义 - 明确各接口职责
|
|
37
|
+
var POINT_EVALUATION_URL = "".concat(API_HOST, "/data/risk/evaluation/point?key=").concat(API_KEY); // 风险点评估接口 - 用于创建风险点标记
|
|
38
|
+
var SEGMENT_EVALUATION_URL = "".concat(API_HOST, "/data/risk/evaluation/segment?key=").concat(API_KEY); // 航段评估接口 - 用于管道颜色和绘制
|
|
39
|
+
var ROUTE_EVALUATION_URL = "".concat(API_HOST, "/data/risk/evaluation/route?key=").concat(API_KEY); // 航线评估接口 - 用于右侧面板数据
|
|
40
|
+
var GRID_RENDER_URL = "".concat(API_HOST, "/data/grid/render?key=").concat(API_KEY); // 网格渲染接口 - 用于航迹点网格
|
|
41
|
+
|
|
42
|
+
var TYPE_COLOR_MAP = {
|
|
43
|
+
START: '#00ff00',
|
|
44
|
+
END: '#ff0000'
|
|
45
|
+
}; // 点位颜色
|
|
46
|
+
var TYPE_LABEL_MAP = {
|
|
47
|
+
START: '起点',
|
|
48
|
+
END: '终点'
|
|
49
|
+
}; // 点位名称
|
|
50
|
+
|
|
51
|
+
// 航线风险评估
|
|
52
|
+
var FlightRiskEvaluation = /*#__PURE__*/function () {
|
|
53
|
+
function FlightRiskEvaluation(map) {
|
|
54
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
55
|
+
_classCallCheck(this, FlightRiskEvaluation);
|
|
56
|
+
_defineProperty(this, "_mapContext", void 0);
|
|
57
|
+
_defineProperty(this, "isDestroyed", false);
|
|
58
|
+
_defineProperty(this, "options", {});
|
|
59
|
+
// 路线数据
|
|
60
|
+
_defineProperty(this, "routeSource", null);
|
|
61
|
+
// 路线成果数据
|
|
62
|
+
_defineProperty(this, "routeResultSource", null);
|
|
63
|
+
// 路线点位
|
|
64
|
+
_defineProperty(this, "routePointsLayer", null);
|
|
65
|
+
// 路线点位文字
|
|
66
|
+
_defineProperty(this, "routePointsLabelLayer", null);
|
|
67
|
+
// 规划管道
|
|
68
|
+
_defineProperty(this, "routePipelineLayer", null);
|
|
69
|
+
// 风险点
|
|
70
|
+
_defineProperty(this, "riskPointsLayer", null);
|
|
71
|
+
// 风险点文字
|
|
72
|
+
_defineProperty(this, "riskPointsLabelLayer", null);
|
|
73
|
+
// 网格
|
|
74
|
+
_defineProperty(this, "gridsLayer", null);
|
|
75
|
+
this._mapContext = map._mapContext;
|
|
76
|
+
this.options = merge(DEFAULT_GRID_VT_OPTIONS(), options);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 是否能进行操作
|
|
80
|
+
_createClass(FlightRiskEvaluation, [{
|
|
81
|
+
key: "_canOperate",
|
|
82
|
+
value: function _canOperate() {
|
|
83
|
+
if (this.isDestroyed) {
|
|
84
|
+
utils.error('SubmergenceAnalysis实例已销毁');
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
key: "getMap",
|
|
91
|
+
value: function getMap() {
|
|
92
|
+
return this._mapContext && this._mapContext.getMap();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 开始评估
|
|
96
|
+
}, {
|
|
97
|
+
key: "start",
|
|
98
|
+
value: function () {
|
|
99
|
+
var _start = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
100
|
+
var geoJson,
|
|
101
|
+
translatedSource,
|
|
102
|
+
points,
|
|
103
|
+
_yield$Promise$all,
|
|
104
|
+
_yield$Promise$all2,
|
|
105
|
+
pointEvaluationData,
|
|
106
|
+
segmentEvaluationData,
|
|
107
|
+
routeEvaluationData,
|
|
108
|
+
gridData,
|
|
109
|
+
_args = arguments;
|
|
110
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
111
|
+
while (1) switch (_context.prev = _context.next) {
|
|
112
|
+
case 0:
|
|
113
|
+
geoJson = _args.length > 0 && _args[0] !== undefined ? _args[0] : {
|
|
114
|
+
type: 'Feature',
|
|
115
|
+
geometry: {
|
|
116
|
+
type: 'LineString',
|
|
117
|
+
coordinates: [[114.269292, 22.692453, 95.75], [114.26916666666668, 22.693055555555556, 95.75], [114.27083333333334, 22.69472222222222, 95.75], [114.2713888888889, 22.69527777777778, 118.73], [114.27861111111112, 22.7025, 118.73], [114.28861111111111, 22.7025, 126.39], [114.28972222222222, 22.703611111111112, 118.73], [114.29583333333333, 22.703611111111112, 118.73], [114.302994, 22.707242, 80], [114.292009, 22.72269, 80], [114.27916666666667, 22.733055555555556, 80.43], [114.27665, 22.73299, 80]]
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
if (this._canOperate()) {
|
|
121
|
+
_context.next = 3;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
return _context.abrupt("return");
|
|
125
|
+
case 3:
|
|
126
|
+
translatedSource = translateSource(geoJson);
|
|
127
|
+
this.routeSource = flatten(translatedSource);
|
|
128
|
+
points = [];
|
|
129
|
+
this.routeSource.features.forEach(function (feature) {
|
|
130
|
+
var coords = getCoords(feature);
|
|
131
|
+
points.push.apply(points, _toConsumableArray(coords.map(function (t) {
|
|
132
|
+
return {
|
|
133
|
+
lng: t[0],
|
|
134
|
+
lat: t[1],
|
|
135
|
+
alt: t[2] || 0
|
|
136
|
+
};
|
|
137
|
+
})));
|
|
138
|
+
});
|
|
139
|
+
_context.next = 9;
|
|
140
|
+
return Promise.all([fetch.post(POINT_EVALUATION_URL, {
|
|
141
|
+
points: points
|
|
142
|
+
}), fetch.post(SEGMENT_EVALUATION_URL, {
|
|
143
|
+
points: points
|
|
144
|
+
}), fetch.post(ROUTE_EVALUATION_URL, {
|
|
145
|
+
points: points
|
|
146
|
+
}), fetch.post(GRID_RENDER_URL, {
|
|
147
|
+
points: points,
|
|
148
|
+
stepDistance: 30
|
|
149
|
+
})]);
|
|
150
|
+
case 9:
|
|
151
|
+
_yield$Promise$all = _context.sent;
|
|
152
|
+
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 4);
|
|
153
|
+
pointEvaluationData = _yield$Promise$all2[0].data.data;
|
|
154
|
+
segmentEvaluationData = _yield$Promise$all2[1].data.data;
|
|
155
|
+
routeEvaluationData = _yield$Promise$all2[2].data.data;
|
|
156
|
+
gridData = _yield$Promise$all2[3].data.data;
|
|
157
|
+
this.routeResultSource = {
|
|
158
|
+
pointEvaluationData: pointEvaluationData,
|
|
159
|
+
segmentEvaluationData: segmentEvaluationData,
|
|
160
|
+
routeEvaluationData: routeEvaluationData,
|
|
161
|
+
gridData: gridData
|
|
162
|
+
};
|
|
163
|
+
this._createRoute();
|
|
164
|
+
this._createRiskPoints();
|
|
165
|
+
this._createGrids();
|
|
166
|
+
console.log(pointEvaluationData, segmentEvaluationData, routeEvaluationData, gridData);
|
|
167
|
+
case 20:
|
|
168
|
+
case "end":
|
|
169
|
+
return _context.stop();
|
|
170
|
+
}
|
|
171
|
+
}, _callee, this);
|
|
172
|
+
}));
|
|
173
|
+
function start() {
|
|
174
|
+
return _start.apply(this, arguments);
|
|
175
|
+
}
|
|
176
|
+
return start;
|
|
177
|
+
}() // 创建航线(起点、终点、基础管道)
|
|
178
|
+
}, {
|
|
179
|
+
key: "_createRoute",
|
|
180
|
+
value: function _createRoute() {
|
|
181
|
+
var _this$routeResultSour,
|
|
182
|
+
_this = this;
|
|
183
|
+
if (!this._canOperate) return;
|
|
184
|
+
this._clearRoute();
|
|
185
|
+
var allPoints = [];
|
|
186
|
+
this.routeSource.features.forEach(function (feature) {
|
|
187
|
+
var coords = getCoords(feature);
|
|
188
|
+
allPoints.push.apply(allPoints, _toConsumableArray(coords));
|
|
189
|
+
});
|
|
190
|
+
var pointGeoJson = {
|
|
191
|
+
type: 'FeatureCollection',
|
|
192
|
+
features: []
|
|
193
|
+
};
|
|
194
|
+
allPoints.forEach(function (point, index) {
|
|
195
|
+
if (!index) {
|
|
196
|
+
pointGeoJson.features.push({
|
|
197
|
+
type: 'Feature',
|
|
198
|
+
geometry: {
|
|
199
|
+
type: 'Point',
|
|
200
|
+
coordinates: point
|
|
201
|
+
},
|
|
202
|
+
properties: {
|
|
203
|
+
text: TYPE_LABEL_MAP.START,
|
|
204
|
+
color: TYPE_COLOR_MAP.START
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
if (index === allPoints.length - 1) {
|
|
209
|
+
pointGeoJson.features.push({
|
|
210
|
+
type: 'Feature',
|
|
211
|
+
geometry: {
|
|
212
|
+
type: 'Point',
|
|
213
|
+
coordinates: point
|
|
214
|
+
},
|
|
215
|
+
properties: {
|
|
216
|
+
text: TYPE_LABEL_MAP.END,
|
|
217
|
+
color: TYPE_COLOR_MAP.END
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
// 路线点位
|
|
223
|
+
this.routePointsLayer = this.getMap().addGraphicLayer(pointGeoJson, {
|
|
224
|
+
type: 'pointP',
|
|
225
|
+
style: {
|
|
226
|
+
pixelSize: 20,
|
|
227
|
+
color: function color(p) {
|
|
228
|
+
return p.color;
|
|
229
|
+
},
|
|
230
|
+
outlineColor: '#ffffff',
|
|
231
|
+
outlineWidth: 3,
|
|
232
|
+
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
233
|
+
translucent: true
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
// 路线点位标签
|
|
237
|
+
this.routePointsLabelLayer = this.getMap().addGraphicLayer(pointGeoJson, {
|
|
238
|
+
type: 'labelP',
|
|
239
|
+
style: {
|
|
240
|
+
text: function text(p) {
|
|
241
|
+
return p.text;
|
|
242
|
+
},
|
|
243
|
+
font: '16px "Microsoft YaHei", Arial, sans-serif',
|
|
244
|
+
fillColor: '#ffffff',
|
|
245
|
+
showBackground: true,
|
|
246
|
+
backgroundColor: 'rgba(0,0,0,0.55)',
|
|
247
|
+
pixelOffset: [0, -30],
|
|
248
|
+
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
249
|
+
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
250
|
+
translucent: true
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
if ((_this$routeResultSour = this.routeResultSource) !== null && _this$routeResultSour !== void 0 && _this$routeResultSour.segmentEvaluationData) {
|
|
254
|
+
var pipelineGeoJson = {
|
|
255
|
+
type: 'FeatureCollection',
|
|
256
|
+
features: []
|
|
257
|
+
};
|
|
258
|
+
var _loop = function _loop(i) {
|
|
259
|
+
var segmentPoints = [allPoints[i], allPoints[i + 1]];
|
|
260
|
+
var segmentData = _this.routeResultSource.segmentEvaluationData.find(function (segmentData) {
|
|
261
|
+
return segmentData.index === i;
|
|
262
|
+
});
|
|
263
|
+
var color = _this._getSegmentColorFromEvaluation(segmentData === null || segmentData === void 0 ? void 0 : segmentData.evaluation);
|
|
264
|
+
pipelineGeoJson.features.push({
|
|
265
|
+
type: 'Feature',
|
|
266
|
+
geometry: {
|
|
267
|
+
type: 'LineString',
|
|
268
|
+
coordinates: segmentPoints
|
|
269
|
+
},
|
|
270
|
+
properties: _objectSpread(_objectSpread({}, segmentData), {}, {
|
|
271
|
+
color: color
|
|
272
|
+
})
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
for (var i = 0; i < allPoints.length - 1; i++) {
|
|
276
|
+
_loop(i);
|
|
277
|
+
}
|
|
278
|
+
// 路线管道
|
|
279
|
+
this.routePipelineLayer = this.getMap().addGraphicLayer(pipelineGeoJson, {
|
|
280
|
+
type: 'polylineVolumeP',
|
|
281
|
+
style: {
|
|
282
|
+
// 圆截面
|
|
283
|
+
shapePositions: ShapeSection.circleSection(6, 48),
|
|
284
|
+
cornerType: Cesium.CornerType.ROUNDED,
|
|
285
|
+
color: function color(p) {
|
|
286
|
+
return p.color;
|
|
287
|
+
},
|
|
288
|
+
translucent: true
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
this.routePipelineLayer.on(LAYER_EVENT_TYPE.LEFT_CLICK, function (e) {
|
|
292
|
+
console.log(e);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
this.routePointsLayer.flyTo();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// 销毁航线
|
|
299
|
+
}, {
|
|
300
|
+
key: "_clearRoute",
|
|
301
|
+
value: function _clearRoute() {
|
|
302
|
+
if (!this._canOperate) return;
|
|
303
|
+
this.routePipelineLayer && this.routePipelineLayer.remove();
|
|
304
|
+
this.routePipelineLayer = null;
|
|
305
|
+
this.routePointsLayer && this.routePointsLayer.remove();
|
|
306
|
+
this.routePointsLayer = null;
|
|
307
|
+
this.routePointsLabelLayer && this.routePointsLabelLayer.remove();
|
|
308
|
+
this.routePointsLabelLayer = null;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// 获取航段颜色使用segment接口返回的数据)
|
|
312
|
+
}, {
|
|
313
|
+
key: "_getSegmentColorFromEvaluation",
|
|
314
|
+
value: function _getSegmentColorFromEvaluation(evaluation) {
|
|
315
|
+
var confidence = evaluation === null || evaluation === void 0 ? void 0 : evaluation.confidence;
|
|
316
|
+
if (confidence == null) return 'rgba(6,182,212,0.95)';
|
|
317
|
+
if (confidence < 0) return 'rgba(239,68,68,0.95)';
|
|
318
|
+
if (confidence < 0.5) return 'rgba(245,158,11,0.95)';
|
|
319
|
+
return 'rgba(16,185,129,0.95)';
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// 风险点聚合函数:将相近位置的风险点聚合在一起
|
|
323
|
+
// threshold: 聚合距离阈值(度),默认0.0005度(约55米)
|
|
324
|
+
}, {
|
|
325
|
+
key: "_clusterRiskPoints",
|
|
326
|
+
value: function _clusterRiskPoints(riskPointsData) {
|
|
327
|
+
var threshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0005;
|
|
328
|
+
var clusters = [];
|
|
329
|
+
var processed = new Set();
|
|
330
|
+
riskPointsData.forEach(function (point, idx) {
|
|
331
|
+
if (processed.has(idx)) return;
|
|
332
|
+
var cluster = {
|
|
333
|
+
points: [point],
|
|
334
|
+
indices: [idx],
|
|
335
|
+
centerLng: point.lng,
|
|
336
|
+
centerLat: point.lat,
|
|
337
|
+
centerAlt: point.alt,
|
|
338
|
+
totalRiskCount: point.riskCount,
|
|
339
|
+
maxRiskCount: point.riskCount,
|
|
340
|
+
evaluations: [point.evaluation]
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
// 查找相近的风险点
|
|
344
|
+
riskPointsData.forEach(function (otherPoint, otherIdx) {
|
|
345
|
+
if (idx === otherIdx || processed.has(otherIdx)) return;
|
|
346
|
+
var distance = Math.sqrt(Math.pow(point.lng - otherPoint.lng, 2) + Math.pow(point.lat - otherPoint.lat, 2));
|
|
347
|
+
if (distance < threshold) {
|
|
348
|
+
cluster.points.push(otherPoint);
|
|
349
|
+
cluster.indices.push(otherIdx);
|
|
350
|
+
processed.add(otherIdx);
|
|
351
|
+
|
|
352
|
+
// 更新聚合中心(使用平均值)
|
|
353
|
+
cluster.centerLng = cluster.points.reduce(function (sum, p) {
|
|
354
|
+
return sum + p.lng;
|
|
355
|
+
}, 0) / cluster.points.length;
|
|
356
|
+
cluster.centerLat = cluster.points.reduce(function (sum, p) {
|
|
357
|
+
return sum + p.lat;
|
|
358
|
+
}, 0) / cluster.points.length;
|
|
359
|
+
cluster.centerAlt = cluster.points.reduce(function (sum, p) {
|
|
360
|
+
return sum + p.alt;
|
|
361
|
+
}, 0) / cluster.points.length;
|
|
362
|
+
|
|
363
|
+
// 累加风险数量
|
|
364
|
+
cluster.totalRiskCount += otherPoint.riskCount;
|
|
365
|
+
if (otherPoint.riskCount > cluster.maxRiskCount) {
|
|
366
|
+
cluster.maxRiskCount = otherPoint.riskCount;
|
|
367
|
+
}
|
|
368
|
+
cluster.evaluations.push(otherPoint.evaluation);
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
processed.add(idx);
|
|
372
|
+
clusters.push(cluster);
|
|
373
|
+
});
|
|
374
|
+
return clusters;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// 创建风险点
|
|
378
|
+
}, {
|
|
379
|
+
key: "_createRiskPoints",
|
|
380
|
+
value: function _createRiskPoints() {
|
|
381
|
+
var _this$routeResultSour2;
|
|
382
|
+
if (!this._canOperate()) return;
|
|
383
|
+
this._clearRiskPoints();
|
|
384
|
+
if ((_this$routeResultSour2 = this.routeResultSource) !== null && _this$routeResultSour2 !== void 0 && (_this$routeResultSour2 = _this$routeResultSour2.pointEvaluationData) !== null && _this$routeResultSour2 !== void 0 && _this$routeResultSour2.length) {
|
|
385
|
+
var riskPoints = [];
|
|
386
|
+
var allRiskPoints = [];
|
|
387
|
+
// 第一步:收集所有风险点
|
|
388
|
+
this.routeResultSource.pointEvaluationData.forEach(function (item, idx) {
|
|
389
|
+
if (item.riskCount > 0) {
|
|
390
|
+
var _item$grid = item.grid,
|
|
391
|
+
lon = _item$grid.lon,
|
|
392
|
+
lat = _item$grid.lat,
|
|
393
|
+
alt = _item$grid.alt,
|
|
394
|
+
code = _item$grid.code;
|
|
395
|
+
var pointAlt = alt;
|
|
396
|
+
var evaluation = item.evaluation;
|
|
397
|
+
var riskPoint = {
|
|
398
|
+
index: idx,
|
|
399
|
+
lng: lon,
|
|
400
|
+
lat: lat,
|
|
401
|
+
alt: pointAlt,
|
|
402
|
+
// 网格高度(来自grid.alt)
|
|
403
|
+
riskCount: item.riskCount,
|
|
404
|
+
evaluation: evaluation,
|
|
405
|
+
gridCode: code // 网格code
|
|
406
|
+
};
|
|
407
|
+
allRiskPoints.push(riskPoint);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
// 第二步:聚合风险点
|
|
412
|
+
var clusters = this._clusterRiskPoints(allRiskPoints, 0.005); // 约55米聚合距离
|
|
413
|
+
var clustersGeoJson = {
|
|
414
|
+
type: 'FeatureCollection',
|
|
415
|
+
features: clusters === null || clusters === void 0 ? void 0 : clusters.map(function (cluster, clusterIdx) {
|
|
416
|
+
var isClustered = cluster.points.length > 1;
|
|
417
|
+
var displayHeight = cluster.centerAlt + 20; // 管道上方20米
|
|
418
|
+
var clusterData = {
|
|
419
|
+
index: clusterIdx,
|
|
420
|
+
lng: cluster.centerLng,
|
|
421
|
+
lat: cluster.centerLat,
|
|
422
|
+
alt: cluster.centerAlt,
|
|
423
|
+
displayHeight: displayHeight,
|
|
424
|
+
riskCount: cluster.totalRiskCount,
|
|
425
|
+
pointCount: cluster.points.length,
|
|
426
|
+
// 聚合的点数量
|
|
427
|
+
isClustered: isClustered,
|
|
428
|
+
points: cluster.points,
|
|
429
|
+
// 包含的所有风险点
|
|
430
|
+
evaluation: cluster.evaluations[0] // 使用第一个点的评估数据
|
|
431
|
+
};
|
|
432
|
+
riskPoints.push(clusterData);
|
|
433
|
+
// 创建聚合风险点标记
|
|
434
|
+
// 如果是聚合点,使用更大的标记和不同的颜色
|
|
435
|
+
var markerSize = isClustered ? 50 : 40;
|
|
436
|
+
var markerColor = isClustered ? '#ef4444' : '#f59e0b'; // 聚合点用红色,单点用黄色
|
|
437
|
+
var markerText = isClustered ? cluster.points.length : '!';
|
|
438
|
+
return {
|
|
439
|
+
type: 'Feature',
|
|
440
|
+
geometry: {
|
|
441
|
+
type: 'Point',
|
|
442
|
+
coordinates: [cluster.centerLng, cluster.centerLat, displayHeight]
|
|
443
|
+
},
|
|
444
|
+
properties: {
|
|
445
|
+
totalRiskCount: cluster.totalRiskCount,
|
|
446
|
+
isClustered: isClustered,
|
|
447
|
+
markerSize: markerSize,
|
|
448
|
+
markerColor: markerColor,
|
|
449
|
+
markerText: markerText
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
})
|
|
453
|
+
};
|
|
454
|
+
this.riskPointsLayer = this.getMap().addGraphicLayer(clustersGeoJson, {
|
|
455
|
+
type: 'billboardP',
|
|
456
|
+
style: {
|
|
457
|
+
image: function image(p) {
|
|
458
|
+
return 'data:image/svg+xml;base64,' + btoa('<svg width="' + p.markerSize + '" height="' + p.markerSize + '" xmlns="http://www.w3.org/2000/svg">' + '<circle cx="' + p.markerSize / 2 + '" cy="' + p.markerSize / 2 + '" r="' + (p.markerSize / 2 - 2) + '" fill="' + p.markerColor + '" stroke="#fff" stroke-width="2"/>' + '<text x="' + p.markerSize / 2 + '" y="' + (p.markerSize / 2 + 6) + '" font-size="' + (p.isClustered ? '14' : '16') + '" font-weight="bold" fill="#fff" text-anchor="middle">' + p.markerText + '</text>' + '</svg>');
|
|
459
|
+
},
|
|
460
|
+
scale: 1.0,
|
|
461
|
+
sizeInMeters: false,
|
|
462
|
+
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
this.riskPointsLabelLayer = this.getMap().addGraphicLayer(clustersGeoJson, {
|
|
466
|
+
type: 'labelP',
|
|
467
|
+
style: {
|
|
468
|
+
text: function text(p) {
|
|
469
|
+
return p.totalRiskCount.toString();
|
|
470
|
+
},
|
|
471
|
+
font: '12px Arial',
|
|
472
|
+
fillColor: '#ffffff',
|
|
473
|
+
showBackground: true,
|
|
474
|
+
backgroundColor: function backgroundColor(p) {
|
|
475
|
+
return p.isClustered ? '#ff0000' : '#ffa500';
|
|
476
|
+
},
|
|
477
|
+
pixelOffset: function pixelOffset(p) {
|
|
478
|
+
return [p.markerSize / 2, -p.markerSize / 2 - 10];
|
|
479
|
+
},
|
|
480
|
+
verticalOrigin: Cesium.VerticalOrigin.TOP,
|
|
481
|
+
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
|
|
482
|
+
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
// 清除风险点
|
|
489
|
+
}, {
|
|
490
|
+
key: "_clearRiskPoints",
|
|
491
|
+
value: function _clearRiskPoints() {
|
|
492
|
+
this.riskPointsLayer && this.riskPointsLayer.remove();
|
|
493
|
+
this.riskPointsLayer = null;
|
|
494
|
+
this.riskPointsLabelLayer && this.riskPointsLabelLayer.remove();
|
|
495
|
+
this.riskPointsLabelLayer = null;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// 创建网格
|
|
499
|
+
}, {
|
|
500
|
+
key: "_createGrids",
|
|
501
|
+
value: function _createGrids() {
|
|
502
|
+
var _this$routeResultSour3;
|
|
503
|
+
if (!this._canOperate()) return;
|
|
504
|
+
if (!((_this$routeResultSour3 = this.routeResultSource) !== null && _this$routeResultSour3 !== void 0 && (_this$routeResultSour3 = _this$routeResultSour3.gridData) !== null && _this$routeResultSour3 !== void 0 && _this$routeResultSour3.length)) return;
|
|
505
|
+
var girdsGeoJson = {
|
|
506
|
+
type: 'FeatureCollection',
|
|
507
|
+
features: this.routeResultSource.gridData.map(function (t) {
|
|
508
|
+
var bounds = t.bounds,
|
|
509
|
+
alt = t.alt,
|
|
510
|
+
arg = _objectWithoutProperties(t, _excluded);
|
|
511
|
+
var gridsSource = BaseSource.wktToGeoJon(bounds);
|
|
512
|
+
gridsSource.geometry.coordinates = getCoords(gridsSource).map(function (p) {
|
|
513
|
+
return p.map(function (k) {
|
|
514
|
+
return [].concat(_toConsumableArray(k), [alt || 0]);
|
|
515
|
+
});
|
|
516
|
+
});
|
|
517
|
+
return _objectSpread(_objectSpread({}, gridsSource), {}, {
|
|
518
|
+
properties: _objectSpread(_objectSpread({}, arg), {}, {
|
|
519
|
+
alt: alt || 0
|
|
520
|
+
})
|
|
521
|
+
});
|
|
522
|
+
})
|
|
523
|
+
};
|
|
524
|
+
this.gridsLayer = this.getMap().addGraphicLayer(girdsGeoJson, {
|
|
525
|
+
type: 'polygonP',
|
|
526
|
+
style: {
|
|
527
|
+
color: 'rgba(128,128,128,0.2)',
|
|
528
|
+
outline: true,
|
|
529
|
+
outlineColor: 'rgba(128,128,128,0.5)',
|
|
530
|
+
outlineWidth: 1,
|
|
531
|
+
extrudedHeight: function extrudedHeight(p) {
|
|
532
|
+
return p.alt + 10;
|
|
533
|
+
},
|
|
534
|
+
translucent: true
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// 销毁
|
|
540
|
+
}, {
|
|
541
|
+
key: "destroy",
|
|
542
|
+
value: function destroy() {
|
|
543
|
+
if (!this._canOperate()) return;
|
|
544
|
+
this._clearRoute();
|
|
545
|
+
this._clearRiskPoints();
|
|
546
|
+
this.routeResultSource = null;
|
|
547
|
+
this.isDestroyed = true;
|
|
548
|
+
}
|
|
549
|
+
}]);
|
|
550
|
+
return FlightRiskEvaluation;
|
|
551
|
+
}();
|
|
552
|
+
export default FlightRiskEvaluation;
|