@dra2020/baseclient 1.0.15 → 1.0.18
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/README.md +5 -16
- package/dist/all/all.d.ts +2 -18
- package/dist/baseclient.js +1323 -173
- package/dist/baseclient.js.map +1 -1
- package/dist/filterexpr/filterexpr.d.ts +3 -0
- package/dist/fsm/fsm.d.ts +1 -0
- package/dist/geo/all.d.ts +2 -0
- package/dist/geo/geo.d.ts +68 -0
- package/dist/geo/vfeature.d.ts +4 -0
- package/dist/ot-js/otsession.d.ts +3 -0
- package/dist/poly/union.d.ts +1 -0
- package/docs/filterexpr.md +22 -0
- package/lib/all/all.ts +2 -22
- package/lib/filterexpr/filterexpr.ts +79 -5
- package/lib/fsm/fsm.ts +12 -2
- package/lib/geo/all.ts +2 -0
- package/lib/geo/geo.ts +467 -0
- package/lib/geo/vfeature.ts +34 -0
- package/lib/ot-js/otsession.ts +4 -1
- package/lib/poly/hash.ts +1 -1
- package/lib/poly/polybin.ts +5 -4
- package/lib/poly/polypack.ts +16 -4
- package/lib/poly/topo.ts +26 -41
- package/lib/poly/union.ts +17 -0
- package/package.json +17 -5
- package/dist/all/allclient.d.ts +0 -18
- package/dist/base.js +0 -33010
- package/dist/base.js.map +0 -1
- package/dist/dbabstract/all.d.ts +0 -1
- package/dist/dbabstract/db.d.ts +0 -83
- package/dist/dbdynamo/all.d.ts +0 -1
- package/dist/dbdynamo/dbdynamo.d.ts +0 -190
- package/dist/fsmfile/all.d.ts +0 -1
- package/dist/fsmfile/fsmfile.d.ts +0 -47
- package/dist/jsonstream/all.d.ts +0 -1
- package/dist/jsonstream/jsonstream.d.ts +0 -130
- package/dist/lambda/all.d.ts +0 -1
- package/dist/lambda/env.d.ts +0 -10
- package/dist/lambda/lambda.d.ts +0 -18
- package/dist/logserver/all.d.ts +0 -5
- package/dist/logserver/log.d.ts +0 -11
- package/dist/logserver/logaccum.d.ts +0 -154
- package/dist/logserver/logblob.d.ts +0 -24
- package/dist/logserver/logconcat.d.ts +0 -55
- package/dist/logserver/logkey.d.ts +0 -28
- package/dist/memsqs/all.d.ts +0 -4
- package/dist/memsqs/client.d.ts +0 -13
- package/dist/memsqs/loopback.d.ts +0 -11
- package/dist/memsqs/orderedlist.d.ts +0 -19
- package/dist/memsqs/queue.d.ts +0 -84
- package/dist/memsqs/server.d.ts +0 -37
- package/dist/storage/all.d.ts +0 -4
- package/dist/storage/datablob.d.ts +0 -9
- package/dist/storage/env.d.ts +0 -10
- package/dist/storage/splitsblob.d.ts +0 -13
- package/dist/storage/storage.d.ts +0 -166
- package/dist/storages3/all.d.ts +0 -1
- package/dist/storages3/s3.d.ts +0 -62
- package/docs/dbabstract.md +0 -2
- package/docs/dbdynamo.md +0 -2
- package/docs/fsmfile.md +0 -2
- package/docs/jsonstream.md +0 -44
- package/docs/lambda.md +0 -2
- package/docs/logserver.md +0 -2
- package/docs/storage.md +0 -2
- package/docs/storages3.md +0 -2
- package/lib/all/allclient.ts +0 -19
- package/lib/dbabstract/all.ts +0 -1
- package/lib/dbabstract/db.ts +0 -246
- package/lib/dbdynamo/all.ts +0 -1
- package/lib/dbdynamo/dbdynamo.ts +0 -1551
- package/lib/fsmfile/all.ts +0 -1
- package/lib/fsmfile/fsmfile.ts +0 -236
- package/lib/jsonstream/all.ts +0 -1
- package/lib/jsonstream/jsonstream.ts +0 -940
- package/lib/lambda/all.ts +0 -1
- package/lib/lambda/env.ts +0 -13
- package/lib/lambda/lambda.ts +0 -120
- package/lib/logserver/all.ts +0 -5
- package/lib/logserver/log.ts +0 -565
- package/lib/logserver/logaccum.ts +0 -1445
- package/lib/logserver/logblob.ts +0 -84
- package/lib/logserver/logconcat.ts +0 -313
- package/lib/logserver/logkey.ts +0 -125
- package/lib/memsqs/all.ts +0 -4
- package/lib/memsqs/client.ts +0 -268
- package/lib/memsqs/loopback.ts +0 -64
- package/lib/memsqs/orderedlist.ts +0 -74
- package/lib/memsqs/queue.ts +0 -395
- package/lib/memsqs/server.ts +0 -262
- package/lib/storage/all.ts +0 -4
- package/lib/storage/datablob.ts +0 -36
- package/lib/storage/env.ts +0 -14
- package/lib/storage/splitsblob.ts +0 -63
- package/lib/storage/storage.ts +0 -604
- package/lib/storages3/all.ts +0 -1
- package/lib/storages3/s3.ts +0 -576
package/dist/baseclient.js
CHANGED
|
@@ -4,42 +4,63 @@
|
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
5
|
define([], factory);
|
|
6
6
|
else if(typeof exports === 'object')
|
|
7
|
-
exports["
|
|
7
|
+
exports["baseclient"] = factory();
|
|
8
8
|
else
|
|
9
|
-
root["
|
|
9
|
+
root["baseclient"] = factory();
|
|
10
10
|
})(global, function() {
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ "use strict";
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
14
14
|
|
|
15
|
-
/***/ "./lib/all/
|
|
16
|
-
|
|
17
|
-
!*** ./lib/all/
|
|
18
|
-
|
|
19
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
15
|
+
/***/ "./lib/all/all.ts":
|
|
16
|
+
/*!************************!*\
|
|
17
|
+
!*** ./lib/all/all.ts ***!
|
|
18
|
+
\************************/
|
|
19
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
25
|
+
}) : (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
o[k2] = m[k];
|
|
28
|
+
}));
|
|
29
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
30
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
31
|
+
}) : function(o, v) {
|
|
32
|
+
o["default"] = v;
|
|
33
|
+
});
|
|
34
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
22
41
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
23
|
-
exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
|
|
42
|
+
exports.G = exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
|
|
24
43
|
// Client and Server
|
|
25
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
44
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
26
45
|
exports.Util = Util;
|
|
27
|
-
const Context = __webpack_require__(/*! ../context/all */ "./lib/context/all.ts");
|
|
46
|
+
const Context = __importStar(__webpack_require__(/*! ../context/all */ "./lib/context/all.ts"));
|
|
28
47
|
exports.Context = Context;
|
|
29
|
-
const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
|
|
48
|
+
const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
|
|
30
49
|
exports.FSM = FSM;
|
|
31
|
-
const Poly = __webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts");
|
|
50
|
+
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
32
51
|
exports.Poly = Poly;
|
|
33
|
-
const LogAbstract = __webpack_require__(/*! ../logabstract/all */ "./lib/logabstract/all.ts");
|
|
52
|
+
const LogAbstract = __importStar(__webpack_require__(/*! ../logabstract/all */ "./lib/logabstract/all.ts"));
|
|
34
53
|
exports.LogAbstract = LogAbstract;
|
|
35
|
-
const LogClient = __webpack_require__(/*! ../logclient/all */ "./lib/logclient/all.ts");
|
|
54
|
+
const LogClient = __importStar(__webpack_require__(/*! ../logclient/all */ "./lib/logclient/all.ts"));
|
|
36
55
|
exports.LogClient = LogClient;
|
|
37
|
-
const OT = __webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts");
|
|
56
|
+
const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
|
|
38
57
|
exports.OT = OT;
|
|
39
|
-
const OTE = __webpack_require__(/*! ../ot-editutil/all */ "./lib/ot-editutil/all.ts");
|
|
58
|
+
const OTE = __importStar(__webpack_require__(/*! ../ot-editutil/all */ "./lib/ot-editutil/all.ts"));
|
|
40
59
|
exports.OTE = OTE;
|
|
41
60
|
const all_1 = __webpack_require__(/*! ../filterexpr/all */ "./lib/filterexpr/all.ts");
|
|
42
61
|
Object.defineProperty(exports, "FilterExpr", ({ enumerable: true, get: function () { return all_1.FilterExpr; } }));
|
|
62
|
+
const G = __importStar(__webpack_require__(/*! ../geo/all */ "./lib/geo/all.ts"));
|
|
63
|
+
exports.G = G;
|
|
43
64
|
|
|
44
65
|
|
|
45
66
|
/***/ }),
|
|
@@ -71,12 +92,31 @@ __exportStar(__webpack_require__(/*! ./context */ "./lib/context/context.ts"), e
|
|
|
71
92
|
/*!********************************!*\
|
|
72
93
|
!*** ./lib/context/context.ts ***!
|
|
73
94
|
\********************************/
|
|
74
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
95
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
75
96
|
|
|
76
97
|
|
|
98
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
99
|
+
if (k2 === undefined) k2 = k;
|
|
100
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
101
|
+
}) : (function(o, m, k, k2) {
|
|
102
|
+
if (k2 === undefined) k2 = k;
|
|
103
|
+
o[k2] = m[k];
|
|
104
|
+
}));
|
|
105
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
106
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
107
|
+
}) : function(o, v) {
|
|
108
|
+
o["default"] = v;
|
|
109
|
+
});
|
|
110
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
111
|
+
if (mod && mod.__esModule) return mod;
|
|
112
|
+
var result = {};
|
|
113
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
114
|
+
__setModuleDefault(result, mod);
|
|
115
|
+
return result;
|
|
116
|
+
};
|
|
77
117
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
78
118
|
exports.create = void 0;
|
|
79
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
119
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
80
120
|
class Context {
|
|
81
121
|
constructor() {
|
|
82
122
|
this.values = {};
|
|
@@ -156,12 +196,31 @@ __exportStar(__webpack_require__(/*! ./filterexpr */ "./lib/filterexpr/filterexp
|
|
|
156
196
|
/*!**************************************!*\
|
|
157
197
|
!*** ./lib/filterexpr/filterexpr.ts ***!
|
|
158
198
|
\**************************************/
|
|
159
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
199
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
160
200
|
|
|
161
201
|
|
|
202
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
203
|
+
if (k2 === undefined) k2 = k;
|
|
204
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
205
|
+
}) : (function(o, m, k, k2) {
|
|
206
|
+
if (k2 === undefined) k2 = k;
|
|
207
|
+
o[k2] = m[k];
|
|
208
|
+
}));
|
|
209
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
210
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
211
|
+
}) : function(o, v) {
|
|
212
|
+
o["default"] = v;
|
|
213
|
+
});
|
|
214
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
215
|
+
if (mod && mod.__esModule) return mod;
|
|
216
|
+
var result = {};
|
|
217
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
218
|
+
__setModuleDefault(result, mod);
|
|
219
|
+
return result;
|
|
220
|
+
};
|
|
162
221
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
163
222
|
exports.FilterExpr = void 0;
|
|
164
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
223
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
165
224
|
const Space = 32;
|
|
166
225
|
const Tab = 9;
|
|
167
226
|
const Newline = 10;
|
|
@@ -538,6 +597,40 @@ function wordyDate(s) {
|
|
|
538
597
|
// But this is close enough to match what gets displayed by "prettyDate" while also letting selection by month year
|
|
539
598
|
return s;
|
|
540
599
|
}
|
|
600
|
+
function clauseEqual(c1, c2) {
|
|
601
|
+
if (c1 == null && c2 == null)
|
|
602
|
+
return true;
|
|
603
|
+
if (c1 == null || c2 == null)
|
|
604
|
+
return false;
|
|
605
|
+
if (c1.op.tt === c2.op.tt) {
|
|
606
|
+
if (c1.op.tt === TokType.Text)
|
|
607
|
+
return c1.op.text === c2.op.text;
|
|
608
|
+
else
|
|
609
|
+
return clauseEqual(c1.operand1, c2.operand1) && clauseEqual(c1.operand2, c2.operand2);
|
|
610
|
+
}
|
|
611
|
+
else
|
|
612
|
+
return false;
|
|
613
|
+
}
|
|
614
|
+
function containsClause(c, s) {
|
|
615
|
+
if (clauseEqual(c, s))
|
|
616
|
+
return true;
|
|
617
|
+
if (c == null || s == null)
|
|
618
|
+
return false;
|
|
619
|
+
return containsClause(c.operand1, s) || containsClause(c.operand2, s);
|
|
620
|
+
}
|
|
621
|
+
function removeClause(c, s) {
|
|
622
|
+
if (c == null || (c.op.tt === TokType.Text && c.op.tt !== s.op.tt))
|
|
623
|
+
return c;
|
|
624
|
+
else if (clauseEqual(c, s))
|
|
625
|
+
return null;
|
|
626
|
+
else {
|
|
627
|
+
c.operand1 = removeClause(c.operand1, s);
|
|
628
|
+
c.operand2 = removeClause(c.operand2, s);
|
|
629
|
+
if ((c.op.tt === TokType.And || c.op.tt === TokType.Or) && (c.operand1 == null || c.operand2 == null))
|
|
630
|
+
return c.operand1 || c.operand2;
|
|
631
|
+
return c;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
541
634
|
class FilterExpr {
|
|
542
635
|
constructor(coder, expr) {
|
|
543
636
|
this.lexer = new Lexer(coder);
|
|
@@ -555,13 +648,38 @@ class FilterExpr {
|
|
|
555
648
|
asString() {
|
|
556
649
|
return this.asStringClause(this.parser.clause);
|
|
557
650
|
}
|
|
651
|
+
containsClause(expr) {
|
|
652
|
+
let sub = new FilterExpr(this.lexer.coder, expr);
|
|
653
|
+
return containsClause(this.parser.clause, sub.parser.clause);
|
|
654
|
+
}
|
|
655
|
+
addClause(expr) {
|
|
656
|
+
let sub = new FilterExpr(this.lexer.coder, expr);
|
|
657
|
+
if (!containsClause(this.parser.clause, sub.parser.clause)) {
|
|
658
|
+
if (this.parser.clause)
|
|
659
|
+
this.parser.clauses = [{ op: { tt: TokType.And }, operand1: this.parser.clause, operand2: sub.parser.clause }];
|
|
660
|
+
else
|
|
661
|
+
this.parser.clauses = [sub.parser.clause];
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
removeClause(expr) {
|
|
665
|
+
if (this.containsClause(expr)) {
|
|
666
|
+
let sub = new FilterExpr(this.lexer.coder, expr);
|
|
667
|
+
this.parser.clauses = [removeClause(this.parser.clause, sub.parser.clause)];
|
|
668
|
+
}
|
|
669
|
+
}
|
|
558
670
|
asStringClause(clause) {
|
|
559
671
|
if (clause == null)
|
|
560
672
|
return '';
|
|
561
|
-
if (clause.op.tt == TokType.Text)
|
|
562
|
-
|
|
673
|
+
if (clause.op.tt == TokType.Text) {
|
|
674
|
+
this.lexer.set(clause.op.text);
|
|
675
|
+
if (this.lexer.tokens.length == 1 && this.lexer.tokens[0].tt === TokType.Text)
|
|
676
|
+
return clause.op.text;
|
|
677
|
+
else
|
|
678
|
+
return `'${clause.op.text}'`;
|
|
679
|
+
}
|
|
563
680
|
let a = [];
|
|
564
|
-
|
|
681
|
+
if (clause !== this.parser.clause)
|
|
682
|
+
a.push('(');
|
|
565
683
|
switch (clause.op.tt) {
|
|
566
684
|
case TokType.And:
|
|
567
685
|
a.push(this.asStringClause(clause.operand1));
|
|
@@ -578,8 +696,7 @@ class FilterExpr {
|
|
|
578
696
|
a.push(this.asStringClause(clause.operand1));
|
|
579
697
|
break;
|
|
580
698
|
case TokType.Colon:
|
|
581
|
-
a.push(this.asStringClause(clause.operand1));
|
|
582
|
-
a.push(':');
|
|
699
|
+
a.push(`${this.asStringClause(clause.operand1)}:`);
|
|
583
700
|
a.push(this.asStringClause(clause.operand2));
|
|
584
701
|
break;
|
|
585
702
|
case TokType.Equal:
|
|
@@ -594,7 +711,8 @@ class FilterExpr {
|
|
|
594
711
|
default:
|
|
595
712
|
throw 'Unexpected token in asString';
|
|
596
713
|
}
|
|
597
|
-
|
|
714
|
+
if (clause !== this.parser.clause)
|
|
715
|
+
a.push(')');
|
|
598
716
|
return a.join(' ');
|
|
599
717
|
}
|
|
600
718
|
testClause(o, types, clause, prop, relation) {
|
|
@@ -686,13 +804,32 @@ __exportStar(__webpack_require__(/*! ./fsm */ "./lib/fsm/fsm.ts"), exports);
|
|
|
686
804
|
/*!************************!*\
|
|
687
805
|
!*** ./lib/fsm/fsm.ts ***!
|
|
688
806
|
\************************/
|
|
689
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
807
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
690
808
|
|
|
691
809
|
|
|
810
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
811
|
+
if (k2 === undefined) k2 = k;
|
|
812
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
813
|
+
}) : (function(o, m, k, k2) {
|
|
814
|
+
if (k2 === undefined) k2 = k;
|
|
815
|
+
o[k2] = m[k];
|
|
816
|
+
}));
|
|
817
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
818
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
819
|
+
}) : function(o, v) {
|
|
820
|
+
o["default"] = v;
|
|
821
|
+
});
|
|
822
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
823
|
+
if (mod && mod.__esModule) return mod;
|
|
824
|
+
var result = {};
|
|
825
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
826
|
+
__setModuleDefault(result, mod);
|
|
827
|
+
return result;
|
|
828
|
+
};
|
|
692
829
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
693
830
|
exports.FsmArray = exports.FsmLoop = exports.DefaultLoopOptions = exports.FsmTracker = exports.FsmSerializer = exports.FsmSleep = exports.FsmOnDone = exports.Fsm = exports.FsmManager = exports.FSM_CUSTOM9 = exports.FSM_CUSTOM8 = exports.FSM_CUSTOM7 = exports.FSM_CUSTOM6 = exports.FSM_CUSTOM5 = exports.FSM_CUSTOM4 = exports.FSM_CUSTOM3 = exports.FSM_CUSTOM2 = exports.FSM_CUSTOM1 = exports.FSM_RELEASED = exports.FSM_ERROR = exports.FSM_DONE = exports.FSM_PENDING = exports.FSM_STARTING = void 0;
|
|
694
831
|
// Shared libraries
|
|
695
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
832
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
696
833
|
// States
|
|
697
834
|
exports.FSM_STARTING = 0;
|
|
698
835
|
exports.FSM_PENDING = 1 << 0;
|
|
@@ -916,9 +1053,17 @@ class FsmSleep extends Fsm {
|
|
|
916
1053
|
this.delay = delay;
|
|
917
1054
|
}
|
|
918
1055
|
tick() {
|
|
919
|
-
|
|
1056
|
+
// This allows canceling by simply setting state to done
|
|
1057
|
+
if (this.done && this.timeoutHandle !== undefined) {
|
|
1058
|
+
clearTimeout(this.timeoutHandle);
|
|
1059
|
+
delete this.timeoutHandle;
|
|
1060
|
+
}
|
|
1061
|
+
else if (this.ready && this.state === exports.FSM_STARTING) {
|
|
920
1062
|
this.setState(exports.FSM_PENDING);
|
|
921
|
-
setTimeout(() => {
|
|
1063
|
+
this.timeoutHandle = setTimeout(() => {
|
|
1064
|
+
delete this.timeoutHandle;
|
|
1065
|
+
this.setState(exports.FSM_DONE);
|
|
1066
|
+
}, this.delay);
|
|
922
1067
|
}
|
|
923
1068
|
}
|
|
924
1069
|
}
|
|
@@ -1080,6 +1225,500 @@ class FsmArray extends Fsm {
|
|
|
1080
1225
|
exports.FsmArray = FsmArray;
|
|
1081
1226
|
|
|
1082
1227
|
|
|
1228
|
+
/***/ }),
|
|
1229
|
+
|
|
1230
|
+
/***/ "./lib/geo/all.ts":
|
|
1231
|
+
/*!************************!*\
|
|
1232
|
+
!*** ./lib/geo/all.ts ***!
|
|
1233
|
+
\************************/
|
|
1234
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1238
|
+
if (k2 === undefined) k2 = k;
|
|
1239
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1240
|
+
}) : (function(o, m, k, k2) {
|
|
1241
|
+
if (k2 === undefined) k2 = k;
|
|
1242
|
+
o[k2] = m[k];
|
|
1243
|
+
}));
|
|
1244
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
1245
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1246
|
+
};
|
|
1247
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1248
|
+
__exportStar(__webpack_require__(/*! ./geo */ "./lib/geo/geo.ts"), exports);
|
|
1249
|
+
__exportStar(__webpack_require__(/*! ./vfeature */ "./lib/geo/vfeature.ts"), exports);
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
/***/ }),
|
|
1253
|
+
|
|
1254
|
+
/***/ "./lib/geo/geo.ts":
|
|
1255
|
+
/*!************************!*\
|
|
1256
|
+
!*** ./lib/geo/geo.ts ***!
|
|
1257
|
+
\************************/
|
|
1258
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1262
|
+
if (k2 === undefined) k2 = k;
|
|
1263
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1264
|
+
}) : (function(o, m, k, k2) {
|
|
1265
|
+
if (k2 === undefined) k2 = k;
|
|
1266
|
+
o[k2] = m[k];
|
|
1267
|
+
}));
|
|
1268
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1269
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1270
|
+
}) : function(o, v) {
|
|
1271
|
+
o["default"] = v;
|
|
1272
|
+
});
|
|
1273
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1274
|
+
if (mod && mod.__esModule) return mod;
|
|
1275
|
+
var result = {};
|
|
1276
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1277
|
+
__setModuleDefault(result, mod);
|
|
1278
|
+
return result;
|
|
1279
|
+
};
|
|
1280
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1281
|
+
exports.geoIntersect = exports.geoIntersectOptions = exports.GeoMultiCollection = exports.geoMapEqual = exports.geoEqual = exports.geoTopoToCollection = exports.geoCollectionToTopo = exports.geoMapToCollection = exports.geoCollectionToMap = exports.geoEnsureID = void 0;
|
|
1282
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
1283
|
+
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
1284
|
+
function geoEnsureID(col) {
|
|
1285
|
+
let prop;
|
|
1286
|
+
const props = ['id', 'GEOID', 'GEOID10', 'GEOID20', 'GEOID30'];
|
|
1287
|
+
if (col && col.features && col.features.length > 0) {
|
|
1288
|
+
let f = col.features[0];
|
|
1289
|
+
if (f.properties.id !== undefined)
|
|
1290
|
+
return;
|
|
1291
|
+
props.forEach(p => { if (prop === undefined && f.properties[p] !== undefined)
|
|
1292
|
+
prop = p; });
|
|
1293
|
+
if (prop)
|
|
1294
|
+
col.features.forEach(f => { f.properties.id = f.properties[prop]; });
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
exports.geoEnsureID = geoEnsureID;
|
|
1298
|
+
function geoCollectionToMap(col) {
|
|
1299
|
+
if (col == null)
|
|
1300
|
+
return null;
|
|
1301
|
+
let map = {};
|
|
1302
|
+
col.features.forEach((f) => { map[String(f.properties.id)] = f; });
|
|
1303
|
+
return map;
|
|
1304
|
+
}
|
|
1305
|
+
exports.geoCollectionToMap = geoCollectionToMap;
|
|
1306
|
+
function geoMapToCollection(map) {
|
|
1307
|
+
if (map == null || Util.countKeys(map) == 0)
|
|
1308
|
+
return null;
|
|
1309
|
+
let col = { type: 'FeatureCollection', features: [] };
|
|
1310
|
+
Object.keys(map).forEach((geoid) => { col.features.push(map[geoid]); });
|
|
1311
|
+
return col;
|
|
1312
|
+
}
|
|
1313
|
+
exports.geoMapToCollection = geoMapToCollection;
|
|
1314
|
+
function geoCollectionToTopo(col) {
|
|
1315
|
+
let topo = Poly.topoFromCollection(col);
|
|
1316
|
+
Poly.topoPack(topo);
|
|
1317
|
+
return topo;
|
|
1318
|
+
}
|
|
1319
|
+
exports.geoCollectionToTopo = geoCollectionToTopo;
|
|
1320
|
+
function geoTopoToCollection(topo) {
|
|
1321
|
+
let col = Poly.topoToCollection(topo);
|
|
1322
|
+
Poly.featurePack(col);
|
|
1323
|
+
return col;
|
|
1324
|
+
}
|
|
1325
|
+
exports.geoTopoToCollection = geoTopoToCollection;
|
|
1326
|
+
function geoEqual(m1, m2) {
|
|
1327
|
+
let n1 = m1 ? m1.length : 0;
|
|
1328
|
+
let n2 = m2 ? m2.length : 0;
|
|
1329
|
+
if (n1 != n2)
|
|
1330
|
+
return false;
|
|
1331
|
+
if (n1 == 0)
|
|
1332
|
+
return true;
|
|
1333
|
+
let n = 0;
|
|
1334
|
+
let eq = true;
|
|
1335
|
+
m1.forEach(f => { if (eq && !m2.find(f.properties.id))
|
|
1336
|
+
eq = false; });
|
|
1337
|
+
return eq;
|
|
1338
|
+
}
|
|
1339
|
+
exports.geoEqual = geoEqual;
|
|
1340
|
+
function geoMapEqual(m1, m2) {
|
|
1341
|
+
if (m1 == null)
|
|
1342
|
+
return Util.isEmpty(m2);
|
|
1343
|
+
if (m2 == null)
|
|
1344
|
+
return Util.isEmpty(m1);
|
|
1345
|
+
let p;
|
|
1346
|
+
for (p in m1)
|
|
1347
|
+
if (m1.hasOwnProperty(p))
|
|
1348
|
+
if (m1[p] !== m2[p])
|
|
1349
|
+
return false;
|
|
1350
|
+
for (p in m2)
|
|
1351
|
+
if (m2.hasOwnProperty(p))
|
|
1352
|
+
if (m1[p] === undefined)
|
|
1353
|
+
return false;
|
|
1354
|
+
return true;
|
|
1355
|
+
}
|
|
1356
|
+
exports.geoMapEqual = geoMapEqual;
|
|
1357
|
+
class GeoMultiCollection {
|
|
1358
|
+
constructor(tag, topo, col, map) {
|
|
1359
|
+
this.stamp = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER / 2);
|
|
1360
|
+
this.empty();
|
|
1361
|
+
if (tag)
|
|
1362
|
+
this.add(tag, topo, col, map);
|
|
1363
|
+
}
|
|
1364
|
+
empty() {
|
|
1365
|
+
this.entries = {};
|
|
1366
|
+
this.hidden = {};
|
|
1367
|
+
this._onChange();
|
|
1368
|
+
}
|
|
1369
|
+
get nEntries() { return Util.countKeys(this.entries); }
|
|
1370
|
+
nthEntry(n) {
|
|
1371
|
+
return Util.nthProperty(this.entries, n);
|
|
1372
|
+
}
|
|
1373
|
+
add(tag, topo, col, map) {
|
|
1374
|
+
let entry = this.entries[tag];
|
|
1375
|
+
if (entry === undefined)
|
|
1376
|
+
entry = { tag: tag }, this.entries[tag] = entry;
|
|
1377
|
+
if ((topo && entry.topo !== topo) || (col && entry.col !== col) || (map && entry.map !== map)) {
|
|
1378
|
+
entry.topo = topo;
|
|
1379
|
+
entry.col = col;
|
|
1380
|
+
entry.map = map;
|
|
1381
|
+
this._onChange();
|
|
1382
|
+
}
|
|
1383
|
+
else if (topo == null && col == null && map == null)
|
|
1384
|
+
this.remove(tag);
|
|
1385
|
+
}
|
|
1386
|
+
addMulti(multi) {
|
|
1387
|
+
multi.forEachEntry(e => {
|
|
1388
|
+
this.add(e.tag, e.topo, e.col, e.map);
|
|
1389
|
+
});
|
|
1390
|
+
for (let p in multi.hidden)
|
|
1391
|
+
if (multi.hidden.hasOwnProperty(p)) {
|
|
1392
|
+
this.hidden[p] = true;
|
|
1393
|
+
this._onChange();
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
remove(tag) {
|
|
1397
|
+
let entry = this.entries[tag];
|
|
1398
|
+
if (entry) {
|
|
1399
|
+
if (entry.topo || entry.col || entry.map)
|
|
1400
|
+
this._onChange();
|
|
1401
|
+
delete this.entries[tag];
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
_onChange() {
|
|
1405
|
+
this.all = { tag: 'all' };
|
|
1406
|
+
this.stamp++;
|
|
1407
|
+
}
|
|
1408
|
+
_col(e) {
|
|
1409
|
+
if (e == null)
|
|
1410
|
+
return null;
|
|
1411
|
+
if (!e.col) {
|
|
1412
|
+
if (e.map)
|
|
1413
|
+
e.col = geoMapToCollection(e.map);
|
|
1414
|
+
else if (e.topo)
|
|
1415
|
+
e.col = geoTopoToCollection(e.topo);
|
|
1416
|
+
}
|
|
1417
|
+
return e.col;
|
|
1418
|
+
}
|
|
1419
|
+
_map(e) {
|
|
1420
|
+
if (e == null)
|
|
1421
|
+
return null;
|
|
1422
|
+
if (!e.map) {
|
|
1423
|
+
if (e.col)
|
|
1424
|
+
e.map = geoCollectionToMap(e.col);
|
|
1425
|
+
else if (e.topo) {
|
|
1426
|
+
e.col = geoTopoToCollection(e.topo);
|
|
1427
|
+
e.map = geoCollectionToMap(e.col);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
return e.map;
|
|
1431
|
+
}
|
|
1432
|
+
_topo(e) {
|
|
1433
|
+
if (e == null)
|
|
1434
|
+
return null;
|
|
1435
|
+
if (!e.topo) {
|
|
1436
|
+
if (e.col)
|
|
1437
|
+
e.topo = geoCollectionToTopo(e.col);
|
|
1438
|
+
else if (e.map) {
|
|
1439
|
+
e.col = geoMapToCollection(e.map);
|
|
1440
|
+
e.topo = geoCollectionToTopo(e.col);
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
return e.topo;
|
|
1444
|
+
}
|
|
1445
|
+
colOf(tag) { return this._col(this.entries[tag]); }
|
|
1446
|
+
mapOf(tag) { return this._map(this.entries[tag]); }
|
|
1447
|
+
topoOf(tag) { return this._topo(this.entries[tag]); }
|
|
1448
|
+
forEachEntry(cb) {
|
|
1449
|
+
Object.values(this.entries).forEach(cb);
|
|
1450
|
+
}
|
|
1451
|
+
allCol() {
|
|
1452
|
+
if (this.nEntries == 0)
|
|
1453
|
+
return null;
|
|
1454
|
+
if (!this.all.col) {
|
|
1455
|
+
// optimise case where one entry
|
|
1456
|
+
let n = this.nEntries;
|
|
1457
|
+
if (n == 1)
|
|
1458
|
+
this.all.col = this._col(this.nthEntry(0));
|
|
1459
|
+
else
|
|
1460
|
+
// Going from map to collection guarantees that any duplicates are removed
|
|
1461
|
+
this.all.col = geoMapToCollection(this.allMap());
|
|
1462
|
+
}
|
|
1463
|
+
return this.all.col;
|
|
1464
|
+
}
|
|
1465
|
+
allMap() {
|
|
1466
|
+
if (this.nEntries == 0)
|
|
1467
|
+
return null;
|
|
1468
|
+
if (!this.all.map) {
|
|
1469
|
+
// optimise case where one entry
|
|
1470
|
+
let n = this.nEntries;
|
|
1471
|
+
if (n == 1)
|
|
1472
|
+
this.all.map = this._map(this.nthEntry(0));
|
|
1473
|
+
else {
|
|
1474
|
+
let map = {};
|
|
1475
|
+
this.all.map = map;
|
|
1476
|
+
this.forEach(f => { map[String(f.properties.id)] = f; });
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
return this.all.map;
|
|
1480
|
+
}
|
|
1481
|
+
allTopo() {
|
|
1482
|
+
if (this.nEntries == 0)
|
|
1483
|
+
return null;
|
|
1484
|
+
if (!this.all.topo) {
|
|
1485
|
+
// optimise case where one entry
|
|
1486
|
+
let n = this.nEntries;
|
|
1487
|
+
if (n == 1)
|
|
1488
|
+
this.all.topo = this._topo(this.nthEntry(0));
|
|
1489
|
+
else
|
|
1490
|
+
this.all.topo = geoCollectionToTopo(this.allCol());
|
|
1491
|
+
}
|
|
1492
|
+
return this.all.topo;
|
|
1493
|
+
}
|
|
1494
|
+
hide(id) {
|
|
1495
|
+
if (id) {
|
|
1496
|
+
if (typeof id === 'string')
|
|
1497
|
+
this.hidden[id] = true;
|
|
1498
|
+
else if (Array.isArray(id))
|
|
1499
|
+
id.forEach((i) => { this.hidden[i] = true; });
|
|
1500
|
+
else if (typeof id === 'object')
|
|
1501
|
+
for (let p in id)
|
|
1502
|
+
if (id.hasOwnProperty(p))
|
|
1503
|
+
this.hidden[p] = true;
|
|
1504
|
+
this._onChange();
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
show(id) {
|
|
1508
|
+
if (id) {
|
|
1509
|
+
if (typeof id === 'string')
|
|
1510
|
+
delete this.hidden[id];
|
|
1511
|
+
else if (Array.isArray(id))
|
|
1512
|
+
id.forEach((i) => { delete this.hidden[i]; });
|
|
1513
|
+
else if (typeof id === 'object')
|
|
1514
|
+
for (let p in id)
|
|
1515
|
+
if (id.hasOwnProperty(p))
|
|
1516
|
+
delete this.hidden[p];
|
|
1517
|
+
this._onChange();
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
showAll() {
|
|
1521
|
+
if (!Util.isEmpty(this.hidden)) {
|
|
1522
|
+
this.hidden = {};
|
|
1523
|
+
this._onChange();
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
get length() {
|
|
1527
|
+
let n = 0;
|
|
1528
|
+
this.forEachEntry(e => {
|
|
1529
|
+
if (e.col)
|
|
1530
|
+
n += e.col.features.length;
|
|
1531
|
+
else if (e.map)
|
|
1532
|
+
n += Util.countKeys(e.map);
|
|
1533
|
+
else if (e.topo)
|
|
1534
|
+
n += Util.countKeys(e.topo.objects);
|
|
1535
|
+
});
|
|
1536
|
+
return n;
|
|
1537
|
+
}
|
|
1538
|
+
// Use forEach in preference to iteration using this function
|
|
1539
|
+
nthFeature(n) {
|
|
1540
|
+
let found;
|
|
1541
|
+
if (n >= 0)
|
|
1542
|
+
this.forEachEntry(e => {
|
|
1543
|
+
if (found)
|
|
1544
|
+
return;
|
|
1545
|
+
let col = this._col(e);
|
|
1546
|
+
if (col)
|
|
1547
|
+
if (n > col.features.length)
|
|
1548
|
+
n -= col.features.length;
|
|
1549
|
+
else
|
|
1550
|
+
found = col.features[n];
|
|
1551
|
+
});
|
|
1552
|
+
return found;
|
|
1553
|
+
}
|
|
1554
|
+
nthFilteredFeature(n, cb) {
|
|
1555
|
+
let found;
|
|
1556
|
+
this.forEachEntry(e => {
|
|
1557
|
+
if (found)
|
|
1558
|
+
return;
|
|
1559
|
+
let col = this._col(e);
|
|
1560
|
+
if (col)
|
|
1561
|
+
for (let i = 0; !found && i < col.features.length; i++) {
|
|
1562
|
+
let f = col.features[i];
|
|
1563
|
+
if (this.hidden[f.properties.id] === undefined && cb(f)) {
|
|
1564
|
+
if (n === 0) {
|
|
1565
|
+
found = f;
|
|
1566
|
+
break;
|
|
1567
|
+
}
|
|
1568
|
+
n--;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
});
|
|
1572
|
+
return found;
|
|
1573
|
+
}
|
|
1574
|
+
forEach(cb) {
|
|
1575
|
+
this.forEachEntry(e => {
|
|
1576
|
+
let col = this._col(e);
|
|
1577
|
+
if (e.col)
|
|
1578
|
+
e.col.features.forEach(f => { if (this.hidden[f.properties.id] === undefined)
|
|
1579
|
+
cb(f); });
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
map(cb) {
|
|
1583
|
+
let features = [];
|
|
1584
|
+
this.forEach((f) => { features.push(cb(f)); });
|
|
1585
|
+
return features;
|
|
1586
|
+
}
|
|
1587
|
+
isHidden(id) {
|
|
1588
|
+
return this.hidden[id] !== undefined;
|
|
1589
|
+
}
|
|
1590
|
+
find(id) {
|
|
1591
|
+
if (this.hidden[id] !== undefined)
|
|
1592
|
+
return undefined;
|
|
1593
|
+
let entries = Object.values(this.entries);
|
|
1594
|
+
for (let i = 0; i < entries.length; i++) {
|
|
1595
|
+
let map = this._map(entries[i]);
|
|
1596
|
+
if (map[id])
|
|
1597
|
+
return map[id];
|
|
1598
|
+
}
|
|
1599
|
+
return undefined;
|
|
1600
|
+
}
|
|
1601
|
+
filter(test) {
|
|
1602
|
+
let m = new GeoMultiCollection();
|
|
1603
|
+
this.forEachEntry(e => {
|
|
1604
|
+
let col = this._col(e);
|
|
1605
|
+
let features = col ? col.features.filter(test) : null;
|
|
1606
|
+
if (features && features.length)
|
|
1607
|
+
m.add(e.tag, null, { type: 'FeatureCollection', features: features }, null);
|
|
1608
|
+
});
|
|
1609
|
+
return m;
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
exports.GeoMultiCollection = GeoMultiCollection;
|
|
1613
|
+
var geoIntersectOptions;
|
|
1614
|
+
(function (geoIntersectOptions) {
|
|
1615
|
+
geoIntersectOptions[geoIntersectOptions["Intersects"] = 0] = "Intersects";
|
|
1616
|
+
geoIntersectOptions[geoIntersectOptions["Bounds"] = 1] = "Bounds";
|
|
1617
|
+
geoIntersectOptions[geoIntersectOptions["BoundsCenter"] = 2] = "BoundsCenter";
|
|
1618
|
+
})(geoIntersectOptions = exports.geoIntersectOptions || (exports.geoIntersectOptions = {}));
|
|
1619
|
+
;
|
|
1620
|
+
function geoBoxIntersect(x1, x2, opt) {
|
|
1621
|
+
if (x1.left === undefined || x2.left === undefined)
|
|
1622
|
+
return false;
|
|
1623
|
+
let l1 = x1.left;
|
|
1624
|
+
let l2 = x2.left;
|
|
1625
|
+
let r1 = x1.right;
|
|
1626
|
+
let r2 = x2.right;
|
|
1627
|
+
let b1 = x1.top; // flip
|
|
1628
|
+
let b2 = x2.top; // flip
|
|
1629
|
+
let t1 = x1.bottom; // flip
|
|
1630
|
+
let t2 = x2.bottom; // flip
|
|
1631
|
+
let cx2 = l2 + (r2 - l2) / 2;
|
|
1632
|
+
let cy2 = t2 + (b2 - t2) / 2;
|
|
1633
|
+
// Note I flipped top and bottom above when extracting,
|
|
1634
|
+
// in order to make below logic work for normal y axis alignment (0 at top).
|
|
1635
|
+
switch (opt) {
|
|
1636
|
+
case geoIntersectOptions.Intersects:
|
|
1637
|
+
return !(l2 > r1 || r2 < l1 || t2 > b1 || b2 < t1);
|
|
1638
|
+
case geoIntersectOptions.Bounds:
|
|
1639
|
+
return l1 <= l2 && t1 <= t2 && r1 >= r2 && b1 >= b2;
|
|
1640
|
+
case geoIntersectOptions.BoundsCenter:
|
|
1641
|
+
return l1 <= cx2 && t1 <= cy2 && r1 >= cx2 && b1 >= cy2;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
function geoIntersect(multi, bbox, opt) {
|
|
1645
|
+
let m = {};
|
|
1646
|
+
let bboxPoly = Poly.boundboxPoly(bbox);
|
|
1647
|
+
multi.forEach((f) => {
|
|
1648
|
+
let box = Poly.boundbox(f);
|
|
1649
|
+
if (geoBoxIntersect(bbox, box, opt)) {
|
|
1650
|
+
if (opt !== geoIntersectOptions.Intersects || Poly.polyIntersects(bboxPoly, f))
|
|
1651
|
+
m[f.properties.id] = f;
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1654
|
+
let result = new GeoMultiCollection();
|
|
1655
|
+
result.add('result', null, null, m);
|
|
1656
|
+
return result;
|
|
1657
|
+
}
|
|
1658
|
+
exports.geoIntersect = geoIntersect;
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
/***/ }),
|
|
1662
|
+
|
|
1663
|
+
/***/ "./lib/geo/vfeature.ts":
|
|
1664
|
+
/*!*****************************!*\
|
|
1665
|
+
!*** ./lib/geo/vfeature.ts ***!
|
|
1666
|
+
\*****************************/
|
|
1667
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1668
|
+
|
|
1669
|
+
|
|
1670
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1671
|
+
if (k2 === undefined) k2 = k;
|
|
1672
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1673
|
+
}) : (function(o, m, k, k2) {
|
|
1674
|
+
if (k2 === undefined) k2 = k;
|
|
1675
|
+
o[k2] = m[k];
|
|
1676
|
+
}));
|
|
1677
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1678
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1679
|
+
}) : function(o, v) {
|
|
1680
|
+
o["default"] = v;
|
|
1681
|
+
});
|
|
1682
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1683
|
+
if (mod && mod.__esModule) return mod;
|
|
1684
|
+
var result = {};
|
|
1685
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1686
|
+
__setModuleDefault(result, mod);
|
|
1687
|
+
return result;
|
|
1688
|
+
};
|
|
1689
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1690
|
+
exports.computeVFeature = void 0;
|
|
1691
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
1692
|
+
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
1693
|
+
// Given the topology for a precinct, the bintrie mapping and the list of blocks, construct the
|
|
1694
|
+
// feature data for the virtual feature.
|
|
1695
|
+
//
|
|
1696
|
+
function computeVFeature(topoPrecinct, bintrie, blocks) {
|
|
1697
|
+
let contiguity = new Util.IndexedArray();
|
|
1698
|
+
let block_contiguity = new Util.IndexedArray();
|
|
1699
|
+
let f = Poly.topoMerge(topoPrecinct, blocks);
|
|
1700
|
+
f.properties.datasets = {};
|
|
1701
|
+
blocks.forEach(blockid => {
|
|
1702
|
+
let b = topoPrecinct.objects[blockid];
|
|
1703
|
+
if (b.properties.datasets)
|
|
1704
|
+
Util.deepAccum(f.properties.datasets, b.properties.datasets);
|
|
1705
|
+
if (b.properties.contiguity) {
|
|
1706
|
+
b.properties.contiguity.forEach((id) => {
|
|
1707
|
+
contiguity.set(id === 'OUT_OF_STATE' ? id : bintrie.get(id));
|
|
1708
|
+
});
|
|
1709
|
+
b.properties.contiguity.forEach((id) => {
|
|
1710
|
+
block_contiguity.set(id);
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
});
|
|
1714
|
+
f.properties.contiguity = contiguity.asArray();
|
|
1715
|
+
f.properties.block_contiguity = block_contiguity.asArray();
|
|
1716
|
+
f.properties.blocks = blocks;
|
|
1717
|
+
return f;
|
|
1718
|
+
}
|
|
1719
|
+
exports.computeVFeature = computeVFeature;
|
|
1720
|
+
|
|
1721
|
+
|
|
1083
1722
|
/***/ }),
|
|
1084
1723
|
|
|
1085
1724
|
/***/ "./lib/logabstract/all.ts":
|
|
@@ -1109,12 +1748,31 @@ __exportStar(__webpack_require__(/*! ./log */ "./lib/logabstract/log.ts"), expor
|
|
|
1109
1748
|
/*!********************************!*\
|
|
1110
1749
|
!*** ./lib/logabstract/log.ts ***!
|
|
1111
1750
|
\********************************/
|
|
1112
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
1751
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1113
1752
|
|
|
1114
1753
|
|
|
1754
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1755
|
+
if (k2 === undefined) k2 = k;
|
|
1756
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1757
|
+
}) : (function(o, m, k, k2) {
|
|
1758
|
+
if (k2 === undefined) k2 = k;
|
|
1759
|
+
o[k2] = m[k];
|
|
1760
|
+
}));
|
|
1761
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1762
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1763
|
+
}) : function(o, v) {
|
|
1764
|
+
o["default"] = v;
|
|
1765
|
+
});
|
|
1766
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1767
|
+
if (mod && mod.__esModule) return mod;
|
|
1768
|
+
var result = {};
|
|
1769
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1770
|
+
__setModuleDefault(result, mod);
|
|
1771
|
+
return result;
|
|
1772
|
+
};
|
|
1115
1773
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1116
1774
|
exports.SyncTimer = exports.AsyncTimer = exports.Timer = void 0;
|
|
1117
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
1775
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
1118
1776
|
class Timer {
|
|
1119
1777
|
constructor(ilog, kind, o, verbosity = 0) {
|
|
1120
1778
|
this.ilog = ilog;
|
|
@@ -1175,12 +1833,31 @@ __exportStar(__webpack_require__(/*! ./log */ "./lib/logclient/log.ts"), exports
|
|
|
1175
1833
|
/*!******************************!*\
|
|
1176
1834
|
!*** ./lib/logclient/log.ts ***!
|
|
1177
1835
|
\******************************/
|
|
1178
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
1836
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1179
1837
|
|
|
1180
1838
|
|
|
1839
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1840
|
+
if (k2 === undefined) k2 = k;
|
|
1841
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1842
|
+
}) : (function(o, m, k, k2) {
|
|
1843
|
+
if (k2 === undefined) k2 = k;
|
|
1844
|
+
o[k2] = m[k];
|
|
1845
|
+
}));
|
|
1846
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1847
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1848
|
+
}) : function(o, v) {
|
|
1849
|
+
o["default"] = v;
|
|
1850
|
+
});
|
|
1851
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1852
|
+
if (mod && mod.__esModule) return mod;
|
|
1853
|
+
var result = {};
|
|
1854
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1855
|
+
__setModuleDefault(result, mod);
|
|
1856
|
+
return result;
|
|
1857
|
+
};
|
|
1181
1858
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1182
1859
|
exports.create = void 0;
|
|
1183
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
1860
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
1184
1861
|
class LogManager {
|
|
1185
1862
|
constructor(env) {
|
|
1186
1863
|
this.env = env;
|
|
@@ -1281,13 +1958,32 @@ __exportStar(__webpack_require__(/*! ./otmaputil */ "./lib/ot-editutil/otmaputil
|
|
|
1281
1958
|
/*!***************************************!*\
|
|
1282
1959
|
!*** ./lib/ot-editutil/oteditutil.ts ***!
|
|
1283
1960
|
\***************************************/
|
|
1284
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
1961
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1285
1962
|
|
|
1286
1963
|
|
|
1964
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1965
|
+
if (k2 === undefined) k2 = k;
|
|
1966
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
1967
|
+
}) : (function(o, m, k, k2) {
|
|
1968
|
+
if (k2 === undefined) k2 = k;
|
|
1969
|
+
o[k2] = m[k];
|
|
1970
|
+
}));
|
|
1971
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
1972
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1973
|
+
}) : function(o, v) {
|
|
1974
|
+
o["default"] = v;
|
|
1975
|
+
});
|
|
1976
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1977
|
+
if (mod && mod.__esModule) return mod;
|
|
1978
|
+
var result = {};
|
|
1979
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1980
|
+
__setModuleDefault(result, mod);
|
|
1981
|
+
return result;
|
|
1982
|
+
};
|
|
1287
1983
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1288
1984
|
exports.OTEditUtil = void 0;
|
|
1289
|
-
const OT = __webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts");
|
|
1290
|
-
const DMP = __webpack_require__(/*! diff-match-patch */ "diff-match-patch");
|
|
1985
|
+
const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
|
|
1986
|
+
const DMP = __importStar(__webpack_require__(/*! diff-match-patch */ "diff-match-patch"));
|
|
1291
1987
|
let DiffMatchPatch = new DMP.diff_match_patch();
|
|
1292
1988
|
let DIFF_DELETE = DMP.DIFF_DELETE;
|
|
1293
1989
|
let DIFF_INSERT = DMP.DIFF_INSERT;
|
|
@@ -1447,13 +2143,32 @@ exports.OTEditUtil = OTEditUtil;
|
|
|
1447
2143
|
/*!**************************************!*\
|
|
1448
2144
|
!*** ./lib/ot-editutil/otmaputil.ts ***!
|
|
1449
2145
|
\**************************************/
|
|
1450
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
2146
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1451
2147
|
|
|
1452
2148
|
|
|
2149
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2150
|
+
if (k2 === undefined) k2 = k;
|
|
2151
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
2152
|
+
}) : (function(o, m, k, k2) {
|
|
2153
|
+
if (k2 === undefined) k2 = k;
|
|
2154
|
+
o[k2] = m[k];
|
|
2155
|
+
}));
|
|
2156
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
2157
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2158
|
+
}) : function(o, v) {
|
|
2159
|
+
o["default"] = v;
|
|
2160
|
+
});
|
|
2161
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
2162
|
+
if (mod && mod.__esModule) return mod;
|
|
2163
|
+
var result = {};
|
|
2164
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
2165
|
+
__setModuleDefault(result, mod);
|
|
2166
|
+
return result;
|
|
2167
|
+
};
|
|
1453
2168
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1454
2169
|
exports.Editor = exports.REPLACE = exports.MERGE = void 0;
|
|
1455
|
-
const OT = __webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts");
|
|
1456
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
2170
|
+
const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
|
|
2171
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
1457
2172
|
exports.MERGE = 0;
|
|
1458
2173
|
exports.REPLACE = 1;
|
|
1459
2174
|
class Editor {
|
|
@@ -1646,12 +2361,31 @@ __exportStar(__webpack_require__(/*! ./otsession */ "./lib/ot-js/otsession.ts"),
|
|
|
1646
2361
|
/*!******************************!*\
|
|
1647
2362
|
!*** ./lib/ot-js/otarray.ts ***!
|
|
1648
2363
|
\******************************/
|
|
1649
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
2364
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1650
2365
|
|
|
1651
2366
|
|
|
2367
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2368
|
+
if (k2 === undefined) k2 = k;
|
|
2369
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
2370
|
+
}) : (function(o, m, k, k2) {
|
|
2371
|
+
if (k2 === undefined) k2 = k;
|
|
2372
|
+
o[k2] = m[k];
|
|
2373
|
+
}));
|
|
2374
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
2375
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2376
|
+
}) : function(o, v) {
|
|
2377
|
+
o["default"] = v;
|
|
2378
|
+
});
|
|
2379
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
2380
|
+
if (mod && mod.__esModule) return mod;
|
|
2381
|
+
var result = {};
|
|
2382
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
2383
|
+
__setModuleDefault(result, mod);
|
|
2384
|
+
return result;
|
|
2385
|
+
};
|
|
1652
2386
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1653
2387
|
exports.OTArrayResource = exports.OTStringResource = exports.OTArrayLikeResource = exports.OTArrayOperations = exports.OTStringOperations = exports.OTSingleArrayEditor = exports.OpTmpRetain = exports.OpSet = exports.OpCursor = exports.OpRetain = exports.OpDelete = exports.OpInsert = void 0;
|
|
1654
|
-
const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
|
|
2388
|
+
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
1655
2389
|
const TestUnitSize = 4;
|
|
1656
2390
|
let TestCounter = 0;
|
|
1657
2391
|
// Array Ops
|
|
@@ -2583,13 +3317,32 @@ function counterValue(ops, c) {
|
|
|
2583
3317
|
/*!*************************************!*\
|
|
2584
3318
|
!*** ./lib/ot-js/otclientengine.ts ***!
|
|
2585
3319
|
\*************************************/
|
|
2586
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
3320
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
2587
3321
|
|
|
2588
3322
|
|
|
3323
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3324
|
+
if (k2 === undefined) k2 = k;
|
|
3325
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
3326
|
+
}) : (function(o, m, k, k2) {
|
|
3327
|
+
if (k2 === undefined) k2 = k;
|
|
3328
|
+
o[k2] = m[k];
|
|
3329
|
+
}));
|
|
3330
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
3331
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3332
|
+
}) : function(o, v) {
|
|
3333
|
+
o["default"] = v;
|
|
3334
|
+
});
|
|
3335
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3336
|
+
if (mod && mod.__esModule) return mod;
|
|
3337
|
+
var result = {};
|
|
3338
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3339
|
+
__setModuleDefault(result, mod);
|
|
3340
|
+
return result;
|
|
3341
|
+
};
|
|
2589
3342
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2590
3343
|
exports.OTClientEngine = void 0;
|
|
2591
|
-
const OTC = __webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts");
|
|
2592
|
-
const OTE = __webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts");
|
|
3344
|
+
const OTC = __importStar(__webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts"));
|
|
3345
|
+
const OTE = __importStar(__webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts"));
|
|
2593
3346
|
class OTClientEngine extends OTE.OTEngine {
|
|
2594
3347
|
// Constructor
|
|
2595
3348
|
constructor(ilog, rid, cid) {
|
|
@@ -2833,15 +3586,34 @@ exports.OTClientEngine = OTClientEngine;
|
|
|
2833
3586
|
/*!**********************************!*\
|
|
2834
3587
|
!*** ./lib/ot-js/otcomposite.ts ***!
|
|
2835
3588
|
\**********************************/
|
|
2836
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
3589
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
2837
3590
|
|
|
2838
3591
|
|
|
3592
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3593
|
+
if (k2 === undefined) k2 = k;
|
|
3594
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
3595
|
+
}) : (function(o, m, k, k2) {
|
|
3596
|
+
if (k2 === undefined) k2 = k;
|
|
3597
|
+
o[k2] = m[k];
|
|
3598
|
+
}));
|
|
3599
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
3600
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3601
|
+
}) : function(o, v) {
|
|
3602
|
+
o["default"] = v;
|
|
3603
|
+
});
|
|
3604
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3605
|
+
if (mod && mod.__esModule) return mod;
|
|
3606
|
+
var result = {};
|
|
3607
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3608
|
+
__setModuleDefault(result, mod);
|
|
3609
|
+
return result;
|
|
3610
|
+
};
|
|
2839
3611
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2840
3612
|
exports.OTCompositeResource = exports.clockSeenValue = exports.clockUndoValue = exports.clockInitializeValue = exports.clockFailureValue = exports.clockRandomizeValue = exports.clockTerminateValue = exports.clockInitialValue = void 0;
|
|
2841
|
-
const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
|
|
2842
|
-
const OTA = __webpack_require__(/*! ./otarray */ "./lib/ot-js/otarray.ts");
|
|
2843
|
-
const OTM = __webpack_require__(/*! ./otmap */ "./lib/ot-js/otmap.ts");
|
|
2844
|
-
const OTC = __webpack_require__(/*! ./otcounter */ "./lib/ot-js/otcounter.ts");
|
|
3613
|
+
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
3614
|
+
const OTA = __importStar(__webpack_require__(/*! ./otarray */ "./lib/ot-js/otarray.ts"));
|
|
3615
|
+
const OTM = __importStar(__webpack_require__(/*! ./otmap */ "./lib/ot-js/otmap.ts"));
|
|
3616
|
+
const OTC = __importStar(__webpack_require__(/*! ./otcounter */ "./lib/ot-js/otcounter.ts"));
|
|
2845
3617
|
exports.clockInitialValue = -1; // Initial value
|
|
2846
3618
|
exports.clockTerminateValue = -2; // Terminal action from client.
|
|
2847
3619
|
exports.clockRandomizeValue = -3; // Fill in with random data.
|
|
@@ -3032,12 +3804,31 @@ exports.OTCompositeResource = OTCompositeResource;
|
|
|
3032
3804
|
/*!********************************!*\
|
|
3033
3805
|
!*** ./lib/ot-js/otcounter.ts ***!
|
|
3034
3806
|
\********************************/
|
|
3035
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
3807
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
3036
3808
|
|
|
3037
3809
|
|
|
3810
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3811
|
+
if (k2 === undefined) k2 = k;
|
|
3812
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
3813
|
+
}) : (function(o, m, k, k2) {
|
|
3814
|
+
if (k2 === undefined) k2 = k;
|
|
3815
|
+
o[k2] = m[k];
|
|
3816
|
+
}));
|
|
3817
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
3818
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3819
|
+
}) : function(o, v) {
|
|
3820
|
+
o["default"] = v;
|
|
3821
|
+
});
|
|
3822
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3823
|
+
if (mod && mod.__esModule) return mod;
|
|
3824
|
+
var result = {};
|
|
3825
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3826
|
+
__setModuleDefault(result, mod);
|
|
3827
|
+
return result;
|
|
3828
|
+
};
|
|
3038
3829
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3039
3830
|
exports.OTCounterResource = exports.OpCounterDel = exports.OpCounterAdd = void 0;
|
|
3040
|
-
const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
|
|
3831
|
+
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
3041
3832
|
// This implements OT for a simple map of counters. Instead of a new value replacing the
|
|
3042
3833
|
// keyed value, values are added together. This allows a simple accumulating counter.
|
|
3043
3834
|
// Possible future additions:
|
|
@@ -3207,13 +3998,32 @@ exports.OTEngine = OTEngine;
|
|
|
3207
3998
|
/*!****************************!*\
|
|
3208
3999
|
!*** ./lib/ot-js/otmap.ts ***!
|
|
3209
4000
|
\****************************/
|
|
3210
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
4001
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
3211
4002
|
|
|
3212
4003
|
|
|
4004
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4005
|
+
if (k2 === undefined) k2 = k;
|
|
4006
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4007
|
+
}) : (function(o, m, k, k2) {
|
|
4008
|
+
if (k2 === undefined) k2 = k;
|
|
4009
|
+
o[k2] = m[k];
|
|
4010
|
+
}));
|
|
4011
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4012
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4013
|
+
}) : function(o, v) {
|
|
4014
|
+
o["default"] = v;
|
|
4015
|
+
});
|
|
4016
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4017
|
+
if (mod && mod.__esModule) return mod;
|
|
4018
|
+
var result = {};
|
|
4019
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4020
|
+
__setModuleDefault(result, mod);
|
|
4021
|
+
return result;
|
|
4022
|
+
};
|
|
3213
4023
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3214
4024
|
exports.OTMapResource = exports.OpMapDel = exports.OpMapSet = void 0;
|
|
3215
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
3216
|
-
const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
|
|
4025
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
4026
|
+
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
3217
4027
|
// This implements OT for a dictionary of objects. OT is pretty trivial for maps - last wins.
|
|
3218
4028
|
exports.OpMapSet = 1;
|
|
3219
4029
|
exports.OpMapDel = 2;
|
|
@@ -3327,14 +4137,33 @@ exports.OTMapResource = OTMapResource;
|
|
|
3327
4137
|
/*!*************************************!*\
|
|
3328
4138
|
!*** ./lib/ot-js/otserverengine.ts ***!
|
|
3329
4139
|
\*************************************/
|
|
3330
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
4140
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
3331
4141
|
|
|
3332
4142
|
|
|
4143
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4144
|
+
if (k2 === undefined) k2 = k;
|
|
4145
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4146
|
+
}) : (function(o, m, k, k2) {
|
|
4147
|
+
if (k2 === undefined) k2 = k;
|
|
4148
|
+
o[k2] = m[k];
|
|
4149
|
+
}));
|
|
4150
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4151
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4152
|
+
}) : function(o, v) {
|
|
4153
|
+
o["default"] = v;
|
|
4154
|
+
});
|
|
4155
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4156
|
+
if (mod && mod.__esModule) return mod;
|
|
4157
|
+
var result = {};
|
|
4158
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4159
|
+
__setModuleDefault(result, mod);
|
|
4160
|
+
return result;
|
|
4161
|
+
};
|
|
3333
4162
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3334
4163
|
exports.OTServerEngine = exports.ClientIDForServer = void 0;
|
|
3335
|
-
const OTC = __webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts");
|
|
3336
|
-
const OTS = __webpack_require__(/*! ./otsession */ "./lib/ot-js/otsession.ts");
|
|
3337
|
-
const OTE = __webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts");
|
|
4164
|
+
const OTC = __importStar(__webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts"));
|
|
4165
|
+
const OTS = __importStar(__webpack_require__(/*! ./otsession */ "./lib/ot-js/otsession.ts"));
|
|
4166
|
+
const OTE = __importStar(__webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts"));
|
|
3338
4167
|
exports.ClientIDForServer = '-Server-';
|
|
3339
4168
|
class OTServerEngine extends OTE.OTEngine {
|
|
3340
4169
|
// Constructor
|
|
@@ -3572,7 +4401,7 @@ exports.OTServerEngine = OTServerEngine;
|
|
|
3572
4401
|
|
|
3573
4402
|
|
|
3574
4403
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3575
|
-
exports.SessionFilterFunction = exports.accessMapFindUser = exports.accessFindUser = exports.ServerStateMaintenance = exports.ServerStateRunning = exports.PermAll = exports.PermEdit = exports.PermAdmin = exports.PermOwner = exports.PermWrite = exports.PermRead = exports.PermNone = exports.FilterCount = exports.FilterOfficial = exports.FilterPublic = exports.FilterTrash = exports.FilterRecent = exports.FilterMyPublic = exports.FilterSharedWithMe = exports.FilterMyMaps = exports.EClockAnomaly = exports.EMaintenance = exports.ENoAccess = exports.ENoPerm = exports.ELoadFailed = exports.EBadRequest = exports.ENoUser = exports.EClockReset = exports.EClockFailure = exports.EClockSeen = exports.ENoSession = exports.ERetry = exports.EFull = exports.EFail = exports.ESuccess = void 0;
|
|
4404
|
+
exports.SessionFilterFunction = exports.accessMapFindUser = exports.accessFindUser = exports.ServerStateMaintenance = exports.ServerStateRunning = exports.PermAll = exports.PermEdit = exports.PermAdmin = exports.PermOwner = exports.PermWrite = exports.PermRead = exports.PermNone = exports.FilterCount = exports.FilterCOI = exports.FilterOfficial = exports.FilterPublic = exports.FilterTrash = exports.FilterRecent = exports.FilterMyPublic = exports.FilterSharedWithMe = exports.FilterMyMaps = exports.EClockAnomaly = exports.EMaintenance = exports.ENoAccess = exports.ENoPerm = exports.ELoadFailed = exports.EBadRequest = exports.ENoUser = exports.EClockReset = exports.EClockFailure = exports.EClockSeen = exports.ENoSession = exports.ERetry = exports.EFull = exports.EFail = exports.ESuccess = void 0;
|
|
3576
4405
|
// Errors
|
|
3577
4406
|
exports.ESuccess = 0; // Generic success
|
|
3578
4407
|
exports.EFail = 1; // Generic failure
|
|
@@ -3597,7 +4426,8 @@ exports.FilterRecent = 3;
|
|
|
3597
4426
|
exports.FilterTrash = 4;
|
|
3598
4427
|
exports.FilterPublic = 5;
|
|
3599
4428
|
exports.FilterOfficial = 6;
|
|
3600
|
-
exports.
|
|
4429
|
+
exports.FilterCOI = 7;
|
|
4430
|
+
exports.FilterCount = 8;
|
|
3601
4431
|
// Permissions
|
|
3602
4432
|
exports.PermNone = 0; // No permissions
|
|
3603
4433
|
exports.PermRead = 1; // Can view
|
|
@@ -3765,13 +4595,32 @@ __exportStar(__webpack_require__(/*! ./shamos */ "./lib/poly/shamos.ts"), export
|
|
|
3765
4595
|
/*!***************************!*\
|
|
3766
4596
|
!*** ./lib/poly/blend.ts ***!
|
|
3767
4597
|
\***************************/
|
|
3768
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
4598
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
3769
4599
|
|
|
3770
4600
|
|
|
4601
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4602
|
+
if (k2 === undefined) k2 = k;
|
|
4603
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4604
|
+
}) : (function(o, m, k, k2) {
|
|
4605
|
+
if (k2 === undefined) k2 = k;
|
|
4606
|
+
o[k2] = m[k];
|
|
4607
|
+
}));
|
|
4608
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4609
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4610
|
+
}) : function(o, v) {
|
|
4611
|
+
o["default"] = v;
|
|
4612
|
+
});
|
|
4613
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4614
|
+
if (mod && mod.__esModule) return mod;
|
|
4615
|
+
var result = {};
|
|
4616
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4617
|
+
__setModuleDefault(result, mod);
|
|
4618
|
+
return result;
|
|
4619
|
+
};
|
|
3771
4620
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3772
4621
|
exports.blend = void 0;
|
|
3773
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
3774
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
4622
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
4623
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
3775
4624
|
// Takes array of polygon or multi-polygon coordinate structures and returns a single multi-polygon
|
|
3776
4625
|
// structure. The coordinates may be passed in using packed format.
|
|
3777
4626
|
function blend(polys) {
|
|
@@ -3800,12 +4649,31 @@ exports.blend = blend;
|
|
|
3800
4649
|
/*!******************************!*\
|
|
3801
4650
|
!*** ./lib/poly/boundbox.ts ***!
|
|
3802
4651
|
\******************************/
|
|
3803
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
4652
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
3804
4653
|
|
|
3805
4654
|
|
|
4655
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4656
|
+
if (k2 === undefined) k2 = k;
|
|
4657
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4658
|
+
}) : (function(o, m, k, k2) {
|
|
4659
|
+
if (k2 === undefined) k2 = k;
|
|
4660
|
+
o[k2] = m[k];
|
|
4661
|
+
}));
|
|
4662
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4663
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4664
|
+
}) : function(o, v) {
|
|
4665
|
+
o["default"] = v;
|
|
4666
|
+
});
|
|
4667
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4668
|
+
if (mod && mod.__esModule) return mod;
|
|
4669
|
+
var result = {};
|
|
4670
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4671
|
+
__setModuleDefault(result, mod);
|
|
4672
|
+
return result;
|
|
4673
|
+
};
|
|
3806
4674
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3807
4675
|
exports.boundboxIntersects = exports.boundboxArea = exports.boundboxPoly = exports.boundbox = exports.boundboxExtend = exports.clipLon = exports.boundboxCY = exports.boundboxCX = exports.boundboxHeight = exports.boundboxWidth = void 0;
|
|
3808
|
-
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
4676
|
+
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
3809
4677
|
function boundboxWidth(bb) { return Math.abs(bb.right - bb.left); }
|
|
3810
4678
|
exports.boundboxWidth = boundboxWidth;
|
|
3811
4679
|
function boundboxHeight(bb) { return Math.abs(bb.bottom - bb.top); }
|
|
@@ -3887,16 +4755,35 @@ exports.boundboxIntersects = boundboxIntersects;
|
|
|
3887
4755
|
/*!*******************************!*\
|
|
3888
4756
|
!*** ./lib/poly/cartesian.ts ***!
|
|
3889
4757
|
\*******************************/
|
|
3890
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
4758
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
3891
4759
|
|
|
3892
4760
|
|
|
3893
4761
|
//
|
|
3894
4762
|
// GEO-FEATURES UTILITIES
|
|
3895
4763
|
//
|
|
4764
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4765
|
+
if (k2 === undefined) k2 = k;
|
|
4766
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4767
|
+
}) : (function(o, m, k, k2) {
|
|
4768
|
+
if (k2 === undefined) k2 = k;
|
|
4769
|
+
o[k2] = m[k];
|
|
4770
|
+
}));
|
|
4771
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4772
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4773
|
+
}) : function(o, v) {
|
|
4774
|
+
o["default"] = v;
|
|
4775
|
+
});
|
|
4776
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4777
|
+
if (mod && mod.__esModule) return mod;
|
|
4778
|
+
var result = {};
|
|
4779
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4780
|
+
__setModuleDefault(result, mod);
|
|
4781
|
+
return result;
|
|
4782
|
+
};
|
|
3896
4783
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3897
4784
|
exports.polyDiameterFlat = exports.polyPerimeterFlat = exports.polyAreaFlat = exports.polyParts = void 0;
|
|
3898
|
-
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
3899
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
4785
|
+
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
4786
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
3900
4787
|
// HELPER
|
|
3901
4788
|
function bufferToRing(b, s, nPoints) {
|
|
3902
4789
|
let r = [];
|
|
@@ -4001,7 +4888,7 @@ exports.polyDiameterFlat = polyDiameterFlat;
|
|
|
4001
4888
|
/*!*********************************!*\
|
|
4002
4889
|
!*** ./lib/poly/graham-scan.ts ***!
|
|
4003
4890
|
\*********************************/
|
|
4004
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
4891
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
4005
4892
|
|
|
4006
4893
|
|
|
4007
4894
|
//
|
|
@@ -4012,10 +4899,29 @@ exports.polyDiameterFlat = polyDiameterFlat;
|
|
|
4012
4899
|
* https://www.tutorialspoint.com/Graham-Scan-Algorithm <<< pseudo code
|
|
4013
4900
|
* http://brian3kb.github.io/graham_scan_js/ <<< basis for this implementation
|
|
4014
4901
|
*/
|
|
4902
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4903
|
+
if (k2 === undefined) k2 = k;
|
|
4904
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4905
|
+
}) : (function(o, m, k, k2) {
|
|
4906
|
+
if (k2 === undefined) k2 = k;
|
|
4907
|
+
o[k2] = m[k];
|
|
4908
|
+
}));
|
|
4909
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4910
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4911
|
+
}) : function(o, v) {
|
|
4912
|
+
o["default"] = v;
|
|
4913
|
+
});
|
|
4914
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4915
|
+
if (mod && mod.__esModule) return mod;
|
|
4916
|
+
var result = {};
|
|
4917
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4918
|
+
__setModuleDefault(result, mod);
|
|
4919
|
+
return result;
|
|
4920
|
+
};
|
|
4015
4921
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4016
4922
|
exports.makeConvexHullGrahamScan = void 0;
|
|
4017
4923
|
const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
4018
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
4924
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
4019
4925
|
function makeConvexHullGrahamScan(poly, options) {
|
|
4020
4926
|
let points = getExteriorPoints(poly);
|
|
4021
4927
|
if (points == null)
|
|
@@ -4554,12 +5460,31 @@ function protect(condition, message) {
|
|
|
4554
5460
|
/*!******************************!*\
|
|
4555
5461
|
!*** ./lib/poly/minbound.ts ***!
|
|
4556
5462
|
\******************************/
|
|
4557
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
5463
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
4558
5464
|
|
|
4559
5465
|
|
|
4560
5466
|
//
|
|
4561
5467
|
// MINIMUM BOUNDING RECTANGLE - aka minimum area rectangle -or- smallest enclosing rectangle
|
|
4562
5468
|
//
|
|
5469
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5470
|
+
if (k2 === undefined) k2 = k;
|
|
5471
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5472
|
+
}) : (function(o, m, k, k2) {
|
|
5473
|
+
if (k2 === undefined) k2 = k;
|
|
5474
|
+
o[k2] = m[k];
|
|
5475
|
+
}));
|
|
5476
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
5477
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
5478
|
+
}) : function(o, v) {
|
|
5479
|
+
o["default"] = v;
|
|
5480
|
+
});
|
|
5481
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
5482
|
+
if (mod && mod.__esModule) return mod;
|
|
5483
|
+
var result = {};
|
|
5484
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
5485
|
+
__setModuleDefault(result, mod);
|
|
5486
|
+
return result;
|
|
5487
|
+
};
|
|
4563
5488
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4564
5489
|
exports.minimumBoundingRectangle = void 0;
|
|
4565
5490
|
//
|
|
@@ -4594,7 +5519,7 @@ MBR <- function(p) {
|
|
|
4594
5519
|
// THIS RE-IMPLEMENTS THE R IN TYPESCRIPT, USING CUSTOM MATRIX OPERATIONS
|
|
4595
5520
|
//
|
|
4596
5521
|
const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
4597
|
-
const M = __webpack_require__(/*! ./matrix */ "./lib/poly/matrix.ts");
|
|
5522
|
+
const M = __importStar(__webpack_require__(/*! ./matrix */ "./lib/poly/matrix.ts"));
|
|
4598
5523
|
// For point addressing
|
|
4599
5524
|
const X = 0, Y = 1;
|
|
4600
5525
|
function minimumBoundingRectangle(poly) {
|
|
@@ -4749,13 +5674,32 @@ export function minimumBoundingRectangle(poly: any): any
|
|
|
4749
5674
|
/*!**************************!*\
|
|
4750
5675
|
!*** ./lib/poly/poly.ts ***!
|
|
4751
5676
|
\**************************/
|
|
4752
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
5677
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
4753
5678
|
|
|
4754
5679
|
|
|
5680
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5681
|
+
if (k2 === undefined) k2 = k;
|
|
5682
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5683
|
+
}) : (function(o, m, k, k2) {
|
|
5684
|
+
if (k2 === undefined) k2 = k;
|
|
5685
|
+
o[k2] = m[k];
|
|
5686
|
+
}));
|
|
5687
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
5688
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
5689
|
+
}) : function(o, v) {
|
|
5690
|
+
o["default"] = v;
|
|
5691
|
+
});
|
|
5692
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
5693
|
+
if (mod && mod.__esModule) return mod;
|
|
5694
|
+
var result = {};
|
|
5695
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
5696
|
+
__setModuleDefault(result, mod);
|
|
5697
|
+
return result;
|
|
5698
|
+
};
|
|
4755
5699
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4756
5700
|
exports.polyRewindRings = exports.featureRewind = exports.polyTransform = exports.npoints = exports.polyDescribe = exports.polyCompactness = exports.makeConvexHullMonotoneChain2D = exports.polyConvexHull = exports.polyToExteriorPoints = exports.polyFromCircle = exports.polyToPolsbyPopperCircle = exports.polyToCircle = exports.Circle = exports.polyPerimeter = exports.polyDiameter = exports.polyArea = exports.polyNull = exports.polyNormalize = exports.polySimpleArea = exports.DefaultOptions = exports.EARTH_RADIUS = exports.DefaultTickOptions = void 0;
|
|
4757
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
4758
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
5701
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
5702
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
4759
5703
|
const graham_scan_1 = __webpack_require__(/*! ./graham-scan */ "./lib/poly/graham-scan.ts");
|
|
4760
5704
|
exports.DefaultTickOptions = { maxLeafCount: 256, maxDepth: 20, tickStep: 1 };
|
|
4761
5705
|
// Internal utilities
|
|
@@ -5365,14 +6309,33 @@ function twoTimesArea(x2, x1, y2, y1) {
|
|
|
5365
6309
|
/*!*****************************!*\
|
|
5366
6310
|
!*** ./lib/poly/polybin.ts ***!
|
|
5367
6311
|
\*****************************/
|
|
5368
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
6312
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5369
6313
|
|
|
5370
6314
|
|
|
6315
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6316
|
+
if (k2 === undefined) k2 = k;
|
|
6317
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
6318
|
+
}) : (function(o, m, k, k2) {
|
|
6319
|
+
if (k2 === undefined) k2 = k;
|
|
6320
|
+
o[k2] = m[k];
|
|
6321
|
+
}));
|
|
6322
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
6323
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6324
|
+
}) : function(o, v) {
|
|
6325
|
+
o["default"] = v;
|
|
6326
|
+
});
|
|
6327
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6328
|
+
if (mod && mod.__esModule) return mod;
|
|
6329
|
+
var result = {};
|
|
6330
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6331
|
+
__setModuleDefault(result, mod);
|
|
6332
|
+
return result;
|
|
6333
|
+
};
|
|
5371
6334
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5372
6335
|
exports.topoFromBuffer = exports.topoToBuffer = exports.unpackCollection = exports.packCollection = void 0;
|
|
5373
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
5374
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
5375
|
-
const T = __webpack_require__(/*! ./topo */ "./lib/poly/topo.ts");
|
|
6336
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
6337
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
6338
|
+
const T = __importStar(__webpack_require__(/*! ./topo */ "./lib/poly/topo.ts"));
|
|
5376
6339
|
// Packed Buffer format:
|
|
5377
6340
|
//
|
|
5378
6341
|
// (strings are packed as UTF8 bytes, padded to 4 byte boundary)
|
|
@@ -5415,9 +6378,11 @@ function unpackString(coder, buf8, buf32, offset) {
|
|
|
5415
6378
|
function packCollection(coder, col) {
|
|
5416
6379
|
// Compute size
|
|
5417
6380
|
let pp = PP.featurePack(col);
|
|
5418
|
-
let
|
|
6381
|
+
let f = col.features.find((f) => { return f.geometry.packed ? f.geometry.packed.buffer : null; });
|
|
6382
|
+
let buffer = f ? f.geometry.packed.buffer : null;
|
|
5419
6383
|
let size = 16; // int endiness, offset to coordinates, float endiness
|
|
5420
|
-
col.features.forEach((f) => {
|
|
6384
|
+
col.features.forEach((f) => { if (f.geometry.packed)
|
|
6385
|
+
delete f.geometry.packed.buffer; }); // reconstructed when unpacking
|
|
5421
6386
|
let j = JSON.stringify(col);
|
|
5422
6387
|
size += sizeOfString(coder, j);
|
|
5423
6388
|
size += pad(size, 8);
|
|
@@ -5443,7 +6408,8 @@ function packCollection(coder, col) {
|
|
|
5443
6408
|
for (let i = 0; i < pp.length; i++)
|
|
5444
6409
|
buf64[foff++] = buf[i];
|
|
5445
6410
|
// Now restore
|
|
5446
|
-
col.features.forEach((f) => { f.geometry.packed
|
|
6411
|
+
col.features.forEach((f) => { if (f.geometry.packed)
|
|
6412
|
+
f.geometry.packed.buffer = buffer; });
|
|
5447
6413
|
PP.featureUnpack(col);
|
|
5448
6414
|
return ab;
|
|
5449
6415
|
}
|
|
@@ -5495,7 +6461,8 @@ function unpackCollection(coder, ab) {
|
|
|
5495
6461
|
let offset = 16;
|
|
5496
6462
|
let j = unpackString(coder, buf8, buf32, offset);
|
|
5497
6463
|
col = JSON.parse(j);
|
|
5498
|
-
col.features.forEach((f) => { f.geometry.packed
|
|
6464
|
+
col.features.forEach((f) => { if (f.geometry.packed)
|
|
6465
|
+
f.geometry.packed.buffer = buf64; });
|
|
5499
6466
|
return col;
|
|
5500
6467
|
}
|
|
5501
6468
|
exports.unpackCollection = unpackCollection;
|
|
@@ -5570,14 +6537,36 @@ exports.topoFromBuffer = topoFromBuffer;
|
|
|
5570
6537
|
/*!*******************************!*\
|
|
5571
6538
|
!*** ./lib/poly/polylabel.ts ***!
|
|
5572
6539
|
\*******************************/
|
|
5573
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
6540
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5574
6541
|
|
|
5575
6542
|
|
|
6543
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6544
|
+
if (k2 === undefined) k2 = k;
|
|
6545
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
6546
|
+
}) : (function(o, m, k, k2) {
|
|
6547
|
+
if (k2 === undefined) k2 = k;
|
|
6548
|
+
o[k2] = m[k];
|
|
6549
|
+
}));
|
|
6550
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
6551
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6552
|
+
}) : function(o, v) {
|
|
6553
|
+
o["default"] = v;
|
|
6554
|
+
});
|
|
6555
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6556
|
+
if (mod && mod.__esModule) return mod;
|
|
6557
|
+
var result = {};
|
|
6558
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6559
|
+
__setModuleDefault(result, mod);
|
|
6560
|
+
return result;
|
|
6561
|
+
};
|
|
6562
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6563
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6564
|
+
};
|
|
5576
6565
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5577
6566
|
exports.polyLabel = void 0;
|
|
5578
|
-
const tinyqueue_1 = __webpack_require__(/*! tinyqueue */ "tinyqueue");
|
|
5579
|
-
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
5580
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
6567
|
+
const tinyqueue_1 = __importDefault(__webpack_require__(/*! tinyqueue */ "tinyqueue"));
|
|
6568
|
+
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
6569
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
5581
6570
|
//
|
|
5582
6571
|
// polyLabel: given polygon, return contained point furthest from any edge, and that distance
|
|
5583
6572
|
//
|
|
@@ -5743,13 +6732,32 @@ function getSegDistSq(px, py, ax, ay, bx, by) {
|
|
|
5743
6732
|
/*!******************************!*\
|
|
5744
6733
|
!*** ./lib/poly/polypack.ts ***!
|
|
5745
6734
|
\******************************/
|
|
5746
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
6735
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5747
6736
|
|
|
5748
6737
|
|
|
6738
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6739
|
+
if (k2 === undefined) k2 = k;
|
|
6740
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
6741
|
+
}) : (function(o, m, k, k2) {
|
|
6742
|
+
if (k2 === undefined) k2 = k;
|
|
6743
|
+
o[k2] = m[k];
|
|
6744
|
+
}));
|
|
6745
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
6746
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
6747
|
+
}) : function(o, v) {
|
|
6748
|
+
o["default"] = v;
|
|
6749
|
+
});
|
|
6750
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6751
|
+
if (mod && mod.__esModule) return mod;
|
|
6752
|
+
var result = {};
|
|
6753
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6754
|
+
__setModuleDefault(result, mod);
|
|
6755
|
+
return result;
|
|
6756
|
+
};
|
|
5749
6757
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5750
6758
|
exports.featureUnpackString = exports.featurePackString = exports.featureRepack = exports.featureUnpackTemporarily = exports.featureUnpack = exports.featurePack = exports.featurePackSize = exports.polyUnpack = exports.polyPackCopy = exports.polyPack = exports.polyPackTopoArcs = exports.countArcPoints = exports.countOneArcPoints = exports.countArcRings = exports.countArcPolygons = exports.normalizeArcs = exports.polyPacked = exports.polyPackCountPoints = exports.polyPackEachPoint = exports.polyPackEachRing = exports.polyPackSize = void 0;
|
|
5751
6759
|
// Shared libraries
|
|
5752
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
6760
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
5753
6761
|
function polyPackSize(coords) {
|
|
5754
6762
|
// Null feature?
|
|
5755
6763
|
if (coords == null || (coords.length !== undefined && coords.length == 0))
|
|
@@ -5949,7 +6957,9 @@ function polyPack(coords, prepack) {
|
|
|
5949
6957
|
coords = coords.geometry.coordinates;
|
|
5950
6958
|
// Transparently handle polygon or multi-polygon
|
|
5951
6959
|
let depth = Util.depthof(coords);
|
|
5952
|
-
if (depth ==
|
|
6960
|
+
if (depth == 2)
|
|
6961
|
+
coords = [[[coords]]];
|
|
6962
|
+
else if (depth == 3)
|
|
5953
6963
|
coords = [[coords]];
|
|
5954
6964
|
else if (depth == 4)
|
|
5955
6965
|
coords = [coords];
|
|
@@ -6036,14 +7046,16 @@ function polyUnpack(prepack) {
|
|
|
6036
7046
|
}
|
|
6037
7047
|
exports.polyUnpack = polyUnpack;
|
|
6038
7048
|
function featurePackSize(f) {
|
|
6039
|
-
if (f && f.geometry && f.geometry.coordinates)
|
|
7049
|
+
if (f && f.geometry && f.geometry.coordinates && f.geometry.type !== 'Point')
|
|
6040
7050
|
return polyPackSize(f.geometry.coordinates);
|
|
6041
7051
|
return 0;
|
|
6042
7052
|
}
|
|
6043
7053
|
exports.featurePackSize = featurePackSize;
|
|
6044
7054
|
function featurePack(f, prepack) {
|
|
6045
7055
|
if (f && f.type === 'Feature') {
|
|
6046
|
-
if (f.geometry && f.geometry.
|
|
7056
|
+
if (f.geometry && f.geometry.type === 'Point')
|
|
7057
|
+
return prepack ? { offset: prepack.offset, length: 0, buffer: prepack.buffer } : { offset: 0, length: 0, buffer: null };
|
|
7058
|
+
else if (f.geometry && f.geometry.coordinates) {
|
|
6047
7059
|
f.geometry.packed = polyPack(f.geometry.coordinates, prepack);
|
|
6048
7060
|
delete f.geometry.coordinates;
|
|
6049
7061
|
}
|
|
@@ -6076,9 +7088,16 @@ exports.featurePack = featurePack;
|
|
|
6076
7088
|
function featureUnpack(f) {
|
|
6077
7089
|
if (f && f.geometry && f.geometry.packed !== undefined) {
|
|
6078
7090
|
f.geometry.coordinates = polyUnpack(f.geometry.packed);
|
|
7091
|
+
let depth = Util.depthof(f.geometry.coordinates);
|
|
6079
7092
|
// Check for oops, optimized away the multipolygon in polyUnpack
|
|
6080
|
-
if (f.geometry.type === 'MultiPolygon' &&
|
|
7093
|
+
if (f.geometry.type === 'MultiPolygon' && depth === 4)
|
|
6081
7094
|
f.geometry.coordinates = [f.geometry.coordinates];
|
|
7095
|
+
else if (f.geometry.type === 'Point' && depth != 2) {
|
|
7096
|
+
while (depth > 2) {
|
|
7097
|
+
f.geometry.coordinates = f.geometry.coordinates[0];
|
|
7098
|
+
depth = Util.depthof(f.geometry.coordinates);
|
|
7099
|
+
}
|
|
7100
|
+
}
|
|
6082
7101
|
delete f.geometry.packed;
|
|
6083
7102
|
}
|
|
6084
7103
|
else if (f.type && f.type === 'FeatureCollection' && f.features) {
|
|
@@ -6153,13 +7172,32 @@ exports.featureUnpackString = featureUnpackString;
|
|
|
6153
7172
|
/*!*******************************!*\
|
|
6154
7173
|
!*** ./lib/poly/polyround.ts ***!
|
|
6155
7174
|
\*******************************/
|
|
6156
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
7175
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6157
7176
|
|
|
6158
7177
|
|
|
7178
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7179
|
+
if (k2 === undefined) k2 = k;
|
|
7180
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7181
|
+
}) : (function(o, m, k, k2) {
|
|
7182
|
+
if (k2 === undefined) k2 = k;
|
|
7183
|
+
o[k2] = m[k];
|
|
7184
|
+
}));
|
|
7185
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7186
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7187
|
+
}) : function(o, v) {
|
|
7188
|
+
o["default"] = v;
|
|
7189
|
+
});
|
|
7190
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7191
|
+
if (mod && mod.__esModule) return mod;
|
|
7192
|
+
var result = {};
|
|
7193
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7194
|
+
__setModuleDefault(result, mod);
|
|
7195
|
+
return result;
|
|
7196
|
+
};
|
|
6159
7197
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6160
7198
|
exports.polyRound = void 0;
|
|
6161
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
6162
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
7199
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
7200
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
6163
7201
|
// Round feature geometry to 6 decimal precision
|
|
6164
7202
|
function polyRound(o) {
|
|
6165
7203
|
if (o) {
|
|
@@ -6192,12 +7230,31 @@ exports.polyRound = polyRound;
|
|
|
6192
7230
|
/*!**********************************!*\
|
|
6193
7231
|
!*** ./lib/poly/polysimplify.ts ***!
|
|
6194
7232
|
\**********************************/
|
|
6195
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
7233
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6196
7234
|
|
|
6197
7235
|
|
|
7236
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7237
|
+
if (k2 === undefined) k2 = k;
|
|
7238
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7239
|
+
}) : (function(o, m, k, k2) {
|
|
7240
|
+
if (k2 === undefined) k2 = k;
|
|
7241
|
+
o[k2] = m[k];
|
|
7242
|
+
}));
|
|
7243
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7244
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7245
|
+
}) : function(o, v) {
|
|
7246
|
+
o["default"] = v;
|
|
7247
|
+
});
|
|
7248
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7249
|
+
if (mod && mod.__esModule) return mod;
|
|
7250
|
+
var result = {};
|
|
7251
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7252
|
+
__setModuleDefault(result, mod);
|
|
7253
|
+
return result;
|
|
7254
|
+
};
|
|
6198
7255
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6199
7256
|
exports.polySimplify = void 0;
|
|
6200
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
7257
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
6201
7258
|
const simplify_1 = __webpack_require__(/*! ./simplify */ "./lib/poly/simplify.ts");
|
|
6202
7259
|
function polySimplify(poly, tolerance = 0.0001) {
|
|
6203
7260
|
if (poly == null)
|
|
@@ -6226,21 +7283,40 @@ exports.polySimplify = polySimplify;
|
|
|
6226
7283
|
/*!**************************!*\
|
|
6227
7284
|
!*** ./lib/poly/quad.ts ***!
|
|
6228
7285
|
\**************************/
|
|
6229
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
7286
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6230
7287
|
|
|
6231
7288
|
|
|
7289
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7290
|
+
if (k2 === undefined) k2 = k;
|
|
7291
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7292
|
+
}) : (function(o, m, k, k2) {
|
|
7293
|
+
if (k2 === undefined) k2 = k;
|
|
7294
|
+
o[k2] = m[k];
|
|
7295
|
+
}));
|
|
7296
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7297
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7298
|
+
}) : function(o, v) {
|
|
7299
|
+
o["default"] = v;
|
|
7300
|
+
});
|
|
7301
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7302
|
+
if (mod && mod.__esModule) return mod;
|
|
7303
|
+
var result = {};
|
|
7304
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7305
|
+
__setModuleDefault(result, mod);
|
|
7306
|
+
return result;
|
|
7307
|
+
};
|
|
6232
7308
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6233
7309
|
exports.FsmQuadTree = exports.DefaultQuadOptions = exports.unionPolys = void 0;
|
|
6234
7310
|
// Public libraries
|
|
6235
|
-
const PC = __webpack_require__(/*! polygon-clipping */ "polygon-clipping");
|
|
7311
|
+
const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
|
|
6236
7312
|
// Shared libraries
|
|
6237
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
6238
|
-
const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
|
|
7313
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
7314
|
+
const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
|
|
6239
7315
|
// Local libraries
|
|
6240
|
-
const Poly = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
6241
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
6242
|
-
const BB = __webpack_require__(/*! ./boundbox */ "./lib/poly/boundbox.ts");
|
|
6243
|
-
const PR = __webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts");
|
|
7316
|
+
const Poly = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
7317
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
7318
|
+
const BB = __importStar(__webpack_require__(/*! ./boundbox */ "./lib/poly/boundbox.ts"));
|
|
7319
|
+
const PR = __importStar(__webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts"));
|
|
6244
7320
|
let _union = undefined;
|
|
6245
7321
|
let anyPC = PC;
|
|
6246
7322
|
if (anyPC.union)
|
|
@@ -6435,13 +7511,32 @@ exports.FsmQuadTree = FsmQuadTree;
|
|
|
6435
7511
|
/*!***********************************!*\
|
|
6436
7512
|
!*** ./lib/poly/selfintersect.ts ***!
|
|
6437
7513
|
\***********************************/
|
|
6438
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
7514
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6439
7515
|
|
|
6440
7516
|
|
|
7517
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7518
|
+
if (k2 === undefined) k2 = k;
|
|
7519
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7520
|
+
}) : (function(o, m, k, k2) {
|
|
7521
|
+
if (k2 === undefined) k2 = k;
|
|
7522
|
+
o[k2] = m[k];
|
|
7523
|
+
}));
|
|
7524
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7525
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7526
|
+
}) : function(o, v) {
|
|
7527
|
+
o["default"] = v;
|
|
7528
|
+
});
|
|
7529
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7530
|
+
if (mod && mod.__esModule) return mod;
|
|
7531
|
+
var result = {};
|
|
7532
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7533
|
+
__setModuleDefault(result, mod);
|
|
7534
|
+
return result;
|
|
7535
|
+
};
|
|
6441
7536
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6442
7537
|
exports.selfIntersect = void 0;
|
|
6443
|
-
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
6444
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
7538
|
+
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
7539
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
6445
7540
|
// Given three colinear points p, q, r, the function checks if
|
|
6446
7541
|
// point q lies on line segment 'pr'
|
|
6447
7542
|
function onSegment(px, py, qx, qy, rx, ry) {
|
|
@@ -6523,13 +7618,35 @@ exports.selfIntersect = selfIntersect;
|
|
|
6523
7618
|
/*!****************************!*\
|
|
6524
7619
|
!*** ./lib/poly/shamos.ts ***!
|
|
6525
7620
|
\****************************/
|
|
6526
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
7621
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6527
7622
|
|
|
6528
7623
|
|
|
7624
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7625
|
+
if (k2 === undefined) k2 = k;
|
|
7626
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7627
|
+
}) : (function(o, m, k, k2) {
|
|
7628
|
+
if (k2 === undefined) k2 = k;
|
|
7629
|
+
o[k2] = m[k];
|
|
7630
|
+
}));
|
|
7631
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7632
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7633
|
+
}) : function(o, v) {
|
|
7634
|
+
o["default"] = v;
|
|
7635
|
+
});
|
|
7636
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7637
|
+
if (mod && mod.__esModule) return mod;
|
|
7638
|
+
var result = {};
|
|
7639
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7640
|
+
__setModuleDefault(result, mod);
|
|
7641
|
+
return result;
|
|
7642
|
+
};
|
|
7643
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7644
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7645
|
+
};
|
|
6529
7646
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6530
7647
|
exports.selfIntersectFast = void 0;
|
|
6531
|
-
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
6532
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
7648
|
+
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
7649
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
6533
7650
|
// Adapted from rowanwins/shamos-hoey
|
|
6534
7651
|
/*
|
|
6535
7652
|
MIT License
|
|
@@ -6555,8 +7672,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
6555
7672
|
SOFTWARE.
|
|
6556
7673
|
*/
|
|
6557
7674
|
// External libraries
|
|
6558
|
-
const tinyqueue_1 = __webpack_require__(/*! tinyqueue */ "tinyqueue");
|
|
6559
|
-
const splaytree_1 = __webpack_require__(/*! splaytree */ "splaytree");
|
|
7675
|
+
const tinyqueue_1 = __importDefault(__webpack_require__(/*! tinyqueue */ "tinyqueue"));
|
|
7676
|
+
const splaytree_1 = __importDefault(__webpack_require__(/*! splaytree */ "splaytree"));
|
|
6560
7677
|
class Event {
|
|
6561
7678
|
constructor(x, y) {
|
|
6562
7679
|
this.x = x;
|
|
@@ -6853,22 +7970,41 @@ exports.simplify = simplify;
|
|
|
6853
7970
|
/*!**************************!*\
|
|
6854
7971
|
!*** ./lib/poly/topo.ts ***!
|
|
6855
7972
|
\**************************/
|
|
6856
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
7973
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6857
7974
|
|
|
6858
7975
|
|
|
7976
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7977
|
+
if (k2 === undefined) k2 = k;
|
|
7978
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7979
|
+
}) : (function(o, m, k, k2) {
|
|
7980
|
+
if (k2 === undefined) k2 = k;
|
|
7981
|
+
o[k2] = m[k];
|
|
7982
|
+
}));
|
|
7983
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7984
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
7985
|
+
}) : function(o, v) {
|
|
7986
|
+
o["default"] = v;
|
|
7987
|
+
});
|
|
7988
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7989
|
+
if (mod && mod.__esModule) return mod;
|
|
7990
|
+
var result = {};
|
|
7991
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7992
|
+
__setModuleDefault(result, mod);
|
|
7993
|
+
return result;
|
|
7994
|
+
};
|
|
6859
7995
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6860
7996
|
exports.topoUnpack = exports.topoPack = exports.topoPacked = exports.FsmTopoUnion = exports.topoMergeFeatures = exports.topoMerge = exports.topoSimplifyCollection = exports.topoToCollection = exports.topoToFeature = exports.topoContiguity = exports.topoFromCollection = void 0;
|
|
6861
7997
|
// Forked version that supports packing
|
|
6862
|
-
const TopoClient = __webpack_require__(/*! @dra2020/topojson-client */ "@dra2020/topojson-client");
|
|
7998
|
+
const TopoClient = __importStar(__webpack_require__(/*! @dra2020/topojson-client */ "@dra2020/topojson-client"));
|
|
6863
7999
|
// Forked version that fixes self-looping hole problem
|
|
6864
|
-
const TopoServer = __webpack_require__(/*! @dra2020/topojson-server */ "@dra2020/topojson-server");
|
|
8000
|
+
const TopoServer = __importStar(__webpack_require__(/*! @dra2020/topojson-server */ "@dra2020/topojson-server"));
|
|
6865
8001
|
// Forked version that fixes performance problem
|
|
6866
|
-
const TopoSimplify = __webpack_require__(/*! @dra2020/topojson-simplify */ "@dra2020/topojson-simplify");
|
|
6867
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
6868
|
-
const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
|
|
6869
|
-
const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
6870
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
6871
|
-
const PL = __webpack_require__(/*! ./polylabel */ "./lib/poly/polylabel.ts");
|
|
8002
|
+
const TopoSimplify = __importStar(__webpack_require__(/*! @dra2020/topojson-simplify */ "@dra2020/topojson-simplify"));
|
|
8003
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
8004
|
+
const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
|
|
8005
|
+
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
8006
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
8007
|
+
const PL = __importStar(__webpack_require__(/*! ./polylabel */ "./lib/poly/polylabel.ts"));
|
|
6872
8008
|
const shamos_1 = __webpack_require__(/*! ./shamos */ "./lib/poly/shamos.ts");
|
|
6873
8009
|
function getGEOID(f) {
|
|
6874
8010
|
if (f.features && f.features.length)
|
|
@@ -6912,24 +8048,19 @@ function ringsCancel(outerPoly, innerRing) {
|
|
|
6912
8048
|
function correctGeometry(f) {
|
|
6913
8049
|
if (f && f.geometry && f.geometry.type === 'MultiPolygon' && f.geometry.coordinates) {
|
|
6914
8050
|
let multiPoly = f.geometry.coordinates;
|
|
6915
|
-
/* Comment this out right now - might have been do to not rewinding merge output
|
|
6916
|
-
// topojson will under certain circumstances return a MultiPolygon with the first Polygon containing holes
|
|
6917
|
-
// that are precisely filled by a subsequent polygon. We make a secondary union pass to try to correct for this.
|
|
6918
|
-
// If we have a really degenerate multipolygon (test above some number of polygons) omit this expensive pass
|
|
6919
|
-
// since cleanup is unlikely.
|
|
6920
|
-
if (multiPoly.length > 1 && multiPoly.length < 50)
|
|
6921
|
-
{
|
|
6922
|
-
let result = Q.unionPolys(multiPoly);
|
|
6923
|
-
if (Util.depthof(result) == 4) result = [ result ];
|
|
6924
|
-
multiPoly = result;
|
|
6925
|
-
}
|
|
6926
|
-
*/
|
|
6927
8051
|
// Convert degenerate MultiPolygon to Polygon
|
|
6928
8052
|
if (multiPoly.length == 1) {
|
|
6929
8053
|
f.geometry.type = 'Polygon';
|
|
6930
8054
|
f.geometry.coordinates = multiPoly[0];
|
|
6931
8055
|
}
|
|
6932
8056
|
}
|
|
8057
|
+
if (f && f.geometry && f.geometry.type === 'Point' && f.geometry.coordinates) {
|
|
8058
|
+
while (Array.isArray(f.geometry.coordinates[0]))
|
|
8059
|
+
f.geometry.coordinates = f.geometry.coordinates[0];
|
|
8060
|
+
}
|
|
8061
|
+
else
|
|
8062
|
+
// TopoJSON does not guarantee proper winding order which messes up later processing. Fix it.
|
|
8063
|
+
P.featureRewind(f);
|
|
6933
8064
|
return f;
|
|
6934
8065
|
}
|
|
6935
8066
|
function topoContiguity(topo) {
|
|
@@ -7023,6 +8154,9 @@ function bigTimeString(ms) {
|
|
|
7023
8154
|
return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
|
7024
8155
|
}
|
|
7025
8156
|
const DefaultSimplifyOptions = { minArea: 500 };
|
|
8157
|
+
function log(s) {
|
|
8158
|
+
//console.log(s);
|
|
8159
|
+
}
|
|
7026
8160
|
//
|
|
7027
8161
|
// topoSimplifyCollection:
|
|
7028
8162
|
// This implements our simplification strategy for block/precinct level shapes. The basic idea is to
|
|
@@ -7045,10 +8179,10 @@ function topoSimplifyCollection(col, options) {
|
|
|
7045
8179
|
let elapsedTotal = new Util.Elapsed();
|
|
7046
8180
|
let elapsed = new Util.Elapsed();
|
|
7047
8181
|
let topo = topoFromCollection(col);
|
|
7048
|
-
|
|
8182
|
+
log(`topoSimplifyCollection: fromCollection: ${Math.round(elapsed.ms())}ms`);
|
|
7049
8183
|
elapsed.start();
|
|
7050
8184
|
topo = TopoSimplify.presimplify(topo, TopoSimplify['sphericalTriangleArea']);
|
|
7051
|
-
|
|
8185
|
+
log(`topoSimplifyCollection: presimplify: ${Math.round(elapsed.ms())}ms`);
|
|
7052
8186
|
elapsed.start();
|
|
7053
8187
|
// Keep iterating on removing simplification from degenerate shapes
|
|
7054
8188
|
let nTries = 1;
|
|
@@ -7065,6 +8199,9 @@ function topoSimplifyCollection(col, options) {
|
|
|
7065
8199
|
col.features.forEach((f) => {
|
|
7066
8200
|
let oOld = topo.objects[f.properties.id];
|
|
7067
8201
|
let oNew = testtopo.objects[f.properties.id];
|
|
8202
|
+
// Ignore points
|
|
8203
|
+
if (f.geometry && f.geometry.type === 'Point')
|
|
8204
|
+
keepTiny.set(f, f);
|
|
7068
8205
|
if (!keepTiny.has(f)) {
|
|
7069
8206
|
// Walk through each polygon of a multipolygon separately since I may have a large non-degenerate
|
|
7070
8207
|
// shape combined with degenerate smaller shapes that I want to identify. I do not examine holes
|
|
@@ -7104,11 +8241,11 @@ function topoSimplifyCollection(col, options) {
|
|
|
7104
8241
|
}
|
|
7105
8242
|
}
|
|
7106
8243
|
});
|
|
7107
|
-
|
|
8244
|
+
log(`topoSimplifyCollection: pass ${nTries}: ${nBad} (${nTiny} tiny) of ${col.features.length} features are degenerate`);
|
|
7108
8245
|
// If not making progress, keep more points
|
|
7109
8246
|
if (nBad >= nBadLast) {
|
|
7110
8247
|
keepweight /= 10;
|
|
7111
|
-
|
|
8248
|
+
log(`topoSimplifyCollection: pass ${nTries}: reducing weight limit to ${keepweight}`);
|
|
7112
8249
|
}
|
|
7113
8250
|
nBadLast = nBad;
|
|
7114
8251
|
if (nBad && nTries > MAX_TRIES)
|
|
@@ -7120,7 +8257,7 @@ function topoSimplifyCollection(col, options) {
|
|
|
7120
8257
|
}
|
|
7121
8258
|
nTries++;
|
|
7122
8259
|
}
|
|
7123
|
-
|
|
8260
|
+
log(`topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
|
|
7124
8261
|
return col;
|
|
7125
8262
|
}
|
|
7126
8263
|
exports.topoSimplifyCollection = topoSimplifyCollection;
|
|
@@ -7129,27 +8266,7 @@ function topoMerge(topo, geoids) {
|
|
|
7129
8266
|
return null;
|
|
7130
8267
|
let objects = [];
|
|
7131
8268
|
geoids.forEach((geoid) => objects.push(topo.objects[geoid]));
|
|
7132
|
-
|
|
7133
|
-
P.featureRewind(f);
|
|
7134
|
-
/* Comment out for now - may be due to merge output needing to be rewound
|
|
7135
|
-
// If I get a bad output from topoMerge, just do more expensive poly union. This can happen if input polygons
|
|
7136
|
-
// are a little funky (in particular, if they double back along the same edge.
|
|
7137
|
-
if (selfIntersectFast(f))
|
|
7138
|
-
{
|
|
7139
|
-
//console.log('topoMerge: patching selfIntersect');
|
|
7140
|
-
let polys: any[] = [];
|
|
7141
|
-
geoids.forEach((geoid) => polys.push(topoToFeature(topo, geoid).geometry.coordinates));
|
|
7142
|
-
let result = Q.unionPolys(polys);
|
|
7143
|
-
let depth = Util.depthof(result);
|
|
7144
|
-
if (depth === 5 && result.length === 1)
|
|
7145
|
-
{
|
|
7146
|
-
depth = 4;
|
|
7147
|
-
result = result[0];
|
|
7148
|
-
}
|
|
7149
|
-
f = { type: 'feature', properties: {}, geometry: { type: depth == 4 ? 'Polygon' : 'MultiPolygon', coordinates: result } };
|
|
7150
|
-
}
|
|
7151
|
-
*/
|
|
7152
|
-
return f;
|
|
8269
|
+
return correctGeometry({ type: 'Feature', properties: {}, geometry: TopoClient.merge(topo, objects) });
|
|
7153
8270
|
}
|
|
7154
8271
|
exports.topoMerge = topoMerge;
|
|
7155
8272
|
function topoMergeFeatures(topo, features) {
|
|
@@ -7187,7 +8304,7 @@ class FsmIncrementalUnion extends FSM.Fsm {
|
|
|
7187
8304
|
let values = Object.values(map);
|
|
7188
8305
|
this.work = { nUnion: values.length, nDifference: 0, ms: 0 };
|
|
7189
8306
|
let elapsed = new Util.Elapsed();
|
|
7190
|
-
this.result = topoMergeFeatures(this.key.
|
|
8307
|
+
this.result = topoMergeFeatures(this.key.multi.allTopo(), values);
|
|
7191
8308
|
this.work.ms = elapsed.ms();
|
|
7192
8309
|
this.map = map;
|
|
7193
8310
|
}
|
|
@@ -7290,18 +8407,37 @@ exports.topoUnpack = topoUnpack;
|
|
|
7290
8407
|
/*!***************************!*\
|
|
7291
8408
|
!*** ./lib/poly/union.ts ***!
|
|
7292
8409
|
\***************************/
|
|
7293
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
8410
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
7294
8411
|
|
|
7295
8412
|
|
|
8413
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8414
|
+
if (k2 === undefined) k2 = k;
|
|
8415
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
8416
|
+
}) : (function(o, m, k, k2) {
|
|
8417
|
+
if (k2 === undefined) k2 = k;
|
|
8418
|
+
o[k2] = m[k];
|
|
8419
|
+
}));
|
|
8420
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
8421
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
8422
|
+
}) : function(o, v) {
|
|
8423
|
+
o["default"] = v;
|
|
8424
|
+
});
|
|
8425
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
8426
|
+
if (mod && mod.__esModule) return mod;
|
|
8427
|
+
var result = {};
|
|
8428
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
8429
|
+
__setModuleDefault(result, mod);
|
|
8430
|
+
return result;
|
|
8431
|
+
};
|
|
7296
8432
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7297
|
-
exports.FsmUnion = exports.polyIntersects = void 0;
|
|
7298
|
-
const PC = __webpack_require__(/*! polygon-clipping */ "polygon-clipping");
|
|
7299
|
-
const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
|
|
7300
|
-
const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
|
|
7301
|
-
const Poly = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
7302
|
-
const Q = __webpack_require__(/*! ./quad */ "./lib/poly/quad.ts");
|
|
7303
|
-
const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
|
|
7304
|
-
const PR = __webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts");
|
|
8433
|
+
exports.FsmUnion = exports.polyDifference = exports.polyIntersects = void 0;
|
|
8434
|
+
const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
|
|
8435
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
8436
|
+
const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
|
|
8437
|
+
const Poly = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
8438
|
+
const Q = __importStar(__webpack_require__(/*! ./quad */ "./lib/poly/quad.ts"));
|
|
8439
|
+
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
8440
|
+
const PR = __importStar(__webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts"));
|
|
7305
8441
|
// Confusion on how polygon-clipping exposes its interface - be flexible
|
|
7306
8442
|
let _union = undefined;
|
|
7307
8443
|
let _difference = undefined;
|
|
@@ -7353,6 +8489,20 @@ function polyIntersects(p1, p2) {
|
|
|
7353
8489
|
return bIntersects;
|
|
7354
8490
|
}
|
|
7355
8491
|
exports.polyIntersects = polyIntersects;
|
|
8492
|
+
function polyDifference(main, parts) {
|
|
8493
|
+
main = PP.polyUnpack(coords(main));
|
|
8494
|
+
// need to explode multipolygon so that "exploded" is a valid multipolygon input to underlying difference routine
|
|
8495
|
+
let exploded = [];
|
|
8496
|
+
parts.forEach((p) => {
|
|
8497
|
+
p = PP.polyUnpack(coords(p));
|
|
8498
|
+
if (Util.depthof(p) == 5)
|
|
8499
|
+
p.forEach((poly) => { exploded.push(poly); });
|
|
8500
|
+
else
|
|
8501
|
+
exploded.push(p);
|
|
8502
|
+
});
|
|
8503
|
+
return PR.polyRound(_difference(main, exploded));
|
|
8504
|
+
}
|
|
8505
|
+
exports.polyDifference = polyDifference;
|
|
7356
8506
|
class FsmDifference extends FSM.Fsm {
|
|
7357
8507
|
constructor(env, accum, polys) {
|
|
7358
8508
|
super(env);
|
|
@@ -8984,7 +10134,7 @@ module.exports = require("tinyqueue");;
|
|
|
8984
10134
|
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
|
8985
10135
|
/******/ // startup
|
|
8986
10136
|
/******/ // Load entry module and return exports
|
|
8987
|
-
/******/ return __webpack_require__("./lib/all/
|
|
10137
|
+
/******/ return __webpack_require__("./lib/all/all.ts");
|
|
8988
10138
|
/******/ })()
|
|
8989
10139
|
;
|
|
8990
10140
|
});
|