@dra2020/baseclient 1.0.157 → 1.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baseclient.js +867 -489
- package/dist/baseclient.js.map +1 -1
- package/lib/geo/geo.ts +2 -0
- package/lib/util/util.ts +13 -1
- package/package.json +4 -4
package/dist/baseclient.js
CHANGED
|
@@ -35,13 +35,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
35
35
|
}) : function(o, v) {
|
|
36
36
|
o["default"] = v;
|
|
37
37
|
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
38
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
39
|
+
var ownKeys = function(o) {
|
|
40
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
41
|
+
var ar = [];
|
|
42
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
43
|
+
return ar;
|
|
44
|
+
};
|
|
45
|
+
return ownKeys(o);
|
|
46
|
+
};
|
|
47
|
+
return function (mod) {
|
|
48
|
+
if (mod && mod.__esModule) return mod;
|
|
49
|
+
var result = {};
|
|
50
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
45
55
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
46
56
|
exports.Detail = exports.DataFlow = exports.Colors = exports.CSV = exports.Emit = exports.G = exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
|
|
47
57
|
// Client and Server
|
|
@@ -102,15 +112,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
102
112
|
}) : function(o, v) {
|
|
103
113
|
o["default"] = v;
|
|
104
114
|
});
|
|
105
|
-
var __importStar = (this && this.__importStar) || function (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
};
|
|
115
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
116
|
+
var ownKeys = function(o) {
|
|
117
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
118
|
+
var ar = [];
|
|
119
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
120
|
+
return ar;
|
|
121
|
+
};
|
|
122
|
+
return ownKeys(o);
|
|
123
|
+
};
|
|
124
|
+
return function (mod) {
|
|
125
|
+
if (mod && mod.__esModule) return mod;
|
|
126
|
+
var result = {};
|
|
127
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
128
|
+
__setModuleDefault(result, mod);
|
|
129
|
+
return result;
|
|
130
|
+
};
|
|
131
|
+
})();
|
|
112
132
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
113
|
-
exports.
|
|
133
|
+
exports.defaultDistrictsPalette = exports.EthnicBackgroundColor = exports.CountEthnicBackgroundColor = exports.PartisanDistrictClassicColors = exports.CountPartisanDistrictClassicColors = exports.PartisanPrecinctClassicColors = exports.CountPartisanPrecinctClassicColors = exports.EthnicFewClassicColors = exports.CountEthnicFewClassicColors = exports.ColorValues = exports.DefaultColorNames = exports.MaxClassicColors = exports.MaxColors = exports.MaxOrderedColors = void 0;
|
|
134
|
+
exports.genColor = genColor;
|
|
135
|
+
exports.orderedColors = orderedColors;
|
|
136
|
+
exports.getPalette = getPalette;
|
|
114
137
|
const JsColorMapsData = __importStar(__webpack_require__(/*! ./jscolormapsdata */ "./lib/colors/jscolormapsdata.ts"));
|
|
115
138
|
const all_1 = __webpack_require__(/*! ../all/all */ "./lib/all/all.ts");
|
|
116
139
|
exports.MaxOrderedColors = 50;
|
|
@@ -392,7 +415,6 @@ function genColor(i, useFirstColor, palette) {
|
|
|
392
415
|
// Unexpected to get here, but something in case of an error
|
|
393
416
|
return genDRAColor(i, useFirstColor);
|
|
394
417
|
}
|
|
395
|
-
exports.genColor = genColor;
|
|
396
418
|
// DRA classic color palette
|
|
397
419
|
function genDRAColor(i, useFirstColor) {
|
|
398
420
|
// i is district number, 0 => District[0] (unassigned), so subtract 1 to access ColorTable
|
|
@@ -425,7 +447,6 @@ function orderedColors(palette) {
|
|
|
425
447
|
}
|
|
426
448
|
return OrderedColorTable[palette];
|
|
427
449
|
}
|
|
428
|
-
exports.orderedColors = orderedColors;
|
|
429
450
|
function getPalette(palette) {
|
|
430
451
|
if (palette === 'draclassic') {
|
|
431
452
|
// return draclassic palette with only 50 colors
|
|
@@ -436,7 +457,6 @@ function getPalette(palette) {
|
|
|
436
457
|
}
|
|
437
458
|
return getColorTable(palette);
|
|
438
459
|
}
|
|
439
|
-
exports.getPalette = getPalette;
|
|
440
460
|
// Generate table for palette
|
|
441
461
|
function getColorTable(palette) {
|
|
442
462
|
if (palette === 'demographicsclassic') {
|
|
@@ -795,15 +815,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
795
815
|
}) : function(o, v) {
|
|
796
816
|
o["default"] = v;
|
|
797
817
|
});
|
|
798
|
-
var __importStar = (this && this.__importStar) || function (
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
};
|
|
818
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
819
|
+
var ownKeys = function(o) {
|
|
820
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
821
|
+
var ar = [];
|
|
822
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
823
|
+
return ar;
|
|
824
|
+
};
|
|
825
|
+
return ownKeys(o);
|
|
826
|
+
};
|
|
827
|
+
return function (mod) {
|
|
828
|
+
if (mod && mod.__esModule) return mod;
|
|
829
|
+
var result = {};
|
|
830
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
831
|
+
__setModuleDefault(result, mod);
|
|
832
|
+
return result;
|
|
833
|
+
};
|
|
834
|
+
})();
|
|
805
835
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
806
|
-
exports.create =
|
|
836
|
+
exports.create = create;
|
|
807
837
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
808
838
|
class Context {
|
|
809
839
|
constructor() {
|
|
@@ -852,7 +882,6 @@ class Context {
|
|
|
852
882
|
function create() {
|
|
853
883
|
return new Context();
|
|
854
884
|
}
|
|
855
|
-
exports.create = create;
|
|
856
885
|
|
|
857
886
|
|
|
858
887
|
/***/ }),
|
|
@@ -908,13 +937,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
908
937
|
}) : function(o, v) {
|
|
909
938
|
o["default"] = v;
|
|
910
939
|
});
|
|
911
|
-
var __importStar = (this && this.__importStar) || function (
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
};
|
|
940
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
941
|
+
var ownKeys = function(o) {
|
|
942
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
943
|
+
var ar = [];
|
|
944
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
945
|
+
return ar;
|
|
946
|
+
};
|
|
947
|
+
return ownKeys(o);
|
|
948
|
+
};
|
|
949
|
+
return function (mod) {
|
|
950
|
+
if (mod && mod.__esModule) return mod;
|
|
951
|
+
var result = {};
|
|
952
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
953
|
+
__setModuleDefault(result, mod);
|
|
954
|
+
return result;
|
|
955
|
+
};
|
|
956
|
+
})();
|
|
918
957
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
919
958
|
exports.ParseOne = exports.ParseMany = void 0;
|
|
920
959
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -1060,7 +1099,7 @@ exports.ParseOne = ParseOne;
|
|
|
1060
1099
|
|
|
1061
1100
|
|
|
1062
1101
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1063
|
-
exports.csvParseLine =
|
|
1102
|
+
exports.csvParseLine = csvParseLine;
|
|
1064
1103
|
const reField = /^\s*("([^"]*(?:""[^"]*)*)"|[^,|]*)\s*[|,]?/;
|
|
1065
1104
|
const reQuote = /^"/;
|
|
1066
1105
|
const reAddOne = /[|,]$/;
|
|
@@ -1089,7 +1128,6 @@ function csvParseLine(s) {
|
|
|
1089
1128
|
fields.push('');
|
|
1090
1129
|
return fields;
|
|
1091
1130
|
}
|
|
1092
|
-
exports.csvParseLine = csvParseLine;
|
|
1093
1131
|
|
|
1094
1132
|
|
|
1095
1133
|
/***/ }),
|
|
@@ -1278,13 +1316,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
1278
1316
|
}) : function(o, v) {
|
|
1279
1317
|
o["default"] = v;
|
|
1280
1318
|
});
|
|
1281
|
-
var __importStar = (this && this.__importStar) || function (
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
};
|
|
1319
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
1320
|
+
var ownKeys = function(o) {
|
|
1321
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
1322
|
+
var ar = [];
|
|
1323
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
1324
|
+
return ar;
|
|
1325
|
+
};
|
|
1326
|
+
return ownKeys(o);
|
|
1327
|
+
};
|
|
1328
|
+
return function (mod) {
|
|
1329
|
+
if (mod && mod.__esModule) return mod;
|
|
1330
|
+
var result = {};
|
|
1331
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
1332
|
+
__setModuleDefault(result, mod);
|
|
1333
|
+
return result;
|
|
1334
|
+
};
|
|
1335
|
+
})();
|
|
1288
1336
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1289
1337
|
exports.FormatDetail = void 0;
|
|
1290
1338
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -1549,13 +1597,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
1549
1597
|
}) : function(o, v) {
|
|
1550
1598
|
o["default"] = v;
|
|
1551
1599
|
});
|
|
1552
|
-
var __importStar = (this && this.__importStar) || function (
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
};
|
|
1600
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
1601
|
+
var ownKeys = function(o) {
|
|
1602
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
1603
|
+
var ar = [];
|
|
1604
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
1605
|
+
return ar;
|
|
1606
|
+
};
|
|
1607
|
+
return ownKeys(o);
|
|
1608
|
+
};
|
|
1609
|
+
return function (mod) {
|
|
1610
|
+
if (mod && mod.__esModule) return mod;
|
|
1611
|
+
var result = {};
|
|
1612
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
1613
|
+
__setModuleDefault(result, mod);
|
|
1614
|
+
return result;
|
|
1615
|
+
};
|
|
1616
|
+
})();
|
|
1559
1617
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1560
1618
|
exports.FilterExpr = void 0;
|
|
1561
1619
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -2202,13 +2260,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
2202
2260
|
}) : function(o, v) {
|
|
2203
2261
|
o["default"] = v;
|
|
2204
2262
|
});
|
|
2205
|
-
var __importStar = (this && this.__importStar) || function (
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
};
|
|
2263
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
2264
|
+
var ownKeys = function(o) {
|
|
2265
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
2266
|
+
var ar = [];
|
|
2267
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
2268
|
+
return ar;
|
|
2269
|
+
};
|
|
2270
|
+
return ownKeys(o);
|
|
2271
|
+
};
|
|
2272
|
+
return function (mod) {
|
|
2273
|
+
if (mod && mod.__esModule) return mod;
|
|
2274
|
+
var result = {};
|
|
2275
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
2276
|
+
__setModuleDefault(result, mod);
|
|
2277
|
+
return result;
|
|
2278
|
+
};
|
|
2279
|
+
})();
|
|
2212
2280
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2213
2281
|
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_CANCEL = exports.FSM_ERROR = exports.FSM_DONE = exports.FSM_PENDING = exports.FSM_STARTING = void 0;
|
|
2214
2282
|
// Shared libraries
|
|
@@ -2630,15 +2698,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
2630
2698
|
}) : function(o, v) {
|
|
2631
2699
|
o["default"] = v;
|
|
2632
2700
|
});
|
|
2633
|
-
var __importStar = (this && this.__importStar) || function (
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
};
|
|
2701
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
2702
|
+
var ownKeys = function(o) {
|
|
2703
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
2704
|
+
var ar = [];
|
|
2705
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
2706
|
+
return ar;
|
|
2707
|
+
};
|
|
2708
|
+
return ownKeys(o);
|
|
2709
|
+
};
|
|
2710
|
+
return function (mod) {
|
|
2711
|
+
if (mod && mod.__esModule) return mod;
|
|
2712
|
+
var result = {};
|
|
2713
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
2714
|
+
__setModuleDefault(result, mod);
|
|
2715
|
+
return result;
|
|
2716
|
+
};
|
|
2717
|
+
})();
|
|
2640
2718
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2641
|
-
exports.
|
|
2719
|
+
exports.ensureCentroidInFeature = ensureCentroidInFeature;
|
|
2720
|
+
exports.ensureCentroidInCollection = ensureCentroidInCollection;
|
|
2642
2721
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
2643
2722
|
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
2644
2723
|
function oneNumberOf(f, props) {
|
|
@@ -2672,11 +2751,9 @@ function ensureCentroidInFeature(f) {
|
|
|
2672
2751
|
delete f.properties.INTPTLON;
|
|
2673
2752
|
}
|
|
2674
2753
|
}
|
|
2675
|
-
exports.ensureCentroidInFeature = ensureCentroidInFeature;
|
|
2676
2754
|
function ensureCentroidInCollection(col) {
|
|
2677
2755
|
col.features.forEach(ensureCentroidInFeature);
|
|
2678
2756
|
}
|
|
2679
|
-
exports.ensureCentroidInCollection = ensureCentroidInCollection;
|
|
2680
2757
|
|
|
2681
2758
|
|
|
2682
2759
|
/***/ }),
|
|
@@ -2689,7 +2766,7 @@ exports.ensureCentroidInCollection = ensureCentroidInCollection;
|
|
|
2689
2766
|
|
|
2690
2767
|
|
|
2691
2768
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2692
|
-
exports.flexName =
|
|
2769
|
+
exports.flexName = flexName;
|
|
2693
2770
|
function flexName(f) {
|
|
2694
2771
|
if (!f || !f.properties)
|
|
2695
2772
|
return null;
|
|
@@ -2713,7 +2790,6 @@ function flexName(f) {
|
|
|
2713
2790
|
}
|
|
2714
2791
|
return `${f.properties.id}`;
|
|
2715
2792
|
}
|
|
2716
|
-
exports.flexName = flexName;
|
|
2717
2793
|
|
|
2718
2794
|
|
|
2719
2795
|
/***/ }),
|
|
@@ -2741,15 +2817,42 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
2741
2817
|
}) : function(o, v) {
|
|
2742
2818
|
o["default"] = v;
|
|
2743
2819
|
});
|
|
2744
|
-
var __importStar = (this && this.__importStar) || function (
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
};
|
|
2820
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
2821
|
+
var ownKeys = function(o) {
|
|
2822
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
2823
|
+
var ar = [];
|
|
2824
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
2825
|
+
return ar;
|
|
2826
|
+
};
|
|
2827
|
+
return ownKeys(o);
|
|
2828
|
+
};
|
|
2829
|
+
return function (mod) {
|
|
2830
|
+
if (mod && mod.__esModule) return mod;
|
|
2831
|
+
var result = {};
|
|
2832
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
2833
|
+
__setModuleDefault(result, mod);
|
|
2834
|
+
return result;
|
|
2835
|
+
};
|
|
2836
|
+
})();
|
|
2751
2837
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2752
|
-
exports.
|
|
2838
|
+
exports.geoIntersectOptions = exports.GeoMultiCollection = void 0;
|
|
2839
|
+
exports.dumpMetrics = dumpMetrics;
|
|
2840
|
+
exports.hidemapConcat = hidemapConcat;
|
|
2841
|
+
exports.applyCanonicalID = applyCanonicalID;
|
|
2842
|
+
exports.isValidId = isValidId;
|
|
2843
|
+
exports.geoEnsureID = geoEnsureID;
|
|
2844
|
+
exports.geoNormalizeFeature = geoNormalizeFeature;
|
|
2845
|
+
exports.geoNormalizeCollection = geoNormalizeCollection;
|
|
2846
|
+
exports.geoCollectionToMap = geoCollectionToMap;
|
|
2847
|
+
exports.geoMapToCollection = geoMapToCollection;
|
|
2848
|
+
exports.geoMapToCollectionNonNull = geoMapToCollectionNonNull;
|
|
2849
|
+
exports.geoCollectionToTopo = geoCollectionToTopo;
|
|
2850
|
+
exports.geoCollectionToTopoNonNull = geoCollectionToTopoNonNull;
|
|
2851
|
+
exports.geoTopoToCollection = geoTopoToCollection;
|
|
2852
|
+
exports.geoTopoToCollectionNonNull = geoTopoToCollectionNonNull;
|
|
2853
|
+
exports.geoEqual = geoEqual;
|
|
2854
|
+
exports.geoMapEqual = geoMapEqual;
|
|
2855
|
+
exports.geoIntersect = geoIntersect;
|
|
2753
2856
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
2754
2857
|
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
2755
2858
|
// Tracing/debugging aid
|
|
@@ -2765,7 +2868,6 @@ function dumpMetrics() {
|
|
|
2765
2868
|
console.log(`G.${action}: count: ${metrics[action].count}, total: ${metrics[action].total}`);
|
|
2766
2869
|
});
|
|
2767
2870
|
}
|
|
2768
|
-
exports.dumpMetrics = dumpMetrics;
|
|
2769
2871
|
function hidemapConcat(...args) {
|
|
2770
2872
|
let hm = {};
|
|
2771
2873
|
for (let i = 0; i < args.length; i++)
|
|
@@ -2773,13 +2875,11 @@ function hidemapConcat(...args) {
|
|
|
2773
2875
|
Object.keys(args[i]).forEach(id => hm[id] = true);
|
|
2774
2876
|
return hm;
|
|
2775
2877
|
}
|
|
2776
|
-
exports.hidemapConcat = hidemapConcat;
|
|
2777
2878
|
const NormalizeAll = { joinPolygons: true, checkRewind: true, ensureID: true };
|
|
2778
2879
|
function applyCanonicalID(col) {
|
|
2779
2880
|
if (col && Array.isArray(col.features))
|
|
2780
2881
|
col.features.forEach((f, n) => { f.properties.id = String(n + 1); });
|
|
2781
2882
|
}
|
|
2782
|
-
exports.applyCanonicalID = applyCanonicalID;
|
|
2783
2883
|
function isValidId(col) {
|
|
2784
2884
|
if (!col || !Array.isArray(col.features))
|
|
2785
2885
|
return true;
|
|
@@ -2796,7 +2896,6 @@ function isValidId(col) {
|
|
|
2796
2896
|
}
|
|
2797
2897
|
return true;
|
|
2798
2898
|
}
|
|
2799
|
-
exports.isValidId = isValidId;
|
|
2800
2899
|
// set the canonical 'id' property from the best property value.
|
|
2801
2900
|
// if joinPolygons is true, we do not enforce uniqueness.
|
|
2802
2901
|
//
|
|
@@ -2825,14 +2924,12 @@ function geoEnsureID(col, options) {
|
|
|
2825
2924
|
applyCanonicalID(col);
|
|
2826
2925
|
}
|
|
2827
2926
|
}
|
|
2828
|
-
exports.geoEnsureID = geoEnsureID;
|
|
2829
2927
|
function geoNormalizeFeature(f, options) {
|
|
2830
2928
|
options = Util.shallowAssignImmutable({}, options);
|
|
2831
2929
|
if (options.checkRewind)
|
|
2832
2930
|
Poly.featureRewind(f);
|
|
2833
2931
|
return f;
|
|
2834
2932
|
}
|
|
2835
|
-
exports.geoNormalizeFeature = geoNormalizeFeature;
|
|
2836
2933
|
function onlyPolygons(col) {
|
|
2837
2934
|
if (col && Array.isArray(col.features))
|
|
2838
2935
|
for (let i = 0; i < col.features.length; i++) {
|
|
@@ -2884,7 +2981,6 @@ function geoNormalizeCollection(col, options) {
|
|
|
2884
2981
|
}
|
|
2885
2982
|
return col;
|
|
2886
2983
|
}
|
|
2887
|
-
exports.geoNormalizeCollection = geoNormalizeCollection;
|
|
2888
2984
|
function geoCollectionToMap(col) {
|
|
2889
2985
|
if (col == null)
|
|
2890
2986
|
return null;
|
|
@@ -2892,13 +2988,11 @@ function geoCollectionToMap(col) {
|
|
|
2892
2988
|
col.features.forEach((f) => { map[String(f.properties.id)] = f; });
|
|
2893
2989
|
return map;
|
|
2894
2990
|
}
|
|
2895
|
-
exports.geoCollectionToMap = geoCollectionToMap;
|
|
2896
2991
|
function geoMapToCollection(map) {
|
|
2897
2992
|
if (Util.countKeys(map) == 0)
|
|
2898
2993
|
return null;
|
|
2899
2994
|
return geoMapToCollectionNonNull(map);
|
|
2900
2995
|
}
|
|
2901
|
-
exports.geoMapToCollection = geoMapToCollection;
|
|
2902
2996
|
function geoMapToCollectionNonNull(map) {
|
|
2903
2997
|
if (map == null)
|
|
2904
2998
|
return null;
|
|
@@ -2906,7 +3000,6 @@ function geoMapToCollectionNonNull(map) {
|
|
|
2906
3000
|
Object.keys(map).forEach((geoid) => { col.features.push(map[geoid]); });
|
|
2907
3001
|
return col;
|
|
2908
3002
|
}
|
|
2909
|
-
exports.geoMapToCollectionNonNull = geoMapToCollectionNonNull;
|
|
2910
3003
|
function geoCollectionToTopo(col) {
|
|
2911
3004
|
let topo = Poly.topoFromCollection(col);
|
|
2912
3005
|
Poly.topoPack(topo);
|
|
@@ -2915,11 +3008,9 @@ function geoCollectionToTopo(col) {
|
|
|
2915
3008
|
topo.datasets = col.datasets;
|
|
2916
3009
|
return topo;
|
|
2917
3010
|
}
|
|
2918
|
-
exports.geoCollectionToTopo = geoCollectionToTopo;
|
|
2919
3011
|
function geoCollectionToTopoNonNull(col) {
|
|
2920
3012
|
return geoCollectionToTopo(col);
|
|
2921
3013
|
}
|
|
2922
|
-
exports.geoCollectionToTopoNonNull = geoCollectionToTopoNonNull;
|
|
2923
3014
|
function geoTopoToCollection(topo) {
|
|
2924
3015
|
let col = Poly.topoToCollection(topo);
|
|
2925
3016
|
Poly.featurePack(col);
|
|
@@ -2928,11 +3019,9 @@ function geoTopoToCollection(topo) {
|
|
|
2928
3019
|
col.datasets = topo.datasets;
|
|
2929
3020
|
return col;
|
|
2930
3021
|
}
|
|
2931
|
-
exports.geoTopoToCollection = geoTopoToCollection;
|
|
2932
3022
|
function geoTopoToCollectionNonNull(topo) {
|
|
2933
3023
|
return geoTopoToCollection(topo);
|
|
2934
3024
|
}
|
|
2935
|
-
exports.geoTopoToCollectionNonNull = geoTopoToCollectionNonNull;
|
|
2936
3025
|
function geoEqual(m1, m2) {
|
|
2937
3026
|
let n1 = m1 ? m1.length : 0;
|
|
2938
3027
|
let n2 = m2 ? m2.length : 0;
|
|
@@ -2946,7 +3035,6 @@ function geoEqual(m1, m2) {
|
|
|
2946
3035
|
eq = false; });
|
|
2947
3036
|
return eq;
|
|
2948
3037
|
}
|
|
2949
|
-
exports.geoEqual = geoEqual;
|
|
2950
3038
|
function geoMapEqual(m1, m2) {
|
|
2951
3039
|
if (m1 == null)
|
|
2952
3040
|
return Util.isEmpty(m2);
|
|
@@ -2963,7 +3051,6 @@ function geoMapEqual(m1, m2) {
|
|
|
2963
3051
|
return false;
|
|
2964
3052
|
return true;
|
|
2965
3053
|
}
|
|
2966
|
-
exports.geoMapEqual = geoMapEqual;
|
|
2967
3054
|
class GeoMultiCollection {
|
|
2968
3055
|
constructor(tag, topo, col, map) {
|
|
2969
3056
|
this.stamp = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER / 2);
|
|
@@ -3175,6 +3262,8 @@ class GeoMultiCollection {
|
|
|
3175
3262
|
let n = this.nEntries;
|
|
3176
3263
|
let e = this.nthEntry(0);
|
|
3177
3264
|
if (n == 1) {
|
|
3265
|
+
// Note that this is potentially invalid shortcut when some features are hidden from base geometry.
|
|
3266
|
+
// Could test overall count of objects vs. this count to check.
|
|
3178
3267
|
this.all.topo = this._topo(e);
|
|
3179
3268
|
this.all.col = this.all.col || e.col;
|
|
3180
3269
|
this.all.map = this.all.map || e.map;
|
|
@@ -3372,7 +3461,6 @@ function geoIntersect(multi, bbox, opt) {
|
|
|
3372
3461
|
result.add('result', null, null, m);
|
|
3373
3462
|
return result;
|
|
3374
3463
|
}
|
|
3375
|
-
exports.geoIntersect = geoIntersect;
|
|
3376
3464
|
|
|
3377
3465
|
|
|
3378
3466
|
/***/ }),
|
|
@@ -3385,7 +3473,8 @@ exports.geoIntersect = geoIntersect;
|
|
|
3385
3473
|
|
|
3386
3474
|
|
|
3387
3475
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3388
|
-
exports.MultiBlockMapping =
|
|
3476
|
+
exports.MultiBlockMapping = void 0;
|
|
3477
|
+
exports.reverseBlockMapping = reverseBlockMapping;
|
|
3389
3478
|
function reverseBlockMapping(bm) {
|
|
3390
3479
|
let rev = {};
|
|
3391
3480
|
if (bm)
|
|
@@ -3398,7 +3487,6 @@ function reverseBlockMapping(bm) {
|
|
|
3398
3487
|
Object.values(rev).forEach((a) => a.sort());
|
|
3399
3488
|
return rev;
|
|
3400
3489
|
}
|
|
3401
|
-
exports.reverseBlockMapping = reverseBlockMapping;
|
|
3402
3490
|
class MultiBlockMapping {
|
|
3403
3491
|
constructor(tag, bm) {
|
|
3404
3492
|
this.entries = [];
|
|
@@ -3504,15 +3592,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
3504
3592
|
}) : function(o, v) {
|
|
3505
3593
|
o["default"] = v;
|
|
3506
3594
|
});
|
|
3507
|
-
var __importStar = (this && this.__importStar) || function (
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
};
|
|
3595
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
3596
|
+
var ownKeys = function(o) {
|
|
3597
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
3598
|
+
var ar = [];
|
|
3599
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
3600
|
+
return ar;
|
|
3601
|
+
};
|
|
3602
|
+
return ownKeys(o);
|
|
3603
|
+
};
|
|
3604
|
+
return function (mod) {
|
|
3605
|
+
if (mod && mod.__esModule) return mod;
|
|
3606
|
+
var result = {};
|
|
3607
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
3608
|
+
__setModuleDefault(result, mod);
|
|
3609
|
+
return result;
|
|
3610
|
+
};
|
|
3611
|
+
})();
|
|
3514
3612
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3515
|
-
exports.computeVFeature =
|
|
3613
|
+
exports.computeVFeature = computeVFeature;
|
|
3516
3614
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
3517
3615
|
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
3518
3616
|
// Given the topology for a precinct, the bintrie mapping and the list of blocks, construct the
|
|
@@ -3541,7 +3639,6 @@ function computeVFeature(topoPrecinct, bintrie, blocks) {
|
|
|
3541
3639
|
f.properties.blocks = blocks;
|
|
3542
3640
|
return f;
|
|
3543
3641
|
}
|
|
3544
|
-
exports.computeVFeature = computeVFeature;
|
|
3545
3642
|
|
|
3546
3643
|
|
|
3547
3644
|
/***/ }),
|
|
@@ -3596,13 +3693,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
3596
3693
|
}) : function(o, v) {
|
|
3597
3694
|
o["default"] = v;
|
|
3598
3695
|
});
|
|
3599
|
-
var __importStar = (this && this.__importStar) || function (
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
};
|
|
3696
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
3697
|
+
var ownKeys = function(o) {
|
|
3698
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
3699
|
+
var ar = [];
|
|
3700
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
3701
|
+
return ar;
|
|
3702
|
+
};
|
|
3703
|
+
return ownKeys(o);
|
|
3704
|
+
};
|
|
3705
|
+
return function (mod) {
|
|
3706
|
+
if (mod && mod.__esModule) return mod;
|
|
3707
|
+
var result = {};
|
|
3708
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
3709
|
+
__setModuleDefault(result, mod);
|
|
3710
|
+
return result;
|
|
3711
|
+
};
|
|
3712
|
+
})();
|
|
3606
3713
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3607
3714
|
exports.SyncTimer = exports.AsyncTimer = exports.Timer = void 0;
|
|
3608
3715
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -3689,15 +3796,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
3689
3796
|
}) : function(o, v) {
|
|
3690
3797
|
o["default"] = v;
|
|
3691
3798
|
});
|
|
3692
|
-
var __importStar = (this && this.__importStar) || function (
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
};
|
|
3799
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
3800
|
+
var ownKeys = function(o) {
|
|
3801
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
3802
|
+
var ar = [];
|
|
3803
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
3804
|
+
return ar;
|
|
3805
|
+
};
|
|
3806
|
+
return ownKeys(o);
|
|
3807
|
+
};
|
|
3808
|
+
return function (mod) {
|
|
3809
|
+
if (mod && mod.__esModule) return mod;
|
|
3810
|
+
var result = {};
|
|
3811
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
3812
|
+
__setModuleDefault(result, mod);
|
|
3813
|
+
return result;
|
|
3814
|
+
};
|
|
3815
|
+
})();
|
|
3699
3816
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3700
|
-
exports.create =
|
|
3817
|
+
exports.create = create;
|
|
3701
3818
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
3702
3819
|
class LogManager {
|
|
3703
3820
|
constructor(env) {
|
|
@@ -3766,7 +3883,6 @@ class LogManager {
|
|
|
3766
3883
|
function create(env) {
|
|
3767
3884
|
return new LogManager(env);
|
|
3768
3885
|
}
|
|
3769
|
-
exports.create = create;
|
|
3770
3886
|
|
|
3771
3887
|
|
|
3772
3888
|
/***/ }),
|
|
@@ -3822,13 +3938,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
3822
3938
|
}) : function(o, v) {
|
|
3823
3939
|
o["default"] = v;
|
|
3824
3940
|
});
|
|
3825
|
-
var __importStar = (this && this.__importStar) || function (
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
};
|
|
3941
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
3942
|
+
var ownKeys = function(o) {
|
|
3943
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
3944
|
+
var ar = [];
|
|
3945
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
3946
|
+
return ar;
|
|
3947
|
+
};
|
|
3948
|
+
return ownKeys(o);
|
|
3949
|
+
};
|
|
3950
|
+
return function (mod) {
|
|
3951
|
+
if (mod && mod.__esModule) return mod;
|
|
3952
|
+
var result = {};
|
|
3953
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
3954
|
+
__setModuleDefault(result, mod);
|
|
3955
|
+
return result;
|
|
3956
|
+
};
|
|
3957
|
+
})();
|
|
3832
3958
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3833
3959
|
exports.OTEditUtil = void 0;
|
|
3834
3960
|
const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
|
|
@@ -4011,13 +4137,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
4011
4137
|
}) : function(o, v) {
|
|
4012
4138
|
o["default"] = v;
|
|
4013
4139
|
});
|
|
4014
|
-
var __importStar = (this && this.__importStar) || function (
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
};
|
|
4140
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
4141
|
+
var ownKeys = function(o) {
|
|
4142
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
4143
|
+
var ar = [];
|
|
4144
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
4145
|
+
return ar;
|
|
4146
|
+
};
|
|
4147
|
+
return ownKeys(o);
|
|
4148
|
+
};
|
|
4149
|
+
return function (mod) {
|
|
4150
|
+
if (mod && mod.__esModule) return mod;
|
|
4151
|
+
var result = {};
|
|
4152
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
4153
|
+
__setModuleDefault(result, mod);
|
|
4154
|
+
return result;
|
|
4155
|
+
};
|
|
4156
|
+
})();
|
|
4021
4157
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4022
4158
|
exports.Editor = exports.REPLACE = exports.MERGE = void 0;
|
|
4023
4159
|
const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
|
|
@@ -4237,13 +4373,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
4237
4373
|
}) : function(o, v) {
|
|
4238
4374
|
o["default"] = v;
|
|
4239
4375
|
});
|
|
4240
|
-
var __importStar = (this && this.__importStar) || function (
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
};
|
|
4376
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
4377
|
+
var ownKeys = function(o) {
|
|
4378
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
4379
|
+
var ar = [];
|
|
4380
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
4381
|
+
return ar;
|
|
4382
|
+
};
|
|
4383
|
+
return ownKeys(o);
|
|
4384
|
+
};
|
|
4385
|
+
return function (mod) {
|
|
4386
|
+
if (mod && mod.__esModule) return mod;
|
|
4387
|
+
var result = {};
|
|
4388
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
4389
|
+
__setModuleDefault(result, mod);
|
|
4390
|
+
return result;
|
|
4391
|
+
};
|
|
4392
|
+
})();
|
|
4247
4393
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4248
4394
|
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;
|
|
4249
4395
|
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
@@ -5209,13 +5355,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
5209
5355
|
}) : function(o, v) {
|
|
5210
5356
|
o["default"] = v;
|
|
5211
5357
|
});
|
|
5212
|
-
var __importStar = (this && this.__importStar) || function (
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
};
|
|
5358
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
5359
|
+
var ownKeys = function(o) {
|
|
5360
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
5361
|
+
var ar = [];
|
|
5362
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
5363
|
+
return ar;
|
|
5364
|
+
};
|
|
5365
|
+
return ownKeys(o);
|
|
5366
|
+
};
|
|
5367
|
+
return function (mod) {
|
|
5368
|
+
if (mod && mod.__esModule) return mod;
|
|
5369
|
+
var result = {};
|
|
5370
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
5371
|
+
__setModuleDefault(result, mod);
|
|
5372
|
+
return result;
|
|
5373
|
+
};
|
|
5374
|
+
})();
|
|
5219
5375
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5220
5376
|
exports.OTClientEngine = void 0;
|
|
5221
5377
|
const OTC = __importStar(__webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts"));
|
|
@@ -5487,13 +5643,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
5487
5643
|
}) : function(o, v) {
|
|
5488
5644
|
o["default"] = v;
|
|
5489
5645
|
});
|
|
5490
|
-
var __importStar = (this && this.__importStar) || function (
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
};
|
|
5646
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
5647
|
+
var ownKeys = function(o) {
|
|
5648
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
5649
|
+
var ar = [];
|
|
5650
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
5651
|
+
return ar;
|
|
5652
|
+
};
|
|
5653
|
+
return ownKeys(o);
|
|
5654
|
+
};
|
|
5655
|
+
return function (mod) {
|
|
5656
|
+
if (mod && mod.__esModule) return mod;
|
|
5657
|
+
var result = {};
|
|
5658
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
5659
|
+
__setModuleDefault(result, mod);
|
|
5660
|
+
return result;
|
|
5661
|
+
};
|
|
5662
|
+
})();
|
|
5497
5663
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5498
5664
|
exports.OTCompositeResource = exports.clockSeenValue = exports.clockUndoValue = exports.clockInitializeValue = exports.clockFailureValue = exports.clockRandomizeValue = exports.clockTerminateValue = exports.clockInitialValue = void 0;
|
|
5499
5665
|
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
@@ -5729,13 +5895,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
5729
5895
|
}) : function(o, v) {
|
|
5730
5896
|
o["default"] = v;
|
|
5731
5897
|
});
|
|
5732
|
-
var __importStar = (this && this.__importStar) || function (
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
};
|
|
5898
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
5899
|
+
var ownKeys = function(o) {
|
|
5900
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
5901
|
+
var ar = [];
|
|
5902
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
5903
|
+
return ar;
|
|
5904
|
+
};
|
|
5905
|
+
return ownKeys(o);
|
|
5906
|
+
};
|
|
5907
|
+
return function (mod) {
|
|
5908
|
+
if (mod && mod.__esModule) return mod;
|
|
5909
|
+
var result = {};
|
|
5910
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
5911
|
+
__setModuleDefault(result, mod);
|
|
5912
|
+
return result;
|
|
5913
|
+
};
|
|
5914
|
+
})();
|
|
5739
5915
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5740
5916
|
exports.OTCounterResource = exports.OpCounterDel = exports.OpCounterAdd = void 0;
|
|
5741
5917
|
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
@@ -5927,13 +6103,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
5927
6103
|
}) : function(o, v) {
|
|
5928
6104
|
o["default"] = v;
|
|
5929
6105
|
});
|
|
5930
|
-
var __importStar = (this && this.__importStar) || function (
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
};
|
|
6106
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
6107
|
+
var ownKeys = function(o) {
|
|
6108
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
6109
|
+
var ar = [];
|
|
6110
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
6111
|
+
return ar;
|
|
6112
|
+
};
|
|
6113
|
+
return ownKeys(o);
|
|
6114
|
+
};
|
|
6115
|
+
return function (mod) {
|
|
6116
|
+
if (mod && mod.__esModule) return mod;
|
|
6117
|
+
var result = {};
|
|
6118
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6119
|
+
__setModuleDefault(result, mod);
|
|
6120
|
+
return result;
|
|
6121
|
+
};
|
|
6122
|
+
})();
|
|
5937
6123
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5938
6124
|
exports.OTMapResource = exports.OpMapDel = exports.OpMapSet = void 0;
|
|
5939
6125
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -6070,13 +6256,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6070
6256
|
}) : function(o, v) {
|
|
6071
6257
|
o["default"] = v;
|
|
6072
6258
|
});
|
|
6073
|
-
var __importStar = (this && this.__importStar) || function (
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
};
|
|
6259
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
6260
|
+
var ownKeys = function(o) {
|
|
6261
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
6262
|
+
var ar = [];
|
|
6263
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
6264
|
+
return ar;
|
|
6265
|
+
};
|
|
6266
|
+
return ownKeys(o);
|
|
6267
|
+
};
|
|
6268
|
+
return function (mod) {
|
|
6269
|
+
if (mod && mod.__esModule) return mod;
|
|
6270
|
+
var result = {};
|
|
6271
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6272
|
+
__setModuleDefault(result, mod);
|
|
6273
|
+
return result;
|
|
6274
|
+
};
|
|
6275
|
+
})();
|
|
6080
6276
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6081
6277
|
exports.OTServerEngine = exports.ClientIDForServer = void 0;
|
|
6082
6278
|
const OTC = __importStar(__webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts"));
|
|
@@ -6346,7 +6542,10 @@ exports.OTServerEngine = OTServerEngine;
|
|
|
6346
6542
|
|
|
6347
6543
|
|
|
6348
6544
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6349
|
-
exports.
|
|
6545
|
+
exports.ServerStateMaintenance = exports.ServerStateRunning = exports.PermAll = exports.PermEdit = exports.PermVersion = exports.PermAdmin = exports.PermOwner = exports.PermWrite = exports.PermRead = exports.PermNone = exports.FilterCount = exports.FilterMyGroupDatasets = exports.FilterPublicDatasets = exports.FilterMyDatasets = exports.FilterMyGroups = exports.FilterMyGroupMaps = 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;
|
|
6546
|
+
exports.accessFindUser = accessFindUser;
|
|
6547
|
+
exports.accessMapFindUser = accessMapFindUser;
|
|
6548
|
+
exports.SessionFilterFunction = SessionFilterFunction;
|
|
6350
6549
|
// Errors
|
|
6351
6550
|
exports.ESuccess = 0; // Generic success
|
|
6352
6551
|
exports.EFail = 1; // Generic failure
|
|
@@ -6405,7 +6604,6 @@ function accessFindUser(a, uid) {
|
|
|
6405
6604
|
return a.perm;
|
|
6406
6605
|
return exports.PermNone;
|
|
6407
6606
|
}
|
|
6408
|
-
exports.accessFindUser = accessFindUser;
|
|
6409
6607
|
function accessMapFindUser(accessMap, uid, aid) {
|
|
6410
6608
|
if (aid !== undefined)
|
|
6411
6609
|
return accessFindUser(accessMap[aid], uid);
|
|
@@ -6423,7 +6621,6 @@ function accessMapFindUser(accessMap, uid, aid) {
|
|
|
6423
6621
|
return perm;
|
|
6424
6622
|
}
|
|
6425
6623
|
}
|
|
6426
|
-
exports.accessMapFindUser = accessMapFindUser;
|
|
6427
6624
|
function SessionFilterFunction(p, uid, f) {
|
|
6428
6625
|
if (f === exports.FilterPublic)
|
|
6429
6626
|
return p.published !== undefined;
|
|
@@ -6444,7 +6641,6 @@ function SessionFilterFunction(p, uid, f) {
|
|
|
6444
6641
|
}
|
|
6445
6642
|
return !p.deleted;
|
|
6446
6643
|
}
|
|
6447
|
-
exports.SessionFilterFunction = SessionFilterFunction;
|
|
6448
6644
|
|
|
6449
6645
|
|
|
6450
6646
|
/***/ }),
|
|
@@ -6580,15 +6776,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6580
6776
|
}) : function(o, v) {
|
|
6581
6777
|
o["default"] = v;
|
|
6582
6778
|
});
|
|
6583
|
-
var __importStar = (this && this.__importStar) || function (
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
};
|
|
6779
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
6780
|
+
var ownKeys = function(o) {
|
|
6781
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
6782
|
+
var ar = [];
|
|
6783
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
6784
|
+
return ar;
|
|
6785
|
+
};
|
|
6786
|
+
return ownKeys(o);
|
|
6787
|
+
};
|
|
6788
|
+
return function (mod) {
|
|
6789
|
+
if (mod && mod.__esModule) return mod;
|
|
6790
|
+
var result = {};
|
|
6791
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6792
|
+
__setModuleDefault(result, mod);
|
|
6793
|
+
return result;
|
|
6794
|
+
};
|
|
6795
|
+
})();
|
|
6590
6796
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6591
|
-
exports.blend =
|
|
6797
|
+
exports.blend = blend;
|
|
6592
6798
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
6593
6799
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
6594
6800
|
// Takes array of polygon or multi-polygon coordinate structures and returns a single multi-polygon
|
|
@@ -6610,7 +6816,6 @@ function blend(polys) {
|
|
|
6610
6816
|
}
|
|
6611
6817
|
return result;
|
|
6612
6818
|
}
|
|
6613
|
-
exports.blend = blend;
|
|
6614
6819
|
|
|
6615
6820
|
|
|
6616
6821
|
/***/ }),
|
|
@@ -6638,26 +6843,42 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6638
6843
|
}) : function(o, v) {
|
|
6639
6844
|
o["default"] = v;
|
|
6640
6845
|
});
|
|
6641
|
-
var __importStar = (this && this.__importStar) || function (
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
};
|
|
6846
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
6847
|
+
var ownKeys = function(o) {
|
|
6848
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
6849
|
+
var ar = [];
|
|
6850
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
6851
|
+
return ar;
|
|
6852
|
+
};
|
|
6853
|
+
return ownKeys(o);
|
|
6854
|
+
};
|
|
6855
|
+
return function (mod) {
|
|
6856
|
+
if (mod && mod.__esModule) return mod;
|
|
6857
|
+
var result = {};
|
|
6858
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6859
|
+
__setModuleDefault(result, mod);
|
|
6860
|
+
return result;
|
|
6861
|
+
};
|
|
6862
|
+
})();
|
|
6648
6863
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6649
|
-
exports.
|
|
6864
|
+
exports.boundboxWidth = boundboxWidth;
|
|
6865
|
+
exports.boundboxHeight = boundboxHeight;
|
|
6866
|
+
exports.boundboxCX = boundboxCX;
|
|
6867
|
+
exports.boundboxCY = boundboxCY;
|
|
6868
|
+
exports.clipLon = clipLon;
|
|
6869
|
+
exports.boundboxExtend = boundboxExtend;
|
|
6870
|
+
exports.boundbox = boundbox;
|
|
6871
|
+
exports.boundboxPoly = boundboxPoly;
|
|
6872
|
+
exports.boundboxEmpty = boundboxEmpty;
|
|
6873
|
+
exports.boundboxArea = boundboxArea;
|
|
6874
|
+
exports.boundboxIntersects = boundboxIntersects;
|
|
6875
|
+
exports.boundboxContains = boundboxContains;
|
|
6650
6876
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
6651
6877
|
function boundboxWidth(bb) { return Math.abs(bb.right - bb.left); }
|
|
6652
|
-
exports.boundboxWidth = boundboxWidth;
|
|
6653
6878
|
function boundboxHeight(bb) { return Math.abs(bb.bottom - bb.top); }
|
|
6654
|
-
exports.boundboxHeight = boundboxHeight;
|
|
6655
6879
|
function boundboxCX(bb) { return bb.left + (bb.right - bb.left) / 2; }
|
|
6656
|
-
exports.boundboxCX = boundboxCX;
|
|
6657
6880
|
function boundboxCY(bb) { return bb.top + (bb.bottom - bb.top) / 2; }
|
|
6658
|
-
exports.boundboxCY = boundboxCY;
|
|
6659
6881
|
function clipLon(lon) { return lon <= 0 ? lon : -179; }
|
|
6660
|
-
exports.clipLon = clipLon;
|
|
6661
6882
|
function boundboxExtend(bbox, x, y) {
|
|
6662
6883
|
x = clipLon(x);
|
|
6663
6884
|
if (bbox.left === undefined || x < bbox.left)
|
|
@@ -6669,7 +6890,6 @@ function boundboxExtend(bbox, x, y) {
|
|
|
6669
6890
|
if (bbox.bottom === undefined || y < bbox.bottom)
|
|
6670
6891
|
bbox.bottom = y;
|
|
6671
6892
|
}
|
|
6672
|
-
exports.boundboxExtend = boundboxExtend;
|
|
6673
6893
|
function boundboxExtendPacked(pp, bbox) {
|
|
6674
6894
|
let buffer = pp.buffer;
|
|
6675
6895
|
let offset = pp.buffer[pp.offset + 1] + pp.offset;
|
|
@@ -6708,27 +6928,21 @@ function boundbox(poly, bbox) {
|
|
|
6708
6928
|
}
|
|
6709
6929
|
return bbox;
|
|
6710
6930
|
}
|
|
6711
|
-
exports.boundbox = boundbox;
|
|
6712
6931
|
function boundboxPoly(bb) {
|
|
6713
6932
|
return [[[bb.left, bb.top], [bb.left, bb.bottom], [bb.right, bb.bottom], [bb.right, bb.top], [bb.left, bb.top]]];
|
|
6714
6933
|
}
|
|
6715
|
-
exports.boundboxPoly = boundboxPoly;
|
|
6716
6934
|
function boundboxEmpty(bb) {
|
|
6717
6935
|
return !bb || bb.left === undefined || P.polyArea(boundboxPoly(bb)) == 0;
|
|
6718
6936
|
}
|
|
6719
|
-
exports.boundboxEmpty = boundboxEmpty;
|
|
6720
6937
|
function boundboxArea(poly) {
|
|
6721
6938
|
return P.polyArea(boundboxPoly(boundbox(poly)));
|
|
6722
6939
|
}
|
|
6723
|
-
exports.boundboxArea = boundboxArea;
|
|
6724
6940
|
function boundboxIntersects(bb1, bb2) {
|
|
6725
6941
|
return !(bb1.left > bb2.right || bb1.right < bb2.left || bb1.top < bb2.bottom || bb1.bottom > bb2.top);
|
|
6726
6942
|
}
|
|
6727
|
-
exports.boundboxIntersects = boundboxIntersects;
|
|
6728
6943
|
function boundboxContains(bb, x, y) {
|
|
6729
6944
|
return !(bb.left >= x || bb.right < x || bb.top <= y || bb.bottom > y);
|
|
6730
6945
|
}
|
|
6731
|
-
exports.boundboxContains = boundboxContains;
|
|
6732
6946
|
|
|
6733
6947
|
|
|
6734
6948
|
/***/ }),
|
|
@@ -6759,15 +6973,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6759
6973
|
}) : function(o, v) {
|
|
6760
6974
|
o["default"] = v;
|
|
6761
6975
|
});
|
|
6762
|
-
var __importStar = (this && this.__importStar) || function (
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
};
|
|
6976
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
6977
|
+
var ownKeys = function(o) {
|
|
6978
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
6979
|
+
var ar = [];
|
|
6980
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
6981
|
+
return ar;
|
|
6982
|
+
};
|
|
6983
|
+
return ownKeys(o);
|
|
6984
|
+
};
|
|
6985
|
+
return function (mod) {
|
|
6986
|
+
if (mod && mod.__esModule) return mod;
|
|
6987
|
+
var result = {};
|
|
6988
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6989
|
+
__setModuleDefault(result, mod);
|
|
6990
|
+
return result;
|
|
6991
|
+
};
|
|
6992
|
+
})();
|
|
6769
6993
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6770
|
-
exports.
|
|
6994
|
+
exports.polyParts = polyParts;
|
|
6995
|
+
exports.polyAreaFlat = polyAreaFlat;
|
|
6996
|
+
exports.polyPerimeterFlat = polyPerimeterFlat;
|
|
6997
|
+
exports.polyDiameterFlat = polyDiameterFlat;
|
|
6771
6998
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
6772
6999
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
6773
7000
|
// HELPER
|
|
@@ -6796,7 +7023,6 @@ function polyParts(poly) {
|
|
|
6796
7023
|
});
|
|
6797
7024
|
return parts;
|
|
6798
7025
|
}
|
|
6799
|
-
exports.polyParts = polyParts;
|
|
6800
7026
|
// CARTESIAN ("FLAT") AREA, PERIMETER, AND DIAMETER
|
|
6801
7027
|
function polyAreaFlat(poly) {
|
|
6802
7028
|
let pp = P.polyNormalize(poly);
|
|
@@ -6806,7 +7032,6 @@ function polyAreaFlat(poly) {
|
|
|
6806
7032
|
});
|
|
6807
7033
|
return a;
|
|
6808
7034
|
}
|
|
6809
|
-
exports.polyAreaFlat = polyAreaFlat;
|
|
6810
7035
|
// Algorithm for the area of a simple/single planar polygon:
|
|
6811
7036
|
// https://algorithmtutor.com/Computational-Geometry/Area-of-a-polygon-given-a-set-of-points/
|
|
6812
7037
|
// https://mathopenref.com/coordpolygonarea2.html
|
|
@@ -6851,7 +7076,6 @@ function polyPerimeterFlat(poly) {
|
|
|
6851
7076
|
});
|
|
6852
7077
|
return perimeter;
|
|
6853
7078
|
}
|
|
6854
|
-
exports.polyPerimeterFlat = polyPerimeterFlat;
|
|
6855
7079
|
function _distance(x1, y1, x2, y2) {
|
|
6856
7080
|
const dLat = y2 - y1;
|
|
6857
7081
|
const dLon = x2 - x1;
|
|
@@ -6865,7 +7089,6 @@ function polyDiameterFlat(poly) {
|
|
|
6865
7089
|
let circle = P.polyToCircle(poly);
|
|
6866
7090
|
return circle ? circle.r * 2 : 0;
|
|
6867
7091
|
}
|
|
6868
|
-
exports.polyDiameterFlat = polyDiameterFlat;
|
|
6869
7092
|
|
|
6870
7093
|
|
|
6871
7094
|
/***/ }),
|
|
@@ -6878,7 +7101,7 @@ exports.polyDiameterFlat = polyDiameterFlat;
|
|
|
6878
7101
|
|
|
6879
7102
|
|
|
6880
7103
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6881
|
-
exports.featureCleanHoles =
|
|
7104
|
+
exports.featureCleanHoles = featureCleanHoles;
|
|
6882
7105
|
const union_1 = __webpack_require__(/*! ./union */ "./lib/poly/union.ts");
|
|
6883
7106
|
const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
6884
7107
|
function flattenMultiPoly(polys) {
|
|
@@ -6956,7 +7179,6 @@ function featureCleanHoles(f) {
|
|
|
6956
7179
|
}
|
|
6957
7180
|
return f;
|
|
6958
7181
|
}
|
|
6959
|
-
exports.featureCleanHoles = featureCleanHoles;
|
|
6960
7182
|
|
|
6961
7183
|
|
|
6962
7184
|
/***/ }),
|
|
@@ -6992,15 +7214,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6992
7214
|
}) : function(o, v) {
|
|
6993
7215
|
o["default"] = v;
|
|
6994
7216
|
});
|
|
6995
|
-
var __importStar = (this && this.__importStar) || function (
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
};
|
|
7217
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
7218
|
+
var ownKeys = function(o) {
|
|
7219
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
7220
|
+
var ar = [];
|
|
7221
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
7222
|
+
return ar;
|
|
7223
|
+
};
|
|
7224
|
+
return ownKeys(o);
|
|
7225
|
+
};
|
|
7226
|
+
return function (mod) {
|
|
7227
|
+
if (mod && mod.__esModule) return mod;
|
|
7228
|
+
var result = {};
|
|
7229
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
7230
|
+
__setModuleDefault(result, mod);
|
|
7231
|
+
return result;
|
|
7232
|
+
};
|
|
7233
|
+
})();
|
|
7002
7234
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7003
|
-
exports.makeConvexHullGrahamScan =
|
|
7235
|
+
exports.makeConvexHullGrahamScan = makeConvexHullGrahamScan;
|
|
7004
7236
|
const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
7005
7237
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
7006
7238
|
function makeConvexHullGrahamScan(poly, options) {
|
|
@@ -7014,7 +7246,6 @@ function makeConvexHullGrahamScan(poly, options) {
|
|
|
7014
7246
|
const ch = scanner.getHull();
|
|
7015
7247
|
return [ch];
|
|
7016
7248
|
}
|
|
7017
|
-
exports.makeConvexHullGrahamScan = makeConvexHullGrahamScan;
|
|
7018
7249
|
// NOTE - This finds the exterior points of a polygon in standard form and returns
|
|
7019
7250
|
// it as an array if [x, y] points, in contrast to polyToExteriorPoints() which
|
|
7020
7251
|
// uses the packed format and the poly.ts-private point form.
|
|
@@ -7363,15 +7594,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
7363
7594
|
}) : function(o, v) {
|
|
7364
7595
|
o["default"] = v;
|
|
7365
7596
|
});
|
|
7366
|
-
var __importStar = (this && this.__importStar) || function (
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
};
|
|
7597
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
7598
|
+
var ownKeys = function(o) {
|
|
7599
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
7600
|
+
var ar = [];
|
|
7601
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
7602
|
+
return ar;
|
|
7603
|
+
};
|
|
7604
|
+
return ownKeys(o);
|
|
7605
|
+
};
|
|
7606
|
+
return function (mod) {
|
|
7607
|
+
if (mod && mod.__esModule) return mod;
|
|
7608
|
+
var result = {};
|
|
7609
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
7610
|
+
__setModuleDefault(result, mod);
|
|
7611
|
+
return result;
|
|
7612
|
+
};
|
|
7613
|
+
})();
|
|
7373
7614
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7374
|
-
exports.
|
|
7615
|
+
exports.polyMapToByCentroid = polyMapToByCentroid;
|
|
7616
|
+
exports.polyMapTo = polyMapTo;
|
|
7375
7617
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
7376
7618
|
const PL = __importStar(__webpack_require__(/*! ./polylabel */ "./lib/poly/polylabel.ts"));
|
|
7377
7619
|
const BB = __importStar(__webpack_require__(/*! ./boundbox */ "./lib/poly/boundbox.ts"));
|
|
@@ -7432,7 +7674,6 @@ function polyMapToByCentroid(districts, centroids) {
|
|
|
7432
7674
|
});
|
|
7433
7675
|
return map;
|
|
7434
7676
|
}
|
|
7435
|
-
exports.polyMapToByCentroid = polyMapToByCentroid;
|
|
7436
7677
|
function polyMapTo(districts, blocks) {
|
|
7437
7678
|
// Cache labelx, labely if necessary
|
|
7438
7679
|
setLabels(blocks);
|
|
@@ -7442,7 +7683,6 @@ function polyMapTo(districts, blocks) {
|
|
|
7442
7683
|
});
|
|
7443
7684
|
return polyMapToByCentroid(districts, centroids);
|
|
7444
7685
|
}
|
|
7445
|
-
exports.polyMapTo = polyMapTo;
|
|
7446
7686
|
|
|
7447
7687
|
|
|
7448
7688
|
/***/ }),
|
|
@@ -7458,11 +7698,24 @@ exports.polyMapTo = polyMapTo;
|
|
|
7458
7698
|
// SOME BASIC MATRIX OPERATIONS FOR MBR
|
|
7459
7699
|
//
|
|
7460
7700
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7461
|
-
exports.dotProduct = exports.subset = exports.range = exports.index = exports.dotMultiply = exports.subtract = exports.column = exports.row = exports.concat = exports.max = exports.min = exports.apply = exports.transpose = exports.multiply = exports.matrix = void 0;
|
|
7462
|
-
function matrix(a) {
|
|
7463
|
-
return a;
|
|
7464
|
-
}
|
|
7465
7701
|
exports.matrix = matrix;
|
|
7702
|
+
exports.multiply = multiply;
|
|
7703
|
+
exports.transpose = transpose;
|
|
7704
|
+
exports.apply = apply;
|
|
7705
|
+
exports.min = min;
|
|
7706
|
+
exports.max = max;
|
|
7707
|
+
exports.concat = concat;
|
|
7708
|
+
exports.row = row;
|
|
7709
|
+
exports.column = column;
|
|
7710
|
+
exports.subtract = subtract;
|
|
7711
|
+
exports.dotMultiply = dotMultiply;
|
|
7712
|
+
exports.index = index;
|
|
7713
|
+
exports.range = range;
|
|
7714
|
+
exports.subset = subset;
|
|
7715
|
+
exports.dotProduct = dotProduct;
|
|
7716
|
+
function matrix(a) {
|
|
7717
|
+
return a;
|
|
7718
|
+
}
|
|
7466
7719
|
function multiply(a, b) {
|
|
7467
7720
|
protect((nRows(a) > 0), "In multiply, input matrix 'a' has no rows. ");
|
|
7468
7721
|
protect((nCols(a) > 0), "In multiply, input matrix 'a' has no columns. ");
|
|
@@ -7483,7 +7736,6 @@ function multiply(a, b) {
|
|
|
7483
7736
|
}
|
|
7484
7737
|
return c;
|
|
7485
7738
|
}
|
|
7486
|
-
exports.multiply = multiply;
|
|
7487
7739
|
function transpose(a) {
|
|
7488
7740
|
protect((nRows(a) > 0), "In transpose, input matrix has no rows. ");
|
|
7489
7741
|
protect((nCols(a) > 0), "In transpose, input matrix has no columns. ");
|
|
@@ -7497,7 +7749,6 @@ function transpose(a) {
|
|
|
7497
7749
|
}
|
|
7498
7750
|
return b;
|
|
7499
7751
|
}
|
|
7500
|
-
exports.transpose = transpose;
|
|
7501
7752
|
function apply(a, over, cb) {
|
|
7502
7753
|
protect((nRows(a) > 0), "In apply, input matrix has no rows. ");
|
|
7503
7754
|
protect((nCols(a) > 0), "In apply, input matrix has no columns. ");
|
|
@@ -7512,15 +7763,12 @@ function apply(a, over, cb) {
|
|
|
7512
7763
|
}
|
|
7513
7764
|
return result;
|
|
7514
7765
|
}
|
|
7515
|
-
exports.apply = apply;
|
|
7516
7766
|
function min(v) {
|
|
7517
7767
|
return Math.min(...v);
|
|
7518
7768
|
}
|
|
7519
|
-
exports.min = min;
|
|
7520
7769
|
function max(v) {
|
|
7521
7770
|
return Math.max(...v);
|
|
7522
7771
|
}
|
|
7523
|
-
exports.max = max;
|
|
7524
7772
|
function concat(a, b, by) {
|
|
7525
7773
|
protect((nRows(a) > 0), "In concat, input matrix 'a' has no rows. ");
|
|
7526
7774
|
protect((nCols(a) > 0), "In concat, input matrix 'a' has no columns. ");
|
|
@@ -7552,14 +7800,12 @@ function concat(a, b, by) {
|
|
|
7552
7800
|
}
|
|
7553
7801
|
return c;
|
|
7554
7802
|
}
|
|
7555
|
-
exports.concat = concat;
|
|
7556
7803
|
function row(a, i) {
|
|
7557
7804
|
protect((nRows(a) > 0), "In row, input matrix has no rows. ");
|
|
7558
7805
|
protect((nCols(a) > 0), "In row, input matrix has no columns. ");
|
|
7559
7806
|
protect((i >= 0), "In row, invalid row index.");
|
|
7560
7807
|
return a[i];
|
|
7561
7808
|
}
|
|
7562
|
-
exports.row = row;
|
|
7563
7809
|
function column(a, j) {
|
|
7564
7810
|
protect((nRows(a) > 0), "In column, input matrix has no rows. ");
|
|
7565
7811
|
protect((nCols(a) > 0), "In column, input matrix has no columns. ");
|
|
@@ -7570,7 +7816,6 @@ function column(a, j) {
|
|
|
7570
7816
|
}
|
|
7571
7817
|
return v;
|
|
7572
7818
|
}
|
|
7573
|
-
exports.column = column;
|
|
7574
7819
|
function subtract(a, b) {
|
|
7575
7820
|
protect((a.length == b.length), "In subtract, the input vectors have different lengths.");
|
|
7576
7821
|
let c = [];
|
|
@@ -7579,7 +7824,6 @@ function subtract(a, b) {
|
|
|
7579
7824
|
}
|
|
7580
7825
|
return c;
|
|
7581
7826
|
}
|
|
7582
|
-
exports.subtract = subtract;
|
|
7583
7827
|
function dotMultiply(a, b) {
|
|
7584
7828
|
protect((a.length > 0) && (a.length == b.length), "In dotMultiply, the vectors aren't the same length. ");
|
|
7585
7829
|
let c = [];
|
|
@@ -7588,11 +7832,9 @@ function dotMultiply(a, b) {
|
|
|
7588
7832
|
}
|
|
7589
7833
|
return c;
|
|
7590
7834
|
}
|
|
7591
|
-
exports.dotMultiply = dotMultiply;
|
|
7592
7835
|
function index(a, b) {
|
|
7593
7836
|
return [a, b];
|
|
7594
7837
|
}
|
|
7595
|
-
exports.index = index;
|
|
7596
7838
|
function range(start, end, includeEnd = false) {
|
|
7597
7839
|
let r = [];
|
|
7598
7840
|
end += includeEnd ? 1 : 0;
|
|
@@ -7601,7 +7843,6 @@ function range(start, end, includeEnd = false) {
|
|
|
7601
7843
|
}
|
|
7602
7844
|
return r;
|
|
7603
7845
|
}
|
|
7604
|
-
exports.range = range;
|
|
7605
7846
|
function subset(a, select) {
|
|
7606
7847
|
protect((nRows(a) > 0), "In subset, input matrix has no rows. ");
|
|
7607
7848
|
protect((nCols(a) > 0), "In subset, input matrix has no columns. ");
|
|
@@ -7621,7 +7862,6 @@ function subset(a, select) {
|
|
|
7621
7862
|
}
|
|
7622
7863
|
return b;
|
|
7623
7864
|
}
|
|
7624
|
-
exports.subset = subset;
|
|
7625
7865
|
// HELPERS
|
|
7626
7866
|
function initialize(rows, cols) {
|
|
7627
7867
|
protect(((rows > 0) || (cols > 0)), "In initialize, the # of rows or columns is not positive. ");
|
|
@@ -7634,7 +7874,6 @@ function dotProduct(a, b) {
|
|
|
7634
7874
|
protect((a.length > 0) && (a.length == b.length), "In dotProduct, the vectors aren't the same length. ");
|
|
7635
7875
|
return a.map((value, i) => value * b[i]).reduce((acc, val) => acc + val, 0);
|
|
7636
7876
|
}
|
|
7637
|
-
exports.dotProduct = dotProduct;
|
|
7638
7877
|
;
|
|
7639
7878
|
function protect(condition, message) {
|
|
7640
7879
|
if (!condition)
|
|
@@ -7670,15 +7909,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
7670
7909
|
}) : function(o, v) {
|
|
7671
7910
|
o["default"] = v;
|
|
7672
7911
|
});
|
|
7673
|
-
var __importStar = (this && this.__importStar) || function (
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
};
|
|
7912
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
7913
|
+
var ownKeys = function(o) {
|
|
7914
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
7915
|
+
var ar = [];
|
|
7916
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
7917
|
+
return ar;
|
|
7918
|
+
};
|
|
7919
|
+
return ownKeys(o);
|
|
7920
|
+
};
|
|
7921
|
+
return function (mod) {
|
|
7922
|
+
if (mod && mod.__esModule) return mod;
|
|
7923
|
+
var result = {};
|
|
7924
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
7925
|
+
__setModuleDefault(result, mod);
|
|
7926
|
+
return result;
|
|
7927
|
+
};
|
|
7928
|
+
})();
|
|
7680
7929
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7681
|
-
exports.minimumBoundingRectangle =
|
|
7930
|
+
exports.minimumBoundingRectangle = minimumBoundingRectangle;
|
|
7682
7931
|
//
|
|
7683
7932
|
// WHUBER'S ELEGANT, TRIG-FREE SOLUTION IN R
|
|
7684
7933
|
//
|
|
@@ -7762,7 +8011,6 @@ function minimumBoundingRectangle(poly) {
|
|
|
7762
8011
|
// Convert to standard polygon form
|
|
7763
8012
|
return [points];
|
|
7764
8013
|
}
|
|
7765
|
-
exports.minimumBoundingRectangle = minimumBoundingRectangle;
|
|
7766
8014
|
//
|
|
7767
8015
|
// THIS RE-IMPLEMENTS THE R IN TYPESCRIPT, USING MATHJS FOR MATRIX OPERATIONS
|
|
7768
8016
|
//
|
|
@@ -7885,15 +8133,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
7885
8133
|
}) : function(o, v) {
|
|
7886
8134
|
o["default"] = v;
|
|
7887
8135
|
});
|
|
7888
|
-
var __importStar = (this && this.__importStar) || function (
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
};
|
|
8136
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
8137
|
+
var ownKeys = function(o) {
|
|
8138
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
8139
|
+
var ar = [];
|
|
8140
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
8141
|
+
return ar;
|
|
8142
|
+
};
|
|
8143
|
+
return ownKeys(o);
|
|
8144
|
+
};
|
|
8145
|
+
return function (mod) {
|
|
8146
|
+
if (mod && mod.__esModule) return mod;
|
|
8147
|
+
var result = {};
|
|
8148
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
8149
|
+
__setModuleDefault(result, mod);
|
|
8150
|
+
return result;
|
|
8151
|
+
};
|
|
8152
|
+
})();
|
|
7895
8153
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7896
|
-
exports.polyContainsPoint =
|
|
8154
|
+
exports.polyContainsPoint = polyContainsPoint;
|
|
7897
8155
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
7898
8156
|
function polyContainsPoint(poly, x, y) {
|
|
7899
8157
|
let pp = PP.polyPack(poly);
|
|
@@ -7926,7 +8184,6 @@ function polyContainsPoint(poly, x, y) {
|
|
|
7926
8184
|
bInside = true;
|
|
7927
8185
|
return bInside;
|
|
7928
8186
|
}
|
|
7929
|
-
exports.polyContainsPoint = polyContainsPoint;
|
|
7930
8187
|
|
|
7931
8188
|
|
|
7932
8189
|
/***/ }),
|
|
@@ -7954,15 +8211,45 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
7954
8211
|
}) : function(o, v) {
|
|
7955
8212
|
o["default"] = v;
|
|
7956
8213
|
});
|
|
7957
|
-
var __importStar = (this && this.__importStar) || function (
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
};
|
|
8214
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
8215
|
+
var ownKeys = function(o) {
|
|
8216
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
8217
|
+
var ar = [];
|
|
8218
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
8219
|
+
return ar;
|
|
8220
|
+
};
|
|
8221
|
+
return ownKeys(o);
|
|
8222
|
+
};
|
|
8223
|
+
return function (mod) {
|
|
8224
|
+
if (mod && mod.__esModule) return mod;
|
|
8225
|
+
var result = {};
|
|
8226
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
8227
|
+
__setModuleDefault(result, mod);
|
|
8228
|
+
return result;
|
|
8229
|
+
};
|
|
8230
|
+
})();
|
|
7964
8231
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7965
|
-
exports.
|
|
8232
|
+
exports.Circle = exports.DefaultOptions = exports.EARTH_RADIUS = exports.DefaultTickOptions = void 0;
|
|
8233
|
+
exports.polySimpleArea = polySimpleArea;
|
|
8234
|
+
exports.polyNormalize = polyNormalize;
|
|
8235
|
+
exports.polyNull = polyNull;
|
|
8236
|
+
exports.polyArea = polyArea;
|
|
8237
|
+
exports.polyDiameter = polyDiameter;
|
|
8238
|
+
exports.polyPerimeter = polyPerimeter;
|
|
8239
|
+
exports.polyToCircle = polyToCircle;
|
|
8240
|
+
exports.polyToPolsbyPopperCircle = polyToPolsbyPopperCircle;
|
|
8241
|
+
exports.polyFromCircle = polyFromCircle;
|
|
8242
|
+
exports.polyToExteriorPoints = polyToExteriorPoints;
|
|
8243
|
+
exports.polyConvexHull = polyConvexHull;
|
|
8244
|
+
exports.makeConvexHullMonotoneChain2D = makeConvexHullMonotoneChain2D;
|
|
8245
|
+
exports.polyCompactness = polyCompactness;
|
|
8246
|
+
exports.polyDescribe = polyDescribe;
|
|
8247
|
+
exports.npoints = npoints;
|
|
8248
|
+
exports.polyTransform = polyTransform;
|
|
8249
|
+
exports.polyRingWindings = polyRingWindings;
|
|
8250
|
+
exports.featureRewind = featureRewind;
|
|
8251
|
+
exports.polyRewindRings = polyRewindRings;
|
|
8252
|
+
exports.polyBadCoordinates = polyBadCoordinates;
|
|
7966
8253
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
7967
8254
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
7968
8255
|
const graham_scan_1 = __webpack_require__(/*! ./graham-scan */ "./lib/poly/graham-scan.ts");
|
|
@@ -8016,18 +8303,15 @@ function polySimpleArea(b, iOffset, n) {
|
|
|
8016
8303
|
}
|
|
8017
8304
|
return Math.abs(total);
|
|
8018
8305
|
}
|
|
8019
|
-
exports.polySimpleArea = polySimpleArea;
|
|
8020
8306
|
// Allow bare polygon coordinates array or GeoJSON feature.
|
|
8021
8307
|
// Normalize to multipolygon points array.
|
|
8022
8308
|
function polyNormalize(poly) {
|
|
8023
8309
|
return PP.polyPack(poly);
|
|
8024
8310
|
}
|
|
8025
|
-
exports.polyNormalize = polyNormalize;
|
|
8026
8311
|
function polyNull(poly) {
|
|
8027
8312
|
let pp = PP.polyPack(poly);
|
|
8028
8313
|
return pp == null || pp.length == 2;
|
|
8029
8314
|
}
|
|
8030
|
-
exports.polyNull = polyNull;
|
|
8031
8315
|
// Area of geodesic polygon
|
|
8032
8316
|
function polyArea(poly) {
|
|
8033
8317
|
let pp = polyNormalize(poly);
|
|
@@ -8038,7 +8322,6 @@ function polyArea(poly) {
|
|
|
8038
8322
|
});
|
|
8039
8323
|
return a;
|
|
8040
8324
|
}
|
|
8041
|
-
exports.polyArea = polyArea;
|
|
8042
8325
|
// NOTE - COMPACTNESS: Added the diameter of the geodesic polygon in meters
|
|
8043
8326
|
function polyDiameter(poly, options) {
|
|
8044
8327
|
if (options === undefined)
|
|
@@ -8053,7 +8336,6 @@ function polyDiameter(poly, options) {
|
|
|
8053
8336
|
const diameter = Math.max(lonDistance, latDistance);
|
|
8054
8337
|
return diameter;
|
|
8055
8338
|
}
|
|
8056
|
-
exports.polyDiameter = polyDiameter;
|
|
8057
8339
|
// Return distance in meters given two lat/lon points
|
|
8058
8340
|
function haversine(x1, y1, x2, y2, options) {
|
|
8059
8341
|
let dLat = Util.deg2rad(y2 - y1);
|
|
@@ -8090,7 +8372,6 @@ function polyPerimeter(poly, options) {
|
|
|
8090
8372
|
});
|
|
8091
8373
|
return perimeter;
|
|
8092
8374
|
}
|
|
8093
|
-
exports.polyPerimeter = polyPerimeter;
|
|
8094
8375
|
class Point {
|
|
8095
8376
|
constructor(x, y) {
|
|
8096
8377
|
this.x = x;
|
|
@@ -8114,7 +8395,6 @@ exports.Circle = Circle;
|
|
|
8114
8395
|
function polyToCircle(poly) {
|
|
8115
8396
|
return makeCircle(polyToExteriorPoints(poly));
|
|
8116
8397
|
}
|
|
8117
|
-
exports.polyToCircle = polyToCircle;
|
|
8118
8398
|
//
|
|
8119
8399
|
// Returns the circle whose perimeter is equal to the perimeter of the bounding perimeter
|
|
8120
8400
|
// of the polygon. Use binary search to find an approximation.
|
|
@@ -8128,7 +8408,6 @@ function polyToPolsbyPopperCircle(poly, options) {
|
|
|
8128
8408
|
c.r = (p / (2 * Math.PI)) / 111139;
|
|
8129
8409
|
return c;
|
|
8130
8410
|
}
|
|
8131
|
-
exports.polyToPolsbyPopperCircle = polyToPolsbyPopperCircle;
|
|
8132
8411
|
function makeCircle(points) {
|
|
8133
8412
|
if (points == null)
|
|
8134
8413
|
return null;
|
|
@@ -8291,7 +8570,6 @@ function polyFromCircle(c, nSegments) {
|
|
|
8291
8570
|
// return multi-polygon
|
|
8292
8571
|
return [[poly]];
|
|
8293
8572
|
}
|
|
8294
|
-
exports.polyFromCircle = polyFromCircle;
|
|
8295
8573
|
// isLeft(): tests if a point is Left|On|Right of an infinite line.
|
|
8296
8574
|
// Input: three points P0, P1, and P2
|
|
8297
8575
|
// Return: >0 for P2 left of the line through P0 and P1
|
|
@@ -8319,7 +8597,6 @@ function polyToExteriorPoints(poly) {
|
|
|
8319
8597
|
});
|
|
8320
8598
|
return points.length > 0 ? points : null;
|
|
8321
8599
|
}
|
|
8322
|
-
exports.polyToExteriorPoints = polyToExteriorPoints;
|
|
8323
8600
|
//
|
|
8324
8601
|
// polyConvexHull() - Two algorithms:
|
|
8325
8602
|
// * Gram Scan (default) - in graham-scan.ts
|
|
@@ -8330,7 +8607,6 @@ function polyConvexHull(poly, altAlgorithm) {
|
|
|
8330
8607
|
return makeConvexHullMonotoneChain2D(poly);
|
|
8331
8608
|
return (0, graham_scan_1.makeConvexHullGrahamScan)(poly);
|
|
8332
8609
|
}
|
|
8333
|
-
exports.polyConvexHull = polyConvexHull;
|
|
8334
8610
|
function makeConvexHullMonotoneChain2D(poly) {
|
|
8335
8611
|
// Normalize input
|
|
8336
8612
|
let points = polyToExteriorPoints(poly);
|
|
@@ -8407,7 +8683,6 @@ function makeConvexHullMonotoneChain2D(poly) {
|
|
|
8407
8683
|
H[++top] = points[minmin]; // push joining endpoint onto stack
|
|
8408
8684
|
return pointsToPoly(H);
|
|
8409
8685
|
}
|
|
8410
|
-
exports.makeConvexHullMonotoneChain2D = makeConvexHullMonotoneChain2D;
|
|
8411
8686
|
function polyCompactness(poly, options) {
|
|
8412
8687
|
if (options === undefined)
|
|
8413
8688
|
options = exports.DefaultOptions;
|
|
@@ -8429,7 +8704,6 @@ function polyCompactness(poly, options) {
|
|
|
8429
8704
|
result.value = Math.trunc(((result.reock + result.polsby_popper) / 2) * 100);
|
|
8430
8705
|
return result;
|
|
8431
8706
|
}
|
|
8432
|
-
exports.polyCompactness = polyCompactness;
|
|
8433
8707
|
const EmptyPolyDescription = { npoly: 0, nhole: 0, npoint: 0 };
|
|
8434
8708
|
function polyDescribe(poly) {
|
|
8435
8709
|
let pp = polyNormalize(poly);
|
|
@@ -8443,12 +8717,10 @@ function polyDescribe(poly) {
|
|
|
8443
8717
|
});
|
|
8444
8718
|
return d;
|
|
8445
8719
|
}
|
|
8446
|
-
exports.polyDescribe = polyDescribe;
|
|
8447
8720
|
function npoints(poly) {
|
|
8448
8721
|
let d = polyDescribe(poly);
|
|
8449
8722
|
return d.npoint;
|
|
8450
8723
|
}
|
|
8451
|
-
exports.npoints = npoints;
|
|
8452
8724
|
//
|
|
8453
8725
|
// polyTransform: transform each point. Called for all polygons and all rings.
|
|
8454
8726
|
// point, by point. Returns a packed structure.
|
|
@@ -8466,7 +8738,6 @@ function polyTransform(poly, transformFn) {
|
|
|
8466
8738
|
});
|
|
8467
8739
|
return pp;
|
|
8468
8740
|
}
|
|
8469
|
-
exports.polyTransform = polyTransform;
|
|
8470
8741
|
function identityTransform(pt) {
|
|
8471
8742
|
return [pt[0], pt[1]];
|
|
8472
8743
|
}
|
|
@@ -8526,7 +8797,6 @@ function polyRingWindings(poly) {
|
|
|
8526
8797
|
});
|
|
8527
8798
|
return windings;
|
|
8528
8799
|
}
|
|
8529
|
-
exports.polyRingWindings = polyRingWindings;
|
|
8530
8800
|
function flattenMultiPoly(polys) {
|
|
8531
8801
|
let c = [];
|
|
8532
8802
|
polys.forEach((poly) => {
|
|
@@ -8578,7 +8848,6 @@ function featureRewind(f, options) {
|
|
|
8578
8848
|
});
|
|
8579
8849
|
return f;
|
|
8580
8850
|
}
|
|
8581
|
-
exports.featureRewind = featureRewind;
|
|
8582
8851
|
//
|
|
8583
8852
|
// polyRewindRings: Check the winding order of the polygon's ring. Rewind them,
|
|
8584
8853
|
// if necessary. Return a packed polygon.
|
|
@@ -8625,7 +8894,6 @@ function polyRewindRings(pp, bLog = false) {
|
|
|
8625
8894
|
});
|
|
8626
8895
|
return pp;
|
|
8627
8896
|
}
|
|
8628
|
-
exports.polyRewindRings = polyRewindRings;
|
|
8629
8897
|
//
|
|
8630
8898
|
// To figure out which way a ring is wound:
|
|
8631
8899
|
//
|
|
@@ -8659,7 +8927,6 @@ function polyBadCoordinates(f) {
|
|
|
8659
8927
|
}
|
|
8660
8928
|
return bad;
|
|
8661
8929
|
}
|
|
8662
|
-
exports.polyBadCoordinates = polyBadCoordinates;
|
|
8663
8930
|
|
|
8664
8931
|
|
|
8665
8932
|
/***/ }),
|
|
@@ -8687,15 +8954,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
8687
8954
|
}) : function(o, v) {
|
|
8688
8955
|
o["default"] = v;
|
|
8689
8956
|
});
|
|
8690
|
-
var __importStar = (this && this.__importStar) || function (
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
};
|
|
8957
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
8958
|
+
var ownKeys = function(o) {
|
|
8959
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
8960
|
+
var ar = [];
|
|
8961
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
8962
|
+
return ar;
|
|
8963
|
+
};
|
|
8964
|
+
return ownKeys(o);
|
|
8965
|
+
};
|
|
8966
|
+
return function (mod) {
|
|
8967
|
+
if (mod && mod.__esModule) return mod;
|
|
8968
|
+
var result = {};
|
|
8969
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
8970
|
+
__setModuleDefault(result, mod);
|
|
8971
|
+
return result;
|
|
8972
|
+
};
|
|
8973
|
+
})();
|
|
8697
8974
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8698
|
-
exports.
|
|
8975
|
+
exports.packCollection = packCollection;
|
|
8976
|
+
exports.unpackCollection = unpackCollection;
|
|
8977
|
+
exports.topoToBuffer = topoToBuffer;
|
|
8978
|
+
exports.topoFromBuffer = topoFromBuffer;
|
|
8699
8979
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
8700
8980
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
8701
8981
|
const T = __importStar(__webpack_require__(/*! ./topo */ "./lib/poly/topo.ts"));
|
|
@@ -8776,7 +9056,6 @@ function packCollection(coder, col) {
|
|
|
8776
9056
|
PP.featureUnpack(col);
|
|
8777
9057
|
return ab;
|
|
8778
9058
|
}
|
|
8779
|
-
exports.packCollection = packCollection;
|
|
8780
9059
|
function reverse(buf8, s, n) {
|
|
8781
9060
|
let e = s + n - 1;
|
|
8782
9061
|
while (s < e) {
|
|
@@ -8828,7 +9107,6 @@ function unpackCollection(coder, ab) {
|
|
|
8828
9107
|
f.geometry.packed.buffer = buf64; });
|
|
8829
9108
|
return col;
|
|
8830
9109
|
}
|
|
8831
|
-
exports.unpackCollection = unpackCollection;
|
|
8832
9110
|
// Format of packed buffer:
|
|
8833
9111
|
// [Size of JSON string] [4 bytes]
|
|
8834
9112
|
// [Size of packedarcs] [4 bytes]
|
|
@@ -8877,7 +9155,6 @@ function topoToBuffer(coder, topo) {
|
|
|
8877
9155
|
topo.packed = savepack;
|
|
8878
9156
|
return ab;
|
|
8879
9157
|
}
|
|
8880
|
-
exports.topoToBuffer = topoToBuffer;
|
|
8881
9158
|
function topoFromBuffer(coder, ab) {
|
|
8882
9159
|
let buf8 = new Uint8Array(ab);
|
|
8883
9160
|
let buf32 = new Int32Array(ab);
|
|
@@ -8891,7 +9168,6 @@ function topoFromBuffer(coder, ab) {
|
|
|
8891
9168
|
topo.packed.arcindices = new Int32Array(ab, stringLength + HeaderSize + arcsByteLength, arcindicesByteLength / 4);
|
|
8892
9169
|
return topo;
|
|
8893
9170
|
}
|
|
8894
|
-
exports.topoFromBuffer = topoFromBuffer;
|
|
8895
9171
|
|
|
8896
9172
|
|
|
8897
9173
|
/***/ }),
|
|
@@ -8919,18 +9195,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
8919
9195
|
}) : function(o, v) {
|
|
8920
9196
|
o["default"] = v;
|
|
8921
9197
|
});
|
|
8922
|
-
var __importStar = (this && this.__importStar) || function (
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
};
|
|
9198
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
9199
|
+
var ownKeys = function(o) {
|
|
9200
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
9201
|
+
var ar = [];
|
|
9202
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
9203
|
+
return ar;
|
|
9204
|
+
};
|
|
9205
|
+
return ownKeys(o);
|
|
9206
|
+
};
|
|
9207
|
+
return function (mod) {
|
|
9208
|
+
if (mod && mod.__esModule) return mod;
|
|
9209
|
+
var result = {};
|
|
9210
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
9211
|
+
__setModuleDefault(result, mod);
|
|
9212
|
+
return result;
|
|
9213
|
+
};
|
|
9214
|
+
})();
|
|
8929
9215
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8930
9216
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8931
9217
|
};
|
|
8932
9218
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8933
|
-
exports.
|
|
9219
|
+
exports.polyDistance = polyDistance;
|
|
9220
|
+
exports.polyLabel = polyLabel;
|
|
8934
9221
|
const tinyqueue_1 = __importDefault(__webpack_require__(/*! tinyqueue */ "tinyqueue"));
|
|
8935
9222
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
8936
9223
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
@@ -9005,7 +9292,6 @@ function polyDistance(poly, x, y) {
|
|
|
9005
9292
|
});
|
|
9006
9293
|
return minInside;
|
|
9007
9294
|
}
|
|
9008
|
-
exports.polyDistance = polyDistance;
|
|
9009
9295
|
//
|
|
9010
9296
|
// polyLabel: given polygon, return contained point furthest from any edge, and that distance
|
|
9011
9297
|
//
|
|
@@ -9103,7 +9389,6 @@ function polyLabel(poly, precision, debug) {
|
|
|
9103
9389
|
}
|
|
9104
9390
|
return { x: bestCell.x, y: bestCell.y, d: bestCell.d };
|
|
9105
9391
|
}
|
|
9106
|
-
exports.polyLabel = polyLabel;
|
|
9107
9392
|
function compareMax(a, b) { return b.max - a.max; }
|
|
9108
9393
|
class Cell {
|
|
9109
9394
|
constructor(x, y, h, forEachPointPair) {
|
|
@@ -9190,15 +9475,45 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
9190
9475
|
}) : function(o, v) {
|
|
9191
9476
|
o["default"] = v;
|
|
9192
9477
|
});
|
|
9193
|
-
var __importStar = (this && this.__importStar) || function (
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
};
|
|
9478
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
9479
|
+
var ownKeys = function(o) {
|
|
9480
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
9481
|
+
var ar = [];
|
|
9482
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
9483
|
+
return ar;
|
|
9484
|
+
};
|
|
9485
|
+
return ownKeys(o);
|
|
9486
|
+
};
|
|
9487
|
+
return function (mod) {
|
|
9488
|
+
if (mod && mod.__esModule) return mod;
|
|
9489
|
+
var result = {};
|
|
9490
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
9491
|
+
__setModuleDefault(result, mod);
|
|
9492
|
+
return result;
|
|
9493
|
+
};
|
|
9494
|
+
})();
|
|
9200
9495
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9201
|
-
exports.
|
|
9496
|
+
exports.polyPackSize = polyPackSize;
|
|
9497
|
+
exports.polyPackEachRing = polyPackEachRing;
|
|
9498
|
+
exports.polyPackEachPoint = polyPackEachPoint;
|
|
9499
|
+
exports.polyPackCountPoints = polyPackCountPoints;
|
|
9500
|
+
exports.polyPacked = polyPacked;
|
|
9501
|
+
exports.normalizeArcs = normalizeArcs;
|
|
9502
|
+
exports.countArcPolygons = countArcPolygons;
|
|
9503
|
+
exports.countArcRings = countArcRings;
|
|
9504
|
+
exports.countOneArcPoints = countOneArcPoints;
|
|
9505
|
+
exports.countArcPoints = countArcPoints;
|
|
9506
|
+
exports.polyPackTopoArcs = polyPackTopoArcs;
|
|
9507
|
+
exports.polyPack = polyPack;
|
|
9508
|
+
exports.polyPackCopy = polyPackCopy;
|
|
9509
|
+
exports.polyUnpack = polyUnpack;
|
|
9510
|
+
exports.featurePackSize = featurePackSize;
|
|
9511
|
+
exports.featurePack = featurePack;
|
|
9512
|
+
exports.featureUnpack = featureUnpack;
|
|
9513
|
+
exports.featureUnpackTemporarily = featureUnpackTemporarily;
|
|
9514
|
+
exports.featureRepack = featureRepack;
|
|
9515
|
+
exports.featurePackString = featurePackString;
|
|
9516
|
+
exports.featureUnpackString = featureUnpackString;
|
|
9202
9517
|
// Shared libraries
|
|
9203
9518
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
9204
9519
|
function polyPackSize(coords) {
|
|
@@ -9226,7 +9541,6 @@ function polyPackSize(coords) {
|
|
|
9226
9541
|
}
|
|
9227
9542
|
return nFloats;
|
|
9228
9543
|
}
|
|
9229
|
-
exports.polyPackSize = polyPackSize;
|
|
9230
9544
|
function polyPackEachRing(pack, cb) {
|
|
9231
9545
|
if (pack == null || pack.buffer == null)
|
|
9232
9546
|
return;
|
|
@@ -9251,7 +9565,6 @@ function polyPackEachRing(pack, cb) {
|
|
|
9251
9565
|
}
|
|
9252
9566
|
}
|
|
9253
9567
|
}
|
|
9254
|
-
exports.polyPackEachRing = polyPackEachRing;
|
|
9255
9568
|
function polyPackEachPoint(pack, cb) {
|
|
9256
9569
|
polyPackEachRing(pack, (b, iPoly, iRing, iOffset, nPoints) => {
|
|
9257
9570
|
let iEnd = iOffset + (nPoints * 2);
|
|
@@ -9259,13 +9572,11 @@ function polyPackEachPoint(pack, cb) {
|
|
|
9259
9572
|
cb(b, iPoly, iRing, iOffset);
|
|
9260
9573
|
});
|
|
9261
9574
|
}
|
|
9262
|
-
exports.polyPackEachPoint = polyPackEachPoint;
|
|
9263
9575
|
function polyPackCountPoints(pack) {
|
|
9264
9576
|
let n = 0;
|
|
9265
9577
|
polyPackEachRing(pack, (b, iPoly, iRing, iOffset, nPoints) => { n += nPoints; });
|
|
9266
9578
|
return n;
|
|
9267
9579
|
}
|
|
9268
|
-
exports.polyPackCountPoints = polyPackCountPoints;
|
|
9269
9580
|
function polyPacked(f) {
|
|
9270
9581
|
if (f == null)
|
|
9271
9582
|
return false;
|
|
@@ -9277,7 +9588,6 @@ function polyPacked(f) {
|
|
|
9277
9588
|
return polyPacked(f.features[0]);
|
|
9278
9589
|
return false;
|
|
9279
9590
|
}
|
|
9280
|
-
exports.polyPacked = polyPacked;
|
|
9281
9591
|
// Convert to multi-polygon format if necessary
|
|
9282
9592
|
function normalizeArcs(arcs) {
|
|
9283
9593
|
let d = Util.depthof(arcs);
|
|
@@ -9286,12 +9596,10 @@ function normalizeArcs(arcs) {
|
|
|
9286
9596
|
} // note that depth is n-1 compared to coords because leaf is just number, not [x,y]
|
|
9287
9597
|
return arcs;
|
|
9288
9598
|
}
|
|
9289
|
-
exports.normalizeArcs = normalizeArcs;
|
|
9290
9599
|
function countArcPolygons(arcs) {
|
|
9291
9600
|
arcs = normalizeArcs(arcs);
|
|
9292
9601
|
return arcs.length;
|
|
9293
9602
|
}
|
|
9294
|
-
exports.countArcPolygons = countArcPolygons;
|
|
9295
9603
|
function countArcRings(arcs, iPoly) {
|
|
9296
9604
|
arcs = normalizeArcs(arcs);
|
|
9297
9605
|
let r = 0;
|
|
@@ -9299,7 +9607,6 @@ function countArcRings(arcs, iPoly) {
|
|
|
9299
9607
|
r += a.length; });
|
|
9300
9608
|
return r;
|
|
9301
9609
|
}
|
|
9302
|
-
exports.countArcRings = countArcRings;
|
|
9303
9610
|
function countOneArcPoints(topo, ring) {
|
|
9304
9611
|
// for each ring
|
|
9305
9612
|
let n = 0;
|
|
@@ -9314,7 +9621,6 @@ function countOneArcPoints(topo, ring) {
|
|
|
9314
9621
|
n = 4;
|
|
9315
9622
|
return n;
|
|
9316
9623
|
}
|
|
9317
|
-
exports.countOneArcPoints = countOneArcPoints;
|
|
9318
9624
|
function countArcPoints(topo, arcs, iPoly) {
|
|
9319
9625
|
arcs = normalizeArcs(arcs);
|
|
9320
9626
|
let npoints = 0;
|
|
@@ -9324,7 +9630,6 @@ function countArcPoints(topo, arcs, iPoly) {
|
|
|
9324
9630
|
});
|
|
9325
9631
|
return npoints;
|
|
9326
9632
|
}
|
|
9327
|
-
exports.countArcPoints = countArcPoints;
|
|
9328
9633
|
// This packs the TopoJSON arc format into a PolyPack. Basics:
|
|
9329
9634
|
// 1) Negative indices indicate arc should be traversed backward.
|
|
9330
9635
|
// 2) First and last point of sequential arcs are duplicated, so only include one instance. Easiest way
|
|
@@ -9386,7 +9691,6 @@ function polyPackTopoArcs(topo, arcs, iPoly) {
|
|
|
9386
9691
|
});
|
|
9387
9692
|
return prepack;
|
|
9388
9693
|
}
|
|
9389
|
-
exports.polyPackTopoArcs = polyPackTopoArcs;
|
|
9390
9694
|
function polyPack(coords, prepack) {
|
|
9391
9695
|
// Null feature?
|
|
9392
9696
|
if (coords == null || (coords.length !== undefined && coords.length == 0))
|
|
@@ -9451,7 +9755,6 @@ function polyPack(coords, prepack) {
|
|
|
9451
9755
|
}
|
|
9452
9756
|
return prepack;
|
|
9453
9757
|
}
|
|
9454
|
-
exports.polyPack = polyPack;
|
|
9455
9758
|
function polyPackCopy(coords) {
|
|
9456
9759
|
let pp = polyPack(coords);
|
|
9457
9760
|
if (pp == null)
|
|
@@ -9465,7 +9768,6 @@ function polyPackCopy(coords) {
|
|
|
9465
9768
|
afDst[i] = afSrc[i + pp.offset];
|
|
9466
9769
|
return copy;
|
|
9467
9770
|
}
|
|
9468
|
-
exports.polyPackCopy = polyPackCopy;
|
|
9469
9771
|
function polyUnpack(prepack) {
|
|
9470
9772
|
// Check if not packed
|
|
9471
9773
|
if (prepack == null)
|
|
@@ -9494,13 +9796,11 @@ function polyUnpack(prepack) {
|
|
|
9494
9796
|
}
|
|
9495
9797
|
return coords.length > 1 ? coords : coords[0];
|
|
9496
9798
|
}
|
|
9497
|
-
exports.polyUnpack = polyUnpack;
|
|
9498
9799
|
function featurePackSize(f) {
|
|
9499
9800
|
if (f && f.geometry && f.geometry.coordinates && f.geometry.type !== 'Point')
|
|
9500
9801
|
return polyPackSize(f.geometry.coordinates);
|
|
9501
9802
|
return 0;
|
|
9502
9803
|
}
|
|
9503
|
-
exports.featurePackSize = featurePackSize;
|
|
9504
9804
|
function featurePack(f, prepack) {
|
|
9505
9805
|
if (f && f.type === 'Feature') {
|
|
9506
9806
|
if (f.geometry && f.geometry.type === 'Point')
|
|
@@ -9551,7 +9851,6 @@ function featurePack(f, prepack) {
|
|
|
9551
9851
|
}
|
|
9552
9852
|
return null;
|
|
9553
9853
|
}
|
|
9554
|
-
exports.featurePack = featurePack;
|
|
9555
9854
|
function featureUnpack(f) {
|
|
9556
9855
|
if (f && f.geometry && f.geometry.packed !== undefined) {
|
|
9557
9856
|
f.geometry.coordinates = polyUnpack(f.geometry.packed);
|
|
@@ -9573,7 +9872,6 @@ function featureUnpack(f) {
|
|
|
9573
9872
|
}
|
|
9574
9873
|
return f;
|
|
9575
9874
|
}
|
|
9576
|
-
exports.featureUnpack = featureUnpack;
|
|
9577
9875
|
function featureUnpackTemporarily(f, save) {
|
|
9578
9876
|
if (save === undefined)
|
|
9579
9877
|
save = new WeakMap();
|
|
@@ -9592,7 +9890,6 @@ function featureUnpackTemporarily(f, save) {
|
|
|
9592
9890
|
}
|
|
9593
9891
|
return save;
|
|
9594
9892
|
}
|
|
9595
|
-
exports.featureUnpackTemporarily = featureUnpackTemporarily;
|
|
9596
9893
|
function featureRepack(f, save) {
|
|
9597
9894
|
if (f && f.type === 'Feature') {
|
|
9598
9895
|
if (f.geometry) {
|
|
@@ -9608,7 +9905,6 @@ function featureRepack(f, save) {
|
|
|
9608
9905
|
}
|
|
9609
9906
|
return f;
|
|
9610
9907
|
}
|
|
9611
|
-
exports.featureRepack = featureRepack;
|
|
9612
9908
|
function featurePackString(f) {
|
|
9613
9909
|
let packed = f.offset ? f : (f.geometry.packed ? f.geometry.packed : polyPack(f.geometry.coordinates));
|
|
9614
9910
|
let af = packed.buffer;
|
|
@@ -9617,7 +9913,6 @@ function featurePackString(f) {
|
|
|
9617
9913
|
a.push(String(af[i]));
|
|
9618
9914
|
return a.join(' ');
|
|
9619
9915
|
}
|
|
9620
|
-
exports.featurePackString = featurePackString;
|
|
9621
9916
|
function featureUnpackString(s) {
|
|
9622
9917
|
let a = s.split(' ');
|
|
9623
9918
|
let ab = new ArrayBuffer(a.length * 8);
|
|
@@ -9630,7 +9925,6 @@ function featureUnpackString(s) {
|
|
|
9630
9925
|
f.geometry.type = 'MultiPolygon';
|
|
9631
9926
|
return f;
|
|
9632
9927
|
}
|
|
9633
|
-
exports.featureUnpackString = featureUnpackString;
|
|
9634
9928
|
|
|
9635
9929
|
|
|
9636
9930
|
/***/ }),
|
|
@@ -9658,15 +9952,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
9658
9952
|
}) : function(o, v) {
|
|
9659
9953
|
o["default"] = v;
|
|
9660
9954
|
});
|
|
9661
|
-
var __importStar = (this && this.__importStar) || function (
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
};
|
|
9955
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
9956
|
+
var ownKeys = function(o) {
|
|
9957
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
9958
|
+
var ar = [];
|
|
9959
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
9960
|
+
return ar;
|
|
9961
|
+
};
|
|
9962
|
+
return ownKeys(o);
|
|
9963
|
+
};
|
|
9964
|
+
return function (mod) {
|
|
9965
|
+
if (mod && mod.__esModule) return mod;
|
|
9966
|
+
var result = {};
|
|
9967
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
9968
|
+
__setModuleDefault(result, mod);
|
|
9969
|
+
return result;
|
|
9970
|
+
};
|
|
9971
|
+
})();
|
|
9668
9972
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9669
|
-
exports.polyRound =
|
|
9973
|
+
exports.polyRound = polyRound;
|
|
9670
9974
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
9671
9975
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
9672
9976
|
// Round feature geometry to 6 decimal precision
|
|
@@ -9692,7 +9996,6 @@ function polyRound(o) {
|
|
|
9692
9996
|
}
|
|
9693
9997
|
return o;
|
|
9694
9998
|
}
|
|
9695
|
-
exports.polyRound = polyRound;
|
|
9696
9999
|
|
|
9697
10000
|
|
|
9698
10001
|
/***/ }),
|
|
@@ -9720,15 +10023,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
9720
10023
|
}) : function(o, v) {
|
|
9721
10024
|
o["default"] = v;
|
|
9722
10025
|
});
|
|
9723
|
-
var __importStar = (this && this.__importStar) || function (
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
};
|
|
10026
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
10027
|
+
var ownKeys = function(o) {
|
|
10028
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
10029
|
+
var ar = [];
|
|
10030
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
10031
|
+
return ar;
|
|
10032
|
+
};
|
|
10033
|
+
return ownKeys(o);
|
|
10034
|
+
};
|
|
10035
|
+
return function (mod) {
|
|
10036
|
+
if (mod && mod.__esModule) return mod;
|
|
10037
|
+
var result = {};
|
|
10038
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10039
|
+
__setModuleDefault(result, mod);
|
|
10040
|
+
return result;
|
|
10041
|
+
};
|
|
10042
|
+
})();
|
|
9730
10043
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9731
|
-
exports.polySimplify =
|
|
10044
|
+
exports.polySimplify = polySimplify;
|
|
9732
10045
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
9733
10046
|
const simplify_1 = __webpack_require__(/*! ./simplify */ "./lib/poly/simplify.ts");
|
|
9734
10047
|
function polySimplify(poly, tolerance = 0.0001) {
|
|
@@ -9749,7 +10062,6 @@ function polySimplify(poly, tolerance = 0.0001) {
|
|
|
9749
10062
|
p[j] = (0, simplify_1.simplify)(p[j], tolerance, true);
|
|
9750
10063
|
}
|
|
9751
10064
|
}
|
|
9752
|
-
exports.polySimplify = polySimplify;
|
|
9753
10065
|
|
|
9754
10066
|
|
|
9755
10067
|
/***/ }),
|
|
@@ -9777,15 +10089,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
9777
10089
|
}) : function(o, v) {
|
|
9778
10090
|
o["default"] = v;
|
|
9779
10091
|
});
|
|
9780
|
-
var __importStar = (this && this.__importStar) || function (
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
};
|
|
10092
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
10093
|
+
var ownKeys = function(o) {
|
|
10094
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
10095
|
+
var ar = [];
|
|
10096
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
10097
|
+
return ar;
|
|
10098
|
+
};
|
|
10099
|
+
return ownKeys(o);
|
|
10100
|
+
};
|
|
10101
|
+
return function (mod) {
|
|
10102
|
+
if (mod && mod.__esModule) return mod;
|
|
10103
|
+
var result = {};
|
|
10104
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10105
|
+
__setModuleDefault(result, mod);
|
|
10106
|
+
return result;
|
|
10107
|
+
};
|
|
10108
|
+
})();
|
|
9787
10109
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9788
|
-
exports.FsmQuadTree = exports.DefaultQuadOptions =
|
|
10110
|
+
exports.FsmQuadTree = exports.DefaultQuadOptions = void 0;
|
|
10111
|
+
exports.unionPolys = unionPolys;
|
|
9789
10112
|
// Public libraries
|
|
9790
10113
|
const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
|
|
9791
10114
|
// Shared libraries
|
|
@@ -9831,7 +10154,6 @@ function unionPolys(polys) {
|
|
|
9831
10154
|
let poly = cleanPolys.pop();
|
|
9832
10155
|
return PR.polyRound(_union(poly, ...cleanPolys));
|
|
9833
10156
|
}
|
|
9834
|
-
exports.unionPolys = unionPolys;
|
|
9835
10157
|
exports.DefaultQuadOptions = { maxLeafCount: 20, maxDepth: 20, tickStep: 1 };
|
|
9836
10158
|
;
|
|
9837
10159
|
// Use geo orientation for t/b (that is, t > b)
|
|
@@ -10013,15 +10335,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
10013
10335
|
}) : function(o, v) {
|
|
10014
10336
|
o["default"] = v;
|
|
10015
10337
|
});
|
|
10016
|
-
var __importStar = (this && this.__importStar) || function (
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
};
|
|
10338
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
10339
|
+
var ownKeys = function(o) {
|
|
10340
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
10341
|
+
var ar = [];
|
|
10342
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
10343
|
+
return ar;
|
|
10344
|
+
};
|
|
10345
|
+
return ownKeys(o);
|
|
10346
|
+
};
|
|
10347
|
+
return function (mod) {
|
|
10348
|
+
if (mod && mod.__esModule) return mod;
|
|
10349
|
+
var result = {};
|
|
10350
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10351
|
+
__setModuleDefault(result, mod);
|
|
10352
|
+
return result;
|
|
10353
|
+
};
|
|
10354
|
+
})();
|
|
10023
10355
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10024
|
-
exports.selfIntersect =
|
|
10356
|
+
exports.selfIntersect = selfIntersect;
|
|
10025
10357
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
10026
10358
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
10027
10359
|
// Given three colinear points p, q, r, the function checks if
|
|
@@ -10096,7 +10428,6 @@ function selfIntersect(poly) {
|
|
|
10096
10428
|
});
|
|
10097
10429
|
return bIntersect;
|
|
10098
10430
|
}
|
|
10099
|
-
exports.selfIntersect = selfIntersect;
|
|
10100
10431
|
|
|
10101
10432
|
|
|
10102
10433
|
/***/ }),
|
|
@@ -10124,18 +10455,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
10124
10455
|
}) : function(o, v) {
|
|
10125
10456
|
o["default"] = v;
|
|
10126
10457
|
});
|
|
10127
|
-
var __importStar = (this && this.__importStar) || function (
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
};
|
|
10458
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
10459
|
+
var ownKeys = function(o) {
|
|
10460
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
10461
|
+
var ar = [];
|
|
10462
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
10463
|
+
return ar;
|
|
10464
|
+
};
|
|
10465
|
+
return ownKeys(o);
|
|
10466
|
+
};
|
|
10467
|
+
return function (mod) {
|
|
10468
|
+
if (mod && mod.__esModule) return mod;
|
|
10469
|
+
var result = {};
|
|
10470
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10471
|
+
__setModuleDefault(result, mod);
|
|
10472
|
+
return result;
|
|
10473
|
+
};
|
|
10474
|
+
})();
|
|
10134
10475
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10135
10476
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10136
10477
|
};
|
|
10137
10478
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10138
|
-
exports.selfIntersectFast =
|
|
10479
|
+
exports.selfIntersectFast = selfIntersectFast;
|
|
10139
10480
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
10140
10481
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
10141
10482
|
// Adapted from rowanwins/shamos-hoey
|
|
@@ -10360,7 +10701,6 @@ function selfIntersectFast(poly) {
|
|
|
10360
10701
|
});
|
|
10361
10702
|
return runCheck(eventQueue);
|
|
10362
10703
|
}
|
|
10363
|
-
exports.selfIntersectFast = selfIntersectFast;
|
|
10364
10704
|
|
|
10365
10705
|
|
|
10366
10706
|
/***/ }),
|
|
@@ -10379,7 +10719,7 @@ exports.selfIntersectFast = selfIntersectFast;
|
|
|
10379
10719
|
mourner.github.io/simplify-js
|
|
10380
10720
|
*/
|
|
10381
10721
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10382
|
-
exports.simplify =
|
|
10722
|
+
exports.simplify = simplify;
|
|
10383
10723
|
// square distance between 2 points
|
|
10384
10724
|
function getSqDist(p1, p2) {
|
|
10385
10725
|
var dx = p1[0] - p2[0], dy = p1[1] - p2[1];
|
|
@@ -10452,7 +10792,6 @@ function simplify(points, tolerance = 1, highestQuality = false) {
|
|
|
10452
10792
|
points = simplifyDouglasPeucker(points, sqTolerance);
|
|
10453
10793
|
return points;
|
|
10454
10794
|
}
|
|
10455
|
-
exports.simplify = simplify;
|
|
10456
10795
|
|
|
10457
10796
|
|
|
10458
10797
|
/***/ }),
|
|
@@ -10480,15 +10819,36 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
10480
10819
|
}) : function(o, v) {
|
|
10481
10820
|
o["default"] = v;
|
|
10482
10821
|
});
|
|
10483
|
-
var __importStar = (this && this.__importStar) || function (
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
|
|
10489
|
-
};
|
|
10822
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
10823
|
+
var ownKeys = function(o) {
|
|
10824
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
10825
|
+
var ar = [];
|
|
10826
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
10827
|
+
return ar;
|
|
10828
|
+
};
|
|
10829
|
+
return ownKeys(o);
|
|
10830
|
+
};
|
|
10831
|
+
return function (mod) {
|
|
10832
|
+
if (mod && mod.__esModule) return mod;
|
|
10833
|
+
var result = {};
|
|
10834
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10835
|
+
__setModuleDefault(result, mod);
|
|
10836
|
+
return result;
|
|
10837
|
+
};
|
|
10838
|
+
})();
|
|
10490
10839
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10491
|
-
exports.
|
|
10840
|
+
exports.FsmTopoUnion = void 0;
|
|
10841
|
+
exports.topoFromCollection = topoFromCollection;
|
|
10842
|
+
exports.topoContiguity = topoContiguity;
|
|
10843
|
+
exports.topoToFeature = topoToFeature;
|
|
10844
|
+
exports.topoSplice = topoSplice;
|
|
10845
|
+
exports.topoToCollection = topoToCollection;
|
|
10846
|
+
exports.topoSimplifyCollection = topoSimplifyCollection;
|
|
10847
|
+
exports.topoMerge = topoMerge;
|
|
10848
|
+
exports.topoMergeFeatures = topoMergeFeatures;
|
|
10849
|
+
exports.topoPacked = topoPacked;
|
|
10850
|
+
exports.topoPack = topoPack;
|
|
10851
|
+
exports.topoUnpack = topoUnpack;
|
|
10492
10852
|
// Forked version that supports packing
|
|
10493
10853
|
const TopoClient = __importStar(__webpack_require__(/*! @dra2020/topojson-client */ "@dra2020/topojson-client"));
|
|
10494
10854
|
// Forked version that fixes self-looping hole problem
|
|
@@ -10533,7 +10893,6 @@ function topoFromCollection(col) {
|
|
|
10533
10893
|
topo.datasets = col.datasets;
|
|
10534
10894
|
return topo;
|
|
10535
10895
|
}
|
|
10536
|
-
exports.topoFromCollection = topoFromCollection;
|
|
10537
10896
|
function ringsCancel(outerPoly, innerRing) {
|
|
10538
10897
|
if (outerPoly.length != 1)
|
|
10539
10898
|
return false;
|
|
@@ -10569,17 +10928,14 @@ function topoContiguity(topo) {
|
|
|
10569
10928
|
});
|
|
10570
10929
|
return result;
|
|
10571
10930
|
}
|
|
10572
|
-
exports.topoContiguity = topoContiguity;
|
|
10573
10931
|
function topoToFeature(topo, geoid) {
|
|
10574
10932
|
return correctGeometry(TopoClient.feature(topo, topo.objects[geoid]));
|
|
10575
10933
|
}
|
|
10576
|
-
exports.topoToFeature = topoToFeature;
|
|
10577
10934
|
function topoSplice(topoarray) {
|
|
10578
10935
|
if (topoarray)
|
|
10579
10936
|
topoarray.forEach(e => topoPack(e.topology));
|
|
10580
10937
|
return TopoClient.splice(topoarray);
|
|
10581
10938
|
}
|
|
10582
|
-
exports.topoSplice = topoSplice;
|
|
10583
10939
|
function topoToCollection(topo) {
|
|
10584
10940
|
let col = { type: 'FeatureCollection', features: [] };
|
|
10585
10941
|
if (topo)
|
|
@@ -10590,7 +10946,6 @@ function topoToCollection(topo) {
|
|
|
10590
10946
|
col.datasets = topo.datasets;
|
|
10591
10947
|
return col;
|
|
10592
10948
|
}
|
|
10593
|
-
exports.topoToCollection = topoToCollection;
|
|
10594
10949
|
function keepArcs(topo, arcs, keepweight) {
|
|
10595
10950
|
arcs.forEach((a) => {
|
|
10596
10951
|
if (Array.isArray(a))
|
|
@@ -10781,7 +11136,6 @@ function topoSimplifyCollection(col, options) {
|
|
|
10781
11136
|
log(options.log, `topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
|
|
10782
11137
|
return col;
|
|
10783
11138
|
}
|
|
10784
|
-
exports.topoSimplifyCollection = topoSimplifyCollection;
|
|
10785
11139
|
function topoMerge(topo, geoids) {
|
|
10786
11140
|
if (geoids == null || geoids.length == 0)
|
|
10787
11141
|
return null;
|
|
@@ -10789,14 +11143,12 @@ function topoMerge(topo, geoids) {
|
|
|
10789
11143
|
geoids.forEach((geoid) => objects.push(topo.objects[geoid]));
|
|
10790
11144
|
return correctGeometry({ type: 'Feature', properties: {}, geometry: TopoClient.merge(topo, objects) });
|
|
10791
11145
|
}
|
|
10792
|
-
exports.topoMerge = topoMerge;
|
|
10793
11146
|
function topoMergeFeatures(topo, features) {
|
|
10794
11147
|
if (features == null || features.length == 0)
|
|
10795
11148
|
return null;
|
|
10796
11149
|
let prop = getGEOID(features);
|
|
10797
11150
|
return topoMerge(topo, features.map(f => f.properties[prop]));
|
|
10798
11151
|
}
|
|
10799
|
-
exports.topoMergeFeatures = topoMergeFeatures;
|
|
10800
11152
|
let UniqueState = FSM.FSM_CUSTOM1;
|
|
10801
11153
|
let FSM_COMPUTING = UniqueState++;
|
|
10802
11154
|
class FsmIncrementalUnion extends FSM.Fsm {
|
|
@@ -10904,20 +11256,17 @@ exports.FsmTopoUnion = FsmTopoUnion;
|
|
|
10904
11256
|
function topoPacked(topo) {
|
|
10905
11257
|
return topo.packed !== undefined;
|
|
10906
11258
|
}
|
|
10907
|
-
exports.topoPacked = topoPacked;
|
|
10908
11259
|
function topoPack(topo) {
|
|
10909
11260
|
let tc = TopoClient;
|
|
10910
11261
|
TopoClient.packArcs(topo);
|
|
10911
11262
|
TopoClient.packArcIndices(topo);
|
|
10912
11263
|
return topo;
|
|
10913
11264
|
}
|
|
10914
|
-
exports.topoPack = topoPack;
|
|
10915
11265
|
function topoUnpack(topo) {
|
|
10916
11266
|
TopoClient.unpackArcs(topo);
|
|
10917
11267
|
TopoClient.unpackArcIndices(topo);
|
|
10918
11268
|
return topo;
|
|
10919
11269
|
}
|
|
10920
|
-
exports.topoUnpack = topoUnpack;
|
|
10921
11270
|
|
|
10922
11271
|
|
|
10923
11272
|
/***/ }),
|
|
@@ -10945,15 +11294,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
10945
11294
|
}) : function(o, v) {
|
|
10946
11295
|
o["default"] = v;
|
|
10947
11296
|
});
|
|
10948
|
-
var __importStar = (this && this.__importStar) || function (
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
};
|
|
11297
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
11298
|
+
var ownKeys = function(o) {
|
|
11299
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
11300
|
+
var ar = [];
|
|
11301
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
11302
|
+
return ar;
|
|
11303
|
+
};
|
|
11304
|
+
return ownKeys(o);
|
|
11305
|
+
};
|
|
11306
|
+
return function (mod) {
|
|
11307
|
+
if (mod && mod.__esModule) return mod;
|
|
11308
|
+
var result = {};
|
|
11309
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
11310
|
+
__setModuleDefault(result, mod);
|
|
11311
|
+
return result;
|
|
11312
|
+
};
|
|
11313
|
+
})();
|
|
10955
11314
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10956
|
-
exports.FsmUnion =
|
|
11315
|
+
exports.FsmUnion = void 0;
|
|
11316
|
+
exports.polyIntersects = polyIntersects;
|
|
11317
|
+
exports.polyIntersectArea = polyIntersectArea;
|
|
11318
|
+
exports.polyDifference = polyDifference;
|
|
10957
11319
|
const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
|
|
10958
11320
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
10959
11321
|
const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
|
|
@@ -11016,7 +11378,6 @@ function polyIntersects(p1, p2) {
|
|
|
11016
11378
|
});
|
|
11017
11379
|
return bIntersects;
|
|
11018
11380
|
}
|
|
11019
|
-
exports.polyIntersects = polyIntersects;
|
|
11020
11381
|
function polyIntersectArea(p1, p2) {
|
|
11021
11382
|
let pp1 = Poly.polyNormalize(p1);
|
|
11022
11383
|
let pp2 = Poly.polyNormalize(p2);
|
|
@@ -11036,7 +11397,6 @@ function polyIntersectArea(p1, p2) {
|
|
|
11036
11397
|
});
|
|
11037
11398
|
return area;
|
|
11038
11399
|
}
|
|
11039
|
-
exports.polyIntersectArea = polyIntersectArea;
|
|
11040
11400
|
function polyDifference(main, parts) {
|
|
11041
11401
|
main = PP.polyUnpack(coords(main));
|
|
11042
11402
|
// need to explode multipolygon so that "exploded" is a valid multipolygon input to underlying difference routine
|
|
@@ -11050,7 +11410,6 @@ function polyDifference(main, parts) {
|
|
|
11050
11410
|
});
|
|
11051
11411
|
return PR.polyRound(_difference(main, exploded));
|
|
11052
11412
|
}
|
|
11053
|
-
exports.polyDifference = polyDifference;
|
|
11054
11413
|
class FsmDifference extends FSM.Fsm {
|
|
11055
11414
|
constructor(env, accum, polys) {
|
|
11056
11415
|
super(env);
|
|
@@ -11337,15 +11696,27 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11337
11696
|
}) : function(o, v) {
|
|
11338
11697
|
o["default"] = v;
|
|
11339
11698
|
});
|
|
11340
|
-
var __importStar = (this && this.__importStar) || function (
|
|
11341
|
-
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
|
|
11346
|
-
};
|
|
11699
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
11700
|
+
var ownKeys = function(o) {
|
|
11701
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
11702
|
+
var ar = [];
|
|
11703
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
11704
|
+
return ar;
|
|
11705
|
+
};
|
|
11706
|
+
return ownKeys(o);
|
|
11707
|
+
};
|
|
11708
|
+
return function (mod) {
|
|
11709
|
+
if (mod && mod.__esModule) return mod;
|
|
11710
|
+
var result = {};
|
|
11711
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
11712
|
+
__setModuleDefault(result, mod);
|
|
11713
|
+
return result;
|
|
11714
|
+
};
|
|
11715
|
+
})();
|
|
11347
11716
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11348
|
-
exports.BinTrieBuilder = exports.BinTrie =
|
|
11717
|
+
exports.BinTrieBuilder = exports.BinTrie = void 0;
|
|
11718
|
+
exports.s2u8 = s2u8;
|
|
11719
|
+
exports.u82s = u82s;
|
|
11349
11720
|
const U = __importStar(__webpack_require__(/*! ./util */ "./lib/util/util.ts"));
|
|
11350
11721
|
/*
|
|
11351
11722
|
-- For Node
|
|
@@ -11359,11 +11730,9 @@ const MaxKeyLength = 128;
|
|
|
11359
11730
|
function s2u8(coder, s) {
|
|
11360
11731
|
return coder.encoder.encode(s);
|
|
11361
11732
|
}
|
|
11362
|
-
exports.s2u8 = s2u8;
|
|
11363
11733
|
function u82s(coder, u8, offset, n) {
|
|
11364
11734
|
return coder.decoder.decode(u8.subarray(offset, offset + n));
|
|
11365
11735
|
}
|
|
11366
|
-
exports.u82s = u82s;
|
|
11367
11736
|
const NullFragment = { count: 0, used: 0, offset: 0, s: '' };
|
|
11368
11737
|
function sortBestPair(p1, p2) {
|
|
11369
11738
|
let d = (p1.f1.count + p1.f2.count) - (p2.f1.count + p2.f2.count);
|
|
@@ -11949,7 +12318,9 @@ exports.CountedHash = CountedHash;
|
|
|
11949
12318
|
|
|
11950
12319
|
|
|
11951
12320
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11952
|
-
exports.
|
|
12321
|
+
exports.execGradient = execGradient;
|
|
12322
|
+
exports.parseGradient = parseGradient;
|
|
12323
|
+
exports.asCSSGradient = asCSSGradient;
|
|
11953
12324
|
function parseStops(stops) {
|
|
11954
12325
|
if (stops[0].rgb)
|
|
11955
12326
|
return;
|
|
@@ -11986,7 +12357,6 @@ function execGradient(stops, value) {
|
|
|
11986
12357
|
}
|
|
11987
12358
|
return toHexColor(r, g, b);
|
|
11988
12359
|
}
|
|
11989
|
-
exports.execGradient = execGradient;
|
|
11990
12360
|
function parseGradient(sStops) {
|
|
11991
12361
|
let stops = [];
|
|
11992
12362
|
let re = / ?([^ ]+) ([^ ,]+%?),?(.*)/;
|
|
@@ -12013,7 +12383,6 @@ function parseGradient(sStops) {
|
|
|
12013
12383
|
}
|
|
12014
12384
|
return stops;
|
|
12015
12385
|
}
|
|
12016
|
-
exports.parseGradient = parseGradient;
|
|
12017
12386
|
function asCSSGradient(stops) {
|
|
12018
12387
|
parseStops(stops);
|
|
12019
12388
|
let a = [];
|
|
@@ -12023,7 +12392,6 @@ function asCSSGradient(stops) {
|
|
|
12023
12392
|
});
|
|
12024
12393
|
return `linear-gradient(to right, ${a.join(', ')})`;
|
|
12025
12394
|
}
|
|
12026
|
-
exports.asCSSGradient = asCSSGradient;
|
|
12027
12395
|
|
|
12028
12396
|
|
|
12029
12397
|
/***/ }),
|
|
@@ -12105,9 +12473,46 @@ exports.IndexedArray = IndexedArray;
|
|
|
12105
12473
|
|
|
12106
12474
|
|
|
12107
12475
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12108
|
-
exports.
|
|
12109
|
-
function Now() { return (new Date()).toJSON(); }
|
|
12476
|
+
exports.Deadline = exports.MultiTimer = exports.Elapsed = void 0;
|
|
12110
12477
|
exports.Now = Now;
|
|
12478
|
+
exports.createGuid = createGuid;
|
|
12479
|
+
exports.isGuid = isGuid;
|
|
12480
|
+
exports.createKeyedGuid = createKeyedGuid;
|
|
12481
|
+
exports.guidKey = guidKey;
|
|
12482
|
+
exports.sizeof = sizeof;
|
|
12483
|
+
exports.depthof = depthof;
|
|
12484
|
+
exports.isEmpty = isEmpty;
|
|
12485
|
+
exports.countKeys = countKeys;
|
|
12486
|
+
exports.nthProperty = nthProperty;
|
|
12487
|
+
exports.nthKey = nthKey;
|
|
12488
|
+
exports.partialEqual = partialEqual;
|
|
12489
|
+
exports.deepEqual = deepEqual;
|
|
12490
|
+
exports.prettyDate = prettyDate;
|
|
12491
|
+
exports.relativeDate = relativeDate;
|
|
12492
|
+
exports.recentDate = recentDate;
|
|
12493
|
+
exports.textToHtml = textToHtml;
|
|
12494
|
+
exports.shallowCopy = shallowCopy;
|
|
12495
|
+
exports.shallowAssign = shallowAssign;
|
|
12496
|
+
exports.shallowDelete = shallowDelete;
|
|
12497
|
+
exports.shallowAssignImmutable = shallowAssignImmutable;
|
|
12498
|
+
exports.shallowEqual = shallowEqual;
|
|
12499
|
+
exports.deepCopy = deepCopy;
|
|
12500
|
+
exports.deepAccum = deepAccum;
|
|
12501
|
+
exports.precisionRound = precisionRound;
|
|
12502
|
+
exports.percentString = percentString;
|
|
12503
|
+
exports.hash = hash;
|
|
12504
|
+
exports.hashObject = hashObject;
|
|
12505
|
+
exports.toHex = toHex;
|
|
12506
|
+
exports.toRGBA = toRGBA;
|
|
12507
|
+
exports.toRGBAIntensity = toRGBAIntensity;
|
|
12508
|
+
exports.distance = distance;
|
|
12509
|
+
exports.deg2rad = deg2rad;
|
|
12510
|
+
exports.rad2deg = rad2deg;
|
|
12511
|
+
exports.wrapLon = wrapLon;
|
|
12512
|
+
exports.isNumber = isNumber;
|
|
12513
|
+
exports.toNumber = toNumber;
|
|
12514
|
+
exports.toSafeNumber = toSafeNumber;
|
|
12515
|
+
function Now() { return (new Date()).toJSON(); }
|
|
12111
12516
|
// polyfill
|
|
12112
12517
|
let hrtime = global && global.process && global.process.hrtime ? global.process.hrtime : null;
|
|
12113
12518
|
class Elapsed {
|
|
@@ -12203,23 +12608,19 @@ function createGuid() {
|
|
|
12203
12608
|
return v.toString(16);
|
|
12204
12609
|
});
|
|
12205
12610
|
}
|
|
12206
|
-
exports.createGuid = createGuid;
|
|
12207
12611
|
const reGuid = /.*-.*-.*-.*-/;
|
|
12208
12612
|
function isGuid(s) {
|
|
12209
12613
|
return reGuid.test(s) && s.length >= 36;
|
|
12210
12614
|
}
|
|
12211
|
-
exports.isGuid = isGuid;
|
|
12212
12615
|
function createKeyedGuid(key) {
|
|
12213
12616
|
return `xxxxxxxx-xxxx-${key}xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g, function (c) {
|
|
12214
12617
|
var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
|
|
12215
12618
|
return v.toString(16);
|
|
12216
12619
|
});
|
|
12217
12620
|
}
|
|
12218
|
-
exports.createKeyedGuid = createKeyedGuid;
|
|
12219
12621
|
function guidKey(guid) {
|
|
12220
12622
|
return guid.substr(14, 1); // See above
|
|
12221
12623
|
}
|
|
12222
|
-
exports.guidKey = guidKey;
|
|
12223
12624
|
function _sizeof(a, loops) {
|
|
12224
12625
|
if (a === null || a === undefined)
|
|
12225
12626
|
return 0;
|
|
@@ -12262,7 +12663,6 @@ function sizeof(a) {
|
|
|
12262
12663
|
let n = _sizeof(a, loops);
|
|
12263
12664
|
return n;
|
|
12264
12665
|
}
|
|
12265
|
-
exports.sizeof = sizeof;
|
|
12266
12666
|
function depthof(a) {
|
|
12267
12667
|
if (a === null || a === undefined)
|
|
12268
12668
|
return 1;
|
|
@@ -12289,7 +12689,6 @@ function depthof(a) {
|
|
|
12289
12689
|
}
|
|
12290
12690
|
}
|
|
12291
12691
|
}
|
|
12292
|
-
exports.depthof = depthof;
|
|
12293
12692
|
function isEmpty(o) {
|
|
12294
12693
|
if (o === null || o === undefined)
|
|
12295
12694
|
return true;
|
|
@@ -12298,7 +12697,6 @@ function isEmpty(o) {
|
|
|
12298
12697
|
return false;
|
|
12299
12698
|
return true;
|
|
12300
12699
|
}
|
|
12301
|
-
exports.isEmpty = isEmpty;
|
|
12302
12700
|
function countKeys(o) {
|
|
12303
12701
|
if (o === undefined || typeof o !== 'object')
|
|
12304
12702
|
return -1;
|
|
@@ -12308,7 +12706,6 @@ function countKeys(o) {
|
|
|
12308
12706
|
count++;
|
|
12309
12707
|
return count;
|
|
12310
12708
|
}
|
|
12311
|
-
exports.countKeys = countKeys;
|
|
12312
12709
|
function nthProperty(o, n = 0) {
|
|
12313
12710
|
for (let p in o)
|
|
12314
12711
|
if (o.hasOwnProperty(p)) {
|
|
@@ -12318,7 +12715,6 @@ function nthProperty(o, n = 0) {
|
|
|
12318
12715
|
}
|
|
12319
12716
|
return undefined;
|
|
12320
12717
|
}
|
|
12321
|
-
exports.nthProperty = nthProperty;
|
|
12322
12718
|
function nthKey(o, n = 0) {
|
|
12323
12719
|
for (let p in o)
|
|
12324
12720
|
if (o.hasOwnProperty(p)) {
|
|
@@ -12328,7 +12724,6 @@ function nthKey(o, n = 0) {
|
|
|
12328
12724
|
}
|
|
12329
12725
|
return undefined;
|
|
12330
12726
|
}
|
|
12331
|
-
exports.nthKey = nthKey;
|
|
12332
12727
|
function partialEqual(o, subset) {
|
|
12333
12728
|
for (let p in subset)
|
|
12334
12729
|
if (subset.hasOwnProperty(p))
|
|
@@ -12336,7 +12731,6 @@ function partialEqual(o, subset) {
|
|
|
12336
12731
|
return false;
|
|
12337
12732
|
return true;
|
|
12338
12733
|
}
|
|
12339
|
-
exports.partialEqual = partialEqual;
|
|
12340
12734
|
function exactEqual(o1, o2, options) {
|
|
12341
12735
|
if (o1 === o2)
|
|
12342
12736
|
return true;
|
|
@@ -12422,7 +12816,6 @@ function deepEqual(o1, o2, options) {
|
|
|
12422
12816
|
}
|
|
12423
12817
|
return true;
|
|
12424
12818
|
}
|
|
12425
|
-
exports.deepEqual = deepEqual;
|
|
12426
12819
|
const Months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
12427
12820
|
function prettyDate(d) {
|
|
12428
12821
|
if (d == null)
|
|
@@ -12438,7 +12831,6 @@ function prettyDate(d) {
|
|
|
12438
12831
|
hh -= 12;
|
|
12439
12832
|
return `${mmm} ${dd}, ${yyyy} at ${hh}:${mm} ${ampm}`;
|
|
12440
12833
|
}
|
|
12441
|
-
exports.prettyDate = prettyDate;
|
|
12442
12834
|
function relativeDate(d) {
|
|
12443
12835
|
if (d == null)
|
|
12444
12836
|
return 'unknown';
|
|
@@ -12462,7 +12854,6 @@ function relativeDate(d) {
|
|
|
12462
12854
|
else
|
|
12463
12855
|
return `${mmm} ${dd}, ${yyyy}`;
|
|
12464
12856
|
}
|
|
12465
|
-
exports.relativeDate = relativeDate;
|
|
12466
12857
|
const OneMinute = 1000 * 60;
|
|
12467
12858
|
const OneHour = OneMinute * 60;
|
|
12468
12859
|
const OneDay = OneHour * 24;
|
|
@@ -12483,7 +12874,6 @@ function recentDate(d) {
|
|
|
12483
12874
|
else
|
|
12484
12875
|
return relativeDate(d);
|
|
12485
12876
|
}
|
|
12486
|
-
exports.recentDate = recentDate;
|
|
12487
12877
|
function textToHtml(sText) {
|
|
12488
12878
|
let lines = sText.split('\n');
|
|
12489
12879
|
let aHtml = [];
|
|
@@ -12517,7 +12907,6 @@ function textToHtml(sText) {
|
|
|
12517
12907
|
aHtml.push('</body>');
|
|
12518
12908
|
return aHtml.join('');
|
|
12519
12909
|
}
|
|
12520
|
-
exports.textToHtml = textToHtml;
|
|
12521
12910
|
function shallowCopy(src) {
|
|
12522
12911
|
if (src === null || src === undefined)
|
|
12523
12912
|
return src;
|
|
@@ -12541,7 +12930,6 @@ function shallowCopy(src) {
|
|
|
12541
12930
|
}
|
|
12542
12931
|
}
|
|
12543
12932
|
}
|
|
12544
|
-
exports.shallowCopy = shallowCopy;
|
|
12545
12933
|
function shallowAssign(o1, o2) {
|
|
12546
12934
|
if (o1 === null || o1 === undefined)
|
|
12547
12935
|
o1 = {};
|
|
@@ -12554,7 +12942,6 @@ function shallowAssign(o1, o2) {
|
|
|
12554
12942
|
o1[p] = o2[p];
|
|
12555
12943
|
return o1;
|
|
12556
12944
|
}
|
|
12557
|
-
exports.shallowAssign = shallowAssign;
|
|
12558
12945
|
function shallowDelete(o1, o2) {
|
|
12559
12946
|
if (o1 == null || o2 == null)
|
|
12560
12947
|
return o1;
|
|
@@ -12565,7 +12952,6 @@ function shallowDelete(o1, o2) {
|
|
|
12565
12952
|
delete o1[p];
|
|
12566
12953
|
return o1;
|
|
12567
12954
|
}
|
|
12568
|
-
exports.shallowDelete = shallowDelete;
|
|
12569
12955
|
function shallowAssignImmutable(o1, o2) {
|
|
12570
12956
|
if (o1 === null || o1 === undefined)
|
|
12571
12957
|
o1 = {};
|
|
@@ -12586,7 +12972,6 @@ function shallowAssignImmutable(o1, o2) {
|
|
|
12586
12972
|
shallowAssign(oNew, o2);
|
|
12587
12973
|
return oNew;
|
|
12588
12974
|
}
|
|
12589
|
-
exports.shallowAssignImmutable = shallowAssignImmutable;
|
|
12590
12975
|
function shallowEqual(o1, o2) {
|
|
12591
12976
|
if (o1 === undefined || o2 === undefined || typeof o1 !== 'object' || typeof o2 !== 'object')
|
|
12592
12977
|
return o1 === o2;
|
|
@@ -12611,13 +12996,22 @@ function shallowEqual(o1, o2) {
|
|
|
12611
12996
|
return true;
|
|
12612
12997
|
}
|
|
12613
12998
|
}
|
|
12614
|
-
exports.shallowEqual = shallowEqual;
|
|
12615
12999
|
function deepCopy(src) {
|
|
12616
13000
|
// Beware typeof oddities
|
|
12617
13001
|
if (src === null || src === undefined)
|
|
12618
13002
|
return src;
|
|
12619
13003
|
if (typeof src === 'object') {
|
|
12620
|
-
if (
|
|
13004
|
+
if (src instanceof Set) {
|
|
13005
|
+
let dst = new Set();
|
|
13006
|
+
src.forEach((i) => { dst.add(deepCopy(i)); });
|
|
13007
|
+
return dst;
|
|
13008
|
+
}
|
|
13009
|
+
else if (src instanceof Map) {
|
|
13010
|
+
let dst = new Map();
|
|
13011
|
+
src.forEach((v, k) => { dst.set(deepCopy(k), deepCopy(v)); });
|
|
13012
|
+
return dst;
|
|
13013
|
+
}
|
|
13014
|
+
else if (Array.isArray(src)) {
|
|
12621
13015
|
let dst = [];
|
|
12622
13016
|
for (let i = 0; i < src.length; i++)
|
|
12623
13017
|
dst.push(deepCopy(src[i]));
|
|
@@ -12636,7 +13030,6 @@ function deepCopy(src) {
|
|
|
12636
13030
|
else
|
|
12637
13031
|
return src;
|
|
12638
13032
|
}
|
|
12639
|
-
exports.deepCopy = deepCopy;
|
|
12640
13033
|
function deepAccum(accum, o) {
|
|
12641
13034
|
if (accum == null)
|
|
12642
13035
|
accum = {};
|
|
@@ -12671,19 +13064,16 @@ function deepAccum(accum, o) {
|
|
|
12671
13064
|
}
|
|
12672
13065
|
return accum;
|
|
12673
13066
|
}
|
|
12674
|
-
exports.deepAccum = deepAccum;
|
|
12675
13067
|
function precisionRound(n, p) {
|
|
12676
13068
|
let f = Math.pow(10, p);
|
|
12677
13069
|
return Math.round(n * f) / f;
|
|
12678
13070
|
}
|
|
12679
|
-
exports.precisionRound = precisionRound;
|
|
12680
13071
|
function percentString(num, den, precision = 0) {
|
|
12681
13072
|
if (den == 0)
|
|
12682
13073
|
return '(-)';
|
|
12683
13074
|
let p = precisionRound((num / den) * 100, precision);
|
|
12684
13075
|
return String(p) + '%';
|
|
12685
13076
|
}
|
|
12686
|
-
exports.percentString = percentString;
|
|
12687
13077
|
function hash(s) {
|
|
12688
13078
|
let hash = 5381;
|
|
12689
13079
|
let i = s.length;
|
|
@@ -12694,11 +13084,9 @@ function hash(s) {
|
|
|
12694
13084
|
* signed int to an unsigned by doing an unsigned bitshift. */
|
|
12695
13085
|
return hash >>> 0;
|
|
12696
13086
|
}
|
|
12697
|
-
exports.hash = hash;
|
|
12698
13087
|
function hashObject(o) {
|
|
12699
13088
|
return hash(o ? JSON.stringify(o) : '');
|
|
12700
13089
|
}
|
|
12701
|
-
exports.hashObject = hashObject;
|
|
12702
13090
|
const HexTable = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
|
|
12703
13091
|
function toHex(n) {
|
|
12704
13092
|
if (n < 0 || n > 255)
|
|
@@ -12706,7 +13094,6 @@ function toHex(n) {
|
|
|
12706
13094
|
n = Math.floor(n);
|
|
12707
13095
|
return HexTable[n >> 4] + HexTable[n & 15];
|
|
12708
13096
|
}
|
|
12709
|
-
exports.toHex = toHex;
|
|
12710
13097
|
function toRGBA(color, alpha) {
|
|
12711
13098
|
// Allow passing rgba in rather than only '#ffffff' form
|
|
12712
13099
|
if (color.indexOf('rgba') === 0)
|
|
@@ -12733,31 +13120,24 @@ function toRGBA(color, alpha) {
|
|
|
12733
13120
|
}
|
|
12734
13121
|
return `rgba(${String(r)}, ${String(g)}, ${String(b)}, ${String(alpha)})`;
|
|
12735
13122
|
}
|
|
12736
|
-
exports.toRGBA = toRGBA;
|
|
12737
13123
|
function toRGBAIntensity(color, intensity, alpha) {
|
|
12738
13124
|
// for now assume color is black
|
|
12739
13125
|
let g = precisionRound(255 * intensity, 0);
|
|
12740
13126
|
return `rgba(${String(g)}, ${String(g)}, ${String(g)}, ${String(alpha)})`;
|
|
12741
13127
|
}
|
|
12742
|
-
exports.toRGBAIntensity = toRGBAIntensity;
|
|
12743
13128
|
// Geo functions
|
|
12744
13129
|
function distance(x0, y0, x1, y1) {
|
|
12745
13130
|
return Math.hypot(x0 - x1, y0 - y1);
|
|
12746
13131
|
}
|
|
12747
|
-
exports.distance = distance;
|
|
12748
13132
|
function deg2rad(num) { return num * Math.PI / 180; }
|
|
12749
|
-
exports.deg2rad = deg2rad;
|
|
12750
13133
|
function rad2deg(num) { return num / Math.PI * 180; }
|
|
12751
|
-
exports.rad2deg = rad2deg;
|
|
12752
13134
|
// Restricts lon to range [-180..180]
|
|
12753
13135
|
function wrapLon(lon) {
|
|
12754
13136
|
let worlds = Math.floor((lon + 180) / 360);
|
|
12755
13137
|
return lon - (worlds * 360);
|
|
12756
13138
|
}
|
|
12757
|
-
exports.wrapLon = wrapLon;
|
|
12758
13139
|
let reNumber = /^\s*-?\d+(\.\d+)?([eE][+-]?\d+)?\s*$/;
|
|
12759
13140
|
function isNumber(s) { return !!s && reNumber.test(s); }
|
|
12760
|
-
exports.isNumber = isNumber;
|
|
12761
13141
|
function toNumber(a) {
|
|
12762
13142
|
if (typeof a === 'number')
|
|
12763
13143
|
return a;
|
|
@@ -12765,12 +13145,10 @@ function toNumber(a) {
|
|
|
12765
13145
|
return NaN;
|
|
12766
13146
|
return Number(a);
|
|
12767
13147
|
}
|
|
12768
|
-
exports.toNumber = toNumber;
|
|
12769
13148
|
function toSafeNumber(a) {
|
|
12770
13149
|
let n = toNumber(a);
|
|
12771
13150
|
return (isNaN(n) || typeof n !== 'number') ? 0 : n;
|
|
12772
13151
|
}
|
|
12773
|
-
exports.toSafeNumber = toSafeNumber;
|
|
12774
13152
|
|
|
12775
13153
|
|
|
12776
13154
|
/***/ }),
|