@dra2020/baseclient 1.0.154 → 1.0.155
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/LICENSE +1 -1
- package/dist/baseclient.js +551 -833
- package/dist/baseclient.js.map +1 -1
- package/dist/geo/all.d.ts +1 -0
- package/dist/geo/ensurecentroid.d.ts +3 -0
- package/lib/geo/all.ts +1 -0
- package/lib/geo/ensurecentroid.ts +49 -0
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -35,23 +35,13 @@ 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) ||
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
})();
|
|
38
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
55
45
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
56
46
|
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;
|
|
57
47
|
// Client and Server
|
|
@@ -112,28 +102,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
112
102
|
}) : function(o, v) {
|
|
113
103
|
o["default"] = v;
|
|
114
104
|
});
|
|
115
|
-
var __importStar = (this && this.__importStar) ||
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
})();
|
|
105
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
106
|
+
if (mod && mod.__esModule) return mod;
|
|
107
|
+
var result = {};
|
|
108
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
109
|
+
__setModuleDefault(result, mod);
|
|
110
|
+
return result;
|
|
111
|
+
};
|
|
132
112
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
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;
|
|
113
|
+
exports.getPalette = exports.orderedColors = exports.genColor = 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;
|
|
137
114
|
const JsColorMapsData = __importStar(__webpack_require__(/*! ./jscolormapsdata */ "./lib/colors/jscolormapsdata.ts"));
|
|
138
115
|
const all_1 = __webpack_require__(/*! ../all/all */ "./lib/all/all.ts");
|
|
139
116
|
exports.MaxOrderedColors = 50;
|
|
@@ -415,6 +392,7 @@ function genColor(i, useFirstColor, palette) {
|
|
|
415
392
|
// Unexpected to get here, but something in case of an error
|
|
416
393
|
return genDRAColor(i, useFirstColor);
|
|
417
394
|
}
|
|
395
|
+
exports.genColor = genColor;
|
|
418
396
|
// DRA classic color palette
|
|
419
397
|
function genDRAColor(i, useFirstColor) {
|
|
420
398
|
// i is district number, 0 => District[0] (unassigned), so subtract 1 to access ColorTable
|
|
@@ -447,6 +425,7 @@ function orderedColors(palette) {
|
|
|
447
425
|
}
|
|
448
426
|
return OrderedColorTable[palette];
|
|
449
427
|
}
|
|
428
|
+
exports.orderedColors = orderedColors;
|
|
450
429
|
function getPalette(palette) {
|
|
451
430
|
if (palette === 'draclassic') {
|
|
452
431
|
// return draclassic palette with only 50 colors
|
|
@@ -457,6 +436,7 @@ function getPalette(palette) {
|
|
|
457
436
|
}
|
|
458
437
|
return getColorTable(palette);
|
|
459
438
|
}
|
|
439
|
+
exports.getPalette = getPalette;
|
|
460
440
|
// Generate table for palette
|
|
461
441
|
function getColorTable(palette) {
|
|
462
442
|
if (palette === 'demographicsclassic') {
|
|
@@ -815,25 +795,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
815
795
|
}) : function(o, v) {
|
|
816
796
|
o["default"] = v;
|
|
817
797
|
});
|
|
818
|
-
var __importStar = (this && this.__importStar) ||
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
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
|
-
})();
|
|
798
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
799
|
+
if (mod && mod.__esModule) return mod;
|
|
800
|
+
var result = {};
|
|
801
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
802
|
+
__setModuleDefault(result, mod);
|
|
803
|
+
return result;
|
|
804
|
+
};
|
|
835
805
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
836
|
-
exports.create =
|
|
806
|
+
exports.create = void 0;
|
|
837
807
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
838
808
|
class Context {
|
|
839
809
|
constructor() {
|
|
@@ -882,6 +852,7 @@ class Context {
|
|
|
882
852
|
function create() {
|
|
883
853
|
return new Context();
|
|
884
854
|
}
|
|
855
|
+
exports.create = create;
|
|
885
856
|
|
|
886
857
|
|
|
887
858
|
/***/ }),
|
|
@@ -937,23 +908,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
937
908
|
}) : function(o, v) {
|
|
938
909
|
o["default"] = v;
|
|
939
910
|
});
|
|
940
|
-
var __importStar = (this && this.__importStar) ||
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
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
|
-
})();
|
|
911
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
912
|
+
if (mod && mod.__esModule) return mod;
|
|
913
|
+
var result = {};
|
|
914
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
915
|
+
__setModuleDefault(result, mod);
|
|
916
|
+
return result;
|
|
917
|
+
};
|
|
957
918
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
958
919
|
exports.ParseOne = exports.ParseMany = void 0;
|
|
959
920
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -1099,7 +1060,7 @@ exports.ParseOne = ParseOne;
|
|
|
1099
1060
|
|
|
1100
1061
|
|
|
1101
1062
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1102
|
-
exports.csvParseLine =
|
|
1063
|
+
exports.csvParseLine = void 0;
|
|
1103
1064
|
const reField = /^\s*("([^"]*(?:""[^"]*)*)"|[^,|]*)\s*[|,]?/;
|
|
1104
1065
|
const reQuote = /^"/;
|
|
1105
1066
|
const reAddOne = /[|,]$/;
|
|
@@ -1128,6 +1089,7 @@ function csvParseLine(s) {
|
|
|
1128
1089
|
fields.push('');
|
|
1129
1090
|
return fields;
|
|
1130
1091
|
}
|
|
1092
|
+
exports.csvParseLine = csvParseLine;
|
|
1131
1093
|
|
|
1132
1094
|
|
|
1133
1095
|
/***/ }),
|
|
@@ -1316,23 +1278,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
1316
1278
|
}) : function(o, v) {
|
|
1317
1279
|
o["default"] = v;
|
|
1318
1280
|
});
|
|
1319
|
-
var __importStar = (this && this.__importStar) ||
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
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
|
-
})();
|
|
1281
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1282
|
+
if (mod && mod.__esModule) return mod;
|
|
1283
|
+
var result = {};
|
|
1284
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1285
|
+
__setModuleDefault(result, mod);
|
|
1286
|
+
return result;
|
|
1287
|
+
};
|
|
1336
1288
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1337
1289
|
exports.FormatDetail = void 0;
|
|
1338
1290
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -1597,23 +1549,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
1597
1549
|
}) : function(o, v) {
|
|
1598
1550
|
o["default"] = v;
|
|
1599
1551
|
});
|
|
1600
|
-
var __importStar = (this && this.__importStar) ||
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
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
|
-
})();
|
|
1552
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
1553
|
+
if (mod && mod.__esModule) return mod;
|
|
1554
|
+
var result = {};
|
|
1555
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1556
|
+
__setModuleDefault(result, mod);
|
|
1557
|
+
return result;
|
|
1558
|
+
};
|
|
1617
1559
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1618
1560
|
exports.FilterExpr = void 0;
|
|
1619
1561
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -2260,23 +2202,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
2260
2202
|
}) : function(o, v) {
|
|
2261
2203
|
o["default"] = v;
|
|
2262
2204
|
});
|
|
2263
|
-
var __importStar = (this && this.__importStar) ||
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
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
|
-
})();
|
|
2205
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
2206
|
+
if (mod && mod.__esModule) return mod;
|
|
2207
|
+
var result = {};
|
|
2208
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
2209
|
+
__setModuleDefault(result, mod);
|
|
2210
|
+
return result;
|
|
2211
|
+
};
|
|
2280
2212
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2281
2213
|
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;
|
|
2282
2214
|
// Shared libraries
|
|
@@ -2670,6 +2602,81 @@ __exportStar(__webpack_require__(/*! ./geo */ "./lib/geo/geo.ts"), exports);
|
|
|
2670
2602
|
__exportStar(__webpack_require__(/*! ./vfeature */ "./lib/geo/vfeature.ts"), exports);
|
|
2671
2603
|
__exportStar(__webpack_require__(/*! ./flexname */ "./lib/geo/flexname.ts"), exports);
|
|
2672
2604
|
__exportStar(__webpack_require__(/*! ./multiblockmapping */ "./lib/geo/multiblockmapping.ts"), exports);
|
|
2605
|
+
__exportStar(__webpack_require__(/*! ./ensurecentroid */ "./lib/geo/ensurecentroid.ts"), exports);
|
|
2606
|
+
|
|
2607
|
+
|
|
2608
|
+
/***/ }),
|
|
2609
|
+
|
|
2610
|
+
/***/ "./lib/geo/ensurecentroid.ts":
|
|
2611
|
+
/*!***********************************!*\
|
|
2612
|
+
!*** ./lib/geo/ensurecentroid.ts ***!
|
|
2613
|
+
\***********************************/
|
|
2614
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
2615
|
+
|
|
2616
|
+
|
|
2617
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2618
|
+
if (k2 === undefined) k2 = k;
|
|
2619
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2620
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2621
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2622
|
+
}
|
|
2623
|
+
Object.defineProperty(o, k2, desc);
|
|
2624
|
+
}) : (function(o, m, k, k2) {
|
|
2625
|
+
if (k2 === undefined) k2 = k;
|
|
2626
|
+
o[k2] = m[k];
|
|
2627
|
+
}));
|
|
2628
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
2629
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2630
|
+
}) : function(o, v) {
|
|
2631
|
+
o["default"] = v;
|
|
2632
|
+
});
|
|
2633
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
2634
|
+
if (mod && mod.__esModule) return mod;
|
|
2635
|
+
var result = {};
|
|
2636
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
2637
|
+
__setModuleDefault(result, mod);
|
|
2638
|
+
return result;
|
|
2639
|
+
};
|
|
2640
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2641
|
+
exports.ensureCentroidInCollection = exports.ensureCentroidInFeature = void 0;
|
|
2642
|
+
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
2643
|
+
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
2644
|
+
function oneNumberOf(f, props) {
|
|
2645
|
+
for (let i = 0; i < props.length; i++)
|
|
2646
|
+
if (f.properties[props[i]])
|
|
2647
|
+
return Number(f.properties[props[i]]);
|
|
2648
|
+
return 0;
|
|
2649
|
+
}
|
|
2650
|
+
function ensureCentroidInFeature(f) {
|
|
2651
|
+
if (f.geometry && f.properties.labelx === undefined) {
|
|
2652
|
+
f.properties.labelx = oneNumberOf(f, ['INTPTLON30', 'INTPTLON20', 'INTPTLON10', 'INTPTLON']);
|
|
2653
|
+
f.properties.labely = oneNumberOf(f, ['INTPTLAT30', 'INTPTLAT20', 'INTPTLAT10', 'INTPTLAT']);
|
|
2654
|
+
if (f.properties.labelx && f.properties.labely)
|
|
2655
|
+
if (!Poly.polyContainsPoint(f, f.properties.labelx, f.properties.labely)) {
|
|
2656
|
+
delete f.properties.labelx;
|
|
2657
|
+
delete f.properties.labely;
|
|
2658
|
+
}
|
|
2659
|
+
// If internal point not specified, compute it
|
|
2660
|
+
if (!f.properties.labelx || !f.properties.labely) {
|
|
2661
|
+
let result = Poly.polyLabel(f);
|
|
2662
|
+
f.properties.labelx = Util.precisionRound(result.x, 6);
|
|
2663
|
+
f.properties.labely = Util.precisionRound(result.y, 6);
|
|
2664
|
+
}
|
|
2665
|
+
delete f.properties.INTPTLAT30;
|
|
2666
|
+
delete f.properties.INTPTLON30;
|
|
2667
|
+
delete f.properties.INTPTLAT20;
|
|
2668
|
+
delete f.properties.INTPTLON20;
|
|
2669
|
+
delete f.properties.INTPTLAT10;
|
|
2670
|
+
delete f.properties.INTPTLON10;
|
|
2671
|
+
delete f.properties.INTPTLAT;
|
|
2672
|
+
delete f.properties.INTPTLON;
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
exports.ensureCentroidInFeature = ensureCentroidInFeature;
|
|
2676
|
+
function ensureCentroidInCollection(col) {
|
|
2677
|
+
col.features.forEach(ensureCentroidInFeature);
|
|
2678
|
+
}
|
|
2679
|
+
exports.ensureCentroidInCollection = ensureCentroidInCollection;
|
|
2673
2680
|
|
|
2674
2681
|
|
|
2675
2682
|
/***/ }),
|
|
@@ -2682,7 +2689,7 @@ __exportStar(__webpack_require__(/*! ./multiblockmapping */ "./lib/geo/multibloc
|
|
|
2682
2689
|
|
|
2683
2690
|
|
|
2684
2691
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2685
|
-
exports.flexName =
|
|
2692
|
+
exports.flexName = void 0;
|
|
2686
2693
|
function flexName(f) {
|
|
2687
2694
|
if (!f || !f.properties)
|
|
2688
2695
|
return null;
|
|
@@ -2706,6 +2713,7 @@ function flexName(f) {
|
|
|
2706
2713
|
}
|
|
2707
2714
|
return `${f.properties.id}`;
|
|
2708
2715
|
}
|
|
2716
|
+
exports.flexName = flexName;
|
|
2709
2717
|
|
|
2710
2718
|
|
|
2711
2719
|
/***/ }),
|
|
@@ -2733,42 +2741,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
2733
2741
|
}) : function(o, v) {
|
|
2734
2742
|
o["default"] = v;
|
|
2735
2743
|
});
|
|
2736
|
-
var __importStar = (this && this.__importStar) ||
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
return ownKeys(o);
|
|
2744
|
-
};
|
|
2745
|
-
return function (mod) {
|
|
2746
|
-
if (mod && mod.__esModule) return mod;
|
|
2747
|
-
var result = {};
|
|
2748
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
2749
|
-
__setModuleDefault(result, mod);
|
|
2750
|
-
return result;
|
|
2751
|
-
};
|
|
2752
|
-
})();
|
|
2744
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
2745
|
+
if (mod && mod.__esModule) return mod;
|
|
2746
|
+
var result = {};
|
|
2747
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
2748
|
+
__setModuleDefault(result, mod);
|
|
2749
|
+
return result;
|
|
2750
|
+
};
|
|
2753
2751
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2754
|
-
exports.geoIntersectOptions = exports.GeoMultiCollection = void 0;
|
|
2755
|
-
exports.dumpMetrics = dumpMetrics;
|
|
2756
|
-
exports.hidemapConcat = hidemapConcat;
|
|
2757
|
-
exports.applyCanonicalID = applyCanonicalID;
|
|
2758
|
-
exports.isValidId = isValidId;
|
|
2759
|
-
exports.geoEnsureID = geoEnsureID;
|
|
2760
|
-
exports.geoNormalizeFeature = geoNormalizeFeature;
|
|
2761
|
-
exports.geoNormalizeCollection = geoNormalizeCollection;
|
|
2762
|
-
exports.geoCollectionToMap = geoCollectionToMap;
|
|
2763
|
-
exports.geoMapToCollection = geoMapToCollection;
|
|
2764
|
-
exports.geoMapToCollectionNonNull = geoMapToCollectionNonNull;
|
|
2765
|
-
exports.geoCollectionToTopo = geoCollectionToTopo;
|
|
2766
|
-
exports.geoCollectionToTopoNonNull = geoCollectionToTopoNonNull;
|
|
2767
|
-
exports.geoTopoToCollection = geoTopoToCollection;
|
|
2768
|
-
exports.geoTopoToCollectionNonNull = geoTopoToCollectionNonNull;
|
|
2769
|
-
exports.geoEqual = geoEqual;
|
|
2770
|
-
exports.geoMapEqual = geoMapEqual;
|
|
2771
|
-
exports.geoIntersect = geoIntersect;
|
|
2752
|
+
exports.geoIntersect = exports.geoIntersectOptions = exports.GeoMultiCollection = exports.geoMapEqual = exports.geoEqual = exports.geoTopoToCollectionNonNull = exports.geoTopoToCollection = exports.geoCollectionToTopoNonNull = exports.geoCollectionToTopo = exports.geoMapToCollectionNonNull = exports.geoMapToCollection = exports.geoCollectionToMap = exports.geoNormalizeCollection = exports.geoNormalizeFeature = exports.geoEnsureID = exports.isValidId = exports.applyCanonicalID = exports.hidemapConcat = exports.dumpMetrics = void 0;
|
|
2772
2753
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
2773
2754
|
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
2774
2755
|
// Tracing/debugging aid
|
|
@@ -2784,6 +2765,7 @@ function dumpMetrics() {
|
|
|
2784
2765
|
console.log(`G.${action}: count: ${metrics[action].count}, total: ${metrics[action].total}`);
|
|
2785
2766
|
});
|
|
2786
2767
|
}
|
|
2768
|
+
exports.dumpMetrics = dumpMetrics;
|
|
2787
2769
|
function hidemapConcat(...args) {
|
|
2788
2770
|
let hm = {};
|
|
2789
2771
|
for (let i = 0; i < args.length; i++)
|
|
@@ -2791,11 +2773,13 @@ function hidemapConcat(...args) {
|
|
|
2791
2773
|
Object.keys(args[i]).forEach(id => hm[id] = true);
|
|
2792
2774
|
return hm;
|
|
2793
2775
|
}
|
|
2776
|
+
exports.hidemapConcat = hidemapConcat;
|
|
2794
2777
|
const NormalizeAll = { joinPolygons: true, checkRewind: true, ensureID: true };
|
|
2795
2778
|
function applyCanonicalID(col) {
|
|
2796
2779
|
if (col && Array.isArray(col.features))
|
|
2797
2780
|
col.features.forEach((f, n) => { f.properties.id = String(n + 1); });
|
|
2798
2781
|
}
|
|
2782
|
+
exports.applyCanonicalID = applyCanonicalID;
|
|
2799
2783
|
function isValidId(col) {
|
|
2800
2784
|
if (!col || !Array.isArray(col.features))
|
|
2801
2785
|
return true;
|
|
@@ -2812,6 +2796,7 @@ function isValidId(col) {
|
|
|
2812
2796
|
}
|
|
2813
2797
|
return true;
|
|
2814
2798
|
}
|
|
2799
|
+
exports.isValidId = isValidId;
|
|
2815
2800
|
// set the canonical 'id' property from the best property value.
|
|
2816
2801
|
// if joinPolygons is true, we do not enforce uniqueness.
|
|
2817
2802
|
//
|
|
@@ -2840,12 +2825,14 @@ function geoEnsureID(col, options) {
|
|
|
2840
2825
|
applyCanonicalID(col);
|
|
2841
2826
|
}
|
|
2842
2827
|
}
|
|
2828
|
+
exports.geoEnsureID = geoEnsureID;
|
|
2843
2829
|
function geoNormalizeFeature(f, options) {
|
|
2844
2830
|
options = Util.shallowAssignImmutable({}, options);
|
|
2845
2831
|
if (options.checkRewind)
|
|
2846
2832
|
Poly.featureRewind(f);
|
|
2847
2833
|
return f;
|
|
2848
2834
|
}
|
|
2835
|
+
exports.geoNormalizeFeature = geoNormalizeFeature;
|
|
2849
2836
|
function onlyPolygons(col) {
|
|
2850
2837
|
if (col && Array.isArray(col.features))
|
|
2851
2838
|
for (let i = 0; i < col.features.length; i++) {
|
|
@@ -2897,6 +2884,7 @@ function geoNormalizeCollection(col, options) {
|
|
|
2897
2884
|
}
|
|
2898
2885
|
return col;
|
|
2899
2886
|
}
|
|
2887
|
+
exports.geoNormalizeCollection = geoNormalizeCollection;
|
|
2900
2888
|
function geoCollectionToMap(col) {
|
|
2901
2889
|
if (col == null)
|
|
2902
2890
|
return null;
|
|
@@ -2904,11 +2892,13 @@ function geoCollectionToMap(col) {
|
|
|
2904
2892
|
col.features.forEach((f) => { map[String(f.properties.id)] = f; });
|
|
2905
2893
|
return map;
|
|
2906
2894
|
}
|
|
2895
|
+
exports.geoCollectionToMap = geoCollectionToMap;
|
|
2907
2896
|
function geoMapToCollection(map) {
|
|
2908
2897
|
if (Util.countKeys(map) == 0)
|
|
2909
2898
|
return null;
|
|
2910
2899
|
return geoMapToCollectionNonNull(map);
|
|
2911
2900
|
}
|
|
2901
|
+
exports.geoMapToCollection = geoMapToCollection;
|
|
2912
2902
|
function geoMapToCollectionNonNull(map) {
|
|
2913
2903
|
if (map == null)
|
|
2914
2904
|
return null;
|
|
@@ -2916,6 +2906,7 @@ function geoMapToCollectionNonNull(map) {
|
|
|
2916
2906
|
Object.keys(map).forEach((geoid) => { col.features.push(map[geoid]); });
|
|
2917
2907
|
return col;
|
|
2918
2908
|
}
|
|
2909
|
+
exports.geoMapToCollectionNonNull = geoMapToCollectionNonNull;
|
|
2919
2910
|
function geoCollectionToTopo(col) {
|
|
2920
2911
|
let topo = Poly.topoFromCollection(col);
|
|
2921
2912
|
Poly.topoPack(topo);
|
|
@@ -2924,9 +2915,11 @@ function geoCollectionToTopo(col) {
|
|
|
2924
2915
|
topo.datasets = col.datasets;
|
|
2925
2916
|
return topo;
|
|
2926
2917
|
}
|
|
2918
|
+
exports.geoCollectionToTopo = geoCollectionToTopo;
|
|
2927
2919
|
function geoCollectionToTopoNonNull(col) {
|
|
2928
2920
|
return geoCollectionToTopo(col);
|
|
2929
2921
|
}
|
|
2922
|
+
exports.geoCollectionToTopoNonNull = geoCollectionToTopoNonNull;
|
|
2930
2923
|
function geoTopoToCollection(topo) {
|
|
2931
2924
|
let col = Poly.topoToCollection(topo);
|
|
2932
2925
|
Poly.featurePack(col);
|
|
@@ -2935,9 +2928,11 @@ function geoTopoToCollection(topo) {
|
|
|
2935
2928
|
col.datasets = topo.datasets;
|
|
2936
2929
|
return col;
|
|
2937
2930
|
}
|
|
2931
|
+
exports.geoTopoToCollection = geoTopoToCollection;
|
|
2938
2932
|
function geoTopoToCollectionNonNull(topo) {
|
|
2939
2933
|
return geoTopoToCollection(topo);
|
|
2940
2934
|
}
|
|
2935
|
+
exports.geoTopoToCollectionNonNull = geoTopoToCollectionNonNull;
|
|
2941
2936
|
function geoEqual(m1, m2) {
|
|
2942
2937
|
let n1 = m1 ? m1.length : 0;
|
|
2943
2938
|
let n2 = m2 ? m2.length : 0;
|
|
@@ -2951,6 +2946,7 @@ function geoEqual(m1, m2) {
|
|
|
2951
2946
|
eq = false; });
|
|
2952
2947
|
return eq;
|
|
2953
2948
|
}
|
|
2949
|
+
exports.geoEqual = geoEqual;
|
|
2954
2950
|
function geoMapEqual(m1, m2) {
|
|
2955
2951
|
if (m1 == null)
|
|
2956
2952
|
return Util.isEmpty(m2);
|
|
@@ -2967,6 +2963,7 @@ function geoMapEqual(m1, m2) {
|
|
|
2967
2963
|
return false;
|
|
2968
2964
|
return true;
|
|
2969
2965
|
}
|
|
2966
|
+
exports.geoMapEqual = geoMapEqual;
|
|
2970
2967
|
class GeoMultiCollection {
|
|
2971
2968
|
constructor(tag, topo, col, map) {
|
|
2972
2969
|
this.stamp = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER / 2);
|
|
@@ -3375,6 +3372,7 @@ function geoIntersect(multi, bbox, opt) {
|
|
|
3375
3372
|
result.add('result', null, null, m);
|
|
3376
3373
|
return result;
|
|
3377
3374
|
}
|
|
3375
|
+
exports.geoIntersect = geoIntersect;
|
|
3378
3376
|
|
|
3379
3377
|
|
|
3380
3378
|
/***/ }),
|
|
@@ -3387,8 +3385,7 @@ function geoIntersect(multi, bbox, opt) {
|
|
|
3387
3385
|
|
|
3388
3386
|
|
|
3389
3387
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3390
|
-
exports.MultiBlockMapping = void 0;
|
|
3391
|
-
exports.reverseBlockMapping = reverseBlockMapping;
|
|
3388
|
+
exports.MultiBlockMapping = exports.reverseBlockMapping = void 0;
|
|
3392
3389
|
function reverseBlockMapping(bm) {
|
|
3393
3390
|
let rev = {};
|
|
3394
3391
|
if (bm)
|
|
@@ -3401,6 +3398,7 @@ function reverseBlockMapping(bm) {
|
|
|
3401
3398
|
Object.values(rev).forEach((a) => a.sort());
|
|
3402
3399
|
return rev;
|
|
3403
3400
|
}
|
|
3401
|
+
exports.reverseBlockMapping = reverseBlockMapping;
|
|
3404
3402
|
class MultiBlockMapping {
|
|
3405
3403
|
constructor(tag, bm) {
|
|
3406
3404
|
this.entries = [];
|
|
@@ -3506,25 +3504,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
3506
3504
|
}) : function(o, v) {
|
|
3507
3505
|
o["default"] = v;
|
|
3508
3506
|
});
|
|
3509
|
-
var __importStar = (this && this.__importStar) ||
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
return ownKeys(o);
|
|
3517
|
-
};
|
|
3518
|
-
return function (mod) {
|
|
3519
|
-
if (mod && mod.__esModule) return mod;
|
|
3520
|
-
var result = {};
|
|
3521
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
3522
|
-
__setModuleDefault(result, mod);
|
|
3523
|
-
return result;
|
|
3524
|
-
};
|
|
3525
|
-
})();
|
|
3507
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3508
|
+
if (mod && mod.__esModule) return mod;
|
|
3509
|
+
var result = {};
|
|
3510
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3511
|
+
__setModuleDefault(result, mod);
|
|
3512
|
+
return result;
|
|
3513
|
+
};
|
|
3526
3514
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3527
|
-
exports.computeVFeature =
|
|
3515
|
+
exports.computeVFeature = void 0;
|
|
3528
3516
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
3529
3517
|
const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
|
|
3530
3518
|
// Given the topology for a precinct, the bintrie mapping and the list of blocks, construct the
|
|
@@ -3553,6 +3541,7 @@ function computeVFeature(topoPrecinct, bintrie, blocks) {
|
|
|
3553
3541
|
f.properties.blocks = blocks;
|
|
3554
3542
|
return f;
|
|
3555
3543
|
}
|
|
3544
|
+
exports.computeVFeature = computeVFeature;
|
|
3556
3545
|
|
|
3557
3546
|
|
|
3558
3547
|
/***/ }),
|
|
@@ -3607,23 +3596,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
3607
3596
|
}) : function(o, v) {
|
|
3608
3597
|
o["default"] = v;
|
|
3609
3598
|
});
|
|
3610
|
-
var __importStar = (this && this.__importStar) ||
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
return ownKeys(o);
|
|
3618
|
-
};
|
|
3619
|
-
return function (mod) {
|
|
3620
|
-
if (mod && mod.__esModule) return mod;
|
|
3621
|
-
var result = {};
|
|
3622
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
3623
|
-
__setModuleDefault(result, mod);
|
|
3624
|
-
return result;
|
|
3625
|
-
};
|
|
3626
|
-
})();
|
|
3599
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3600
|
+
if (mod && mod.__esModule) return mod;
|
|
3601
|
+
var result = {};
|
|
3602
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3603
|
+
__setModuleDefault(result, mod);
|
|
3604
|
+
return result;
|
|
3605
|
+
};
|
|
3627
3606
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3628
3607
|
exports.SyncTimer = exports.AsyncTimer = exports.Timer = void 0;
|
|
3629
3608
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -3710,25 +3689,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
3710
3689
|
}) : function(o, v) {
|
|
3711
3690
|
o["default"] = v;
|
|
3712
3691
|
});
|
|
3713
|
-
var __importStar = (this && this.__importStar) ||
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
return ownKeys(o);
|
|
3721
|
-
};
|
|
3722
|
-
return function (mod) {
|
|
3723
|
-
if (mod && mod.__esModule) return mod;
|
|
3724
|
-
var result = {};
|
|
3725
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
3726
|
-
__setModuleDefault(result, mod);
|
|
3727
|
-
return result;
|
|
3728
|
-
};
|
|
3729
|
-
})();
|
|
3692
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3693
|
+
if (mod && mod.__esModule) return mod;
|
|
3694
|
+
var result = {};
|
|
3695
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3696
|
+
__setModuleDefault(result, mod);
|
|
3697
|
+
return result;
|
|
3698
|
+
};
|
|
3730
3699
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3731
|
-
exports.create =
|
|
3700
|
+
exports.create = void 0;
|
|
3732
3701
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
3733
3702
|
class LogManager {
|
|
3734
3703
|
constructor(env) {
|
|
@@ -3797,6 +3766,7 @@ class LogManager {
|
|
|
3797
3766
|
function create(env) {
|
|
3798
3767
|
return new LogManager(env);
|
|
3799
3768
|
}
|
|
3769
|
+
exports.create = create;
|
|
3800
3770
|
|
|
3801
3771
|
|
|
3802
3772
|
/***/ }),
|
|
@@ -3852,23 +3822,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
3852
3822
|
}) : function(o, v) {
|
|
3853
3823
|
o["default"] = v;
|
|
3854
3824
|
});
|
|
3855
|
-
var __importStar = (this && this.__importStar) ||
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
return ownKeys(o);
|
|
3863
|
-
};
|
|
3864
|
-
return function (mod) {
|
|
3865
|
-
if (mod && mod.__esModule) return mod;
|
|
3866
|
-
var result = {};
|
|
3867
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
3868
|
-
__setModuleDefault(result, mod);
|
|
3869
|
-
return result;
|
|
3870
|
-
};
|
|
3871
|
-
})();
|
|
3825
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3826
|
+
if (mod && mod.__esModule) return mod;
|
|
3827
|
+
var result = {};
|
|
3828
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
3829
|
+
__setModuleDefault(result, mod);
|
|
3830
|
+
return result;
|
|
3831
|
+
};
|
|
3872
3832
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3873
3833
|
exports.OTEditUtil = void 0;
|
|
3874
3834
|
const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
|
|
@@ -4051,23 +4011,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
4051
4011
|
}) : function(o, v) {
|
|
4052
4012
|
o["default"] = v;
|
|
4053
4013
|
});
|
|
4054
|
-
var __importStar = (this && this.__importStar) ||
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
return ownKeys(o);
|
|
4062
|
-
};
|
|
4063
|
-
return function (mod) {
|
|
4064
|
-
if (mod && mod.__esModule) return mod;
|
|
4065
|
-
var result = {};
|
|
4066
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
4067
|
-
__setModuleDefault(result, mod);
|
|
4068
|
-
return result;
|
|
4069
|
-
};
|
|
4070
|
-
})();
|
|
4014
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4015
|
+
if (mod && mod.__esModule) return mod;
|
|
4016
|
+
var result = {};
|
|
4017
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4018
|
+
__setModuleDefault(result, mod);
|
|
4019
|
+
return result;
|
|
4020
|
+
};
|
|
4071
4021
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4072
4022
|
exports.Editor = exports.REPLACE = exports.MERGE = void 0;
|
|
4073
4023
|
const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
|
|
@@ -4287,23 +4237,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
4287
4237
|
}) : function(o, v) {
|
|
4288
4238
|
o["default"] = v;
|
|
4289
4239
|
});
|
|
4290
|
-
var __importStar = (this && this.__importStar) ||
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
return ownKeys(o);
|
|
4298
|
-
};
|
|
4299
|
-
return function (mod) {
|
|
4300
|
-
if (mod && mod.__esModule) return mod;
|
|
4301
|
-
var result = {};
|
|
4302
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
4303
|
-
__setModuleDefault(result, mod);
|
|
4304
|
-
return result;
|
|
4305
|
-
};
|
|
4306
|
-
})();
|
|
4240
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
4241
|
+
if (mod && mod.__esModule) return mod;
|
|
4242
|
+
var result = {};
|
|
4243
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4244
|
+
__setModuleDefault(result, mod);
|
|
4245
|
+
return result;
|
|
4246
|
+
};
|
|
4307
4247
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4308
4248
|
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;
|
|
4309
4249
|
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
@@ -5269,23 +5209,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
5269
5209
|
}) : function(o, v) {
|
|
5270
5210
|
o["default"] = v;
|
|
5271
5211
|
});
|
|
5272
|
-
var __importStar = (this && this.__importStar) ||
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
return ownKeys(o);
|
|
5280
|
-
};
|
|
5281
|
-
return function (mod) {
|
|
5282
|
-
if (mod && mod.__esModule) return mod;
|
|
5283
|
-
var result = {};
|
|
5284
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
5285
|
-
__setModuleDefault(result, mod);
|
|
5286
|
-
return result;
|
|
5287
|
-
};
|
|
5288
|
-
})();
|
|
5212
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
5213
|
+
if (mod && mod.__esModule) return mod;
|
|
5214
|
+
var result = {};
|
|
5215
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
5216
|
+
__setModuleDefault(result, mod);
|
|
5217
|
+
return result;
|
|
5218
|
+
};
|
|
5289
5219
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5290
5220
|
exports.OTClientEngine = void 0;
|
|
5291
5221
|
const OTC = __importStar(__webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts"));
|
|
@@ -5557,23 +5487,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
5557
5487
|
}) : function(o, v) {
|
|
5558
5488
|
o["default"] = v;
|
|
5559
5489
|
});
|
|
5560
|
-
var __importStar = (this && this.__importStar) ||
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
return ownKeys(o);
|
|
5568
|
-
};
|
|
5569
|
-
return function (mod) {
|
|
5570
|
-
if (mod && mod.__esModule) return mod;
|
|
5571
|
-
var result = {};
|
|
5572
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
5573
|
-
__setModuleDefault(result, mod);
|
|
5574
|
-
return result;
|
|
5575
|
-
};
|
|
5576
|
-
})();
|
|
5490
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
5491
|
+
if (mod && mod.__esModule) return mod;
|
|
5492
|
+
var result = {};
|
|
5493
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
5494
|
+
__setModuleDefault(result, mod);
|
|
5495
|
+
return result;
|
|
5496
|
+
};
|
|
5577
5497
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5578
5498
|
exports.OTCompositeResource = exports.clockSeenValue = exports.clockUndoValue = exports.clockInitializeValue = exports.clockFailureValue = exports.clockRandomizeValue = exports.clockTerminateValue = exports.clockInitialValue = void 0;
|
|
5579
5499
|
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
@@ -5809,23 +5729,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
5809
5729
|
}) : function(o, v) {
|
|
5810
5730
|
o["default"] = v;
|
|
5811
5731
|
});
|
|
5812
|
-
var __importStar = (this && this.__importStar) ||
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
return ownKeys(o);
|
|
5820
|
-
};
|
|
5821
|
-
return function (mod) {
|
|
5822
|
-
if (mod && mod.__esModule) return mod;
|
|
5823
|
-
var result = {};
|
|
5824
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
5825
|
-
__setModuleDefault(result, mod);
|
|
5826
|
-
return result;
|
|
5827
|
-
};
|
|
5828
|
-
})();
|
|
5732
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
5733
|
+
if (mod && mod.__esModule) return mod;
|
|
5734
|
+
var result = {};
|
|
5735
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
5736
|
+
__setModuleDefault(result, mod);
|
|
5737
|
+
return result;
|
|
5738
|
+
};
|
|
5829
5739
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5830
5740
|
exports.OTCounterResource = exports.OpCounterDel = exports.OpCounterAdd = void 0;
|
|
5831
5741
|
const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
|
|
@@ -6017,23 +5927,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6017
5927
|
}) : function(o, v) {
|
|
6018
5928
|
o["default"] = v;
|
|
6019
5929
|
});
|
|
6020
|
-
var __importStar = (this && this.__importStar) ||
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
return ownKeys(o);
|
|
6028
|
-
};
|
|
6029
|
-
return function (mod) {
|
|
6030
|
-
if (mod && mod.__esModule) return mod;
|
|
6031
|
-
var result = {};
|
|
6032
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6033
|
-
__setModuleDefault(result, mod);
|
|
6034
|
-
return result;
|
|
6035
|
-
};
|
|
6036
|
-
})();
|
|
5930
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
5931
|
+
if (mod && mod.__esModule) return mod;
|
|
5932
|
+
var result = {};
|
|
5933
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
5934
|
+
__setModuleDefault(result, mod);
|
|
5935
|
+
return result;
|
|
5936
|
+
};
|
|
6037
5937
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6038
5938
|
exports.OTMapResource = exports.OpMapDel = exports.OpMapSet = void 0;
|
|
6039
5939
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
@@ -6170,23 +6070,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6170
6070
|
}) : function(o, v) {
|
|
6171
6071
|
o["default"] = v;
|
|
6172
6072
|
});
|
|
6173
|
-
var __importStar = (this && this.__importStar) ||
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
return ownKeys(o);
|
|
6181
|
-
};
|
|
6182
|
-
return function (mod) {
|
|
6183
|
-
if (mod && mod.__esModule) return mod;
|
|
6184
|
-
var result = {};
|
|
6185
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6186
|
-
__setModuleDefault(result, mod);
|
|
6187
|
-
return result;
|
|
6188
|
-
};
|
|
6189
|
-
})();
|
|
6073
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6074
|
+
if (mod && mod.__esModule) return mod;
|
|
6075
|
+
var result = {};
|
|
6076
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6077
|
+
__setModuleDefault(result, mod);
|
|
6078
|
+
return result;
|
|
6079
|
+
};
|
|
6190
6080
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6191
6081
|
exports.OTServerEngine = exports.ClientIDForServer = void 0;
|
|
6192
6082
|
const OTC = __importStar(__webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts"));
|
|
@@ -6456,10 +6346,7 @@ exports.OTServerEngine = OTServerEngine;
|
|
|
6456
6346
|
|
|
6457
6347
|
|
|
6458
6348
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6459
|
-
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;
|
|
6460
|
-
exports.accessFindUser = accessFindUser;
|
|
6461
|
-
exports.accessMapFindUser = accessMapFindUser;
|
|
6462
|
-
exports.SessionFilterFunction = SessionFilterFunction;
|
|
6349
|
+
exports.SessionFilterFunction = exports.accessMapFindUser = exports.accessFindUser = 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;
|
|
6463
6350
|
// Errors
|
|
6464
6351
|
exports.ESuccess = 0; // Generic success
|
|
6465
6352
|
exports.EFail = 1; // Generic failure
|
|
@@ -6518,6 +6405,7 @@ function accessFindUser(a, uid) {
|
|
|
6518
6405
|
return a.perm;
|
|
6519
6406
|
return exports.PermNone;
|
|
6520
6407
|
}
|
|
6408
|
+
exports.accessFindUser = accessFindUser;
|
|
6521
6409
|
function accessMapFindUser(accessMap, uid, aid) {
|
|
6522
6410
|
if (aid !== undefined)
|
|
6523
6411
|
return accessFindUser(accessMap[aid], uid);
|
|
@@ -6535,6 +6423,7 @@ function accessMapFindUser(accessMap, uid, aid) {
|
|
|
6535
6423
|
return perm;
|
|
6536
6424
|
}
|
|
6537
6425
|
}
|
|
6426
|
+
exports.accessMapFindUser = accessMapFindUser;
|
|
6538
6427
|
function SessionFilterFunction(p, uid, f) {
|
|
6539
6428
|
if (f === exports.FilterPublic)
|
|
6540
6429
|
return p.published !== undefined;
|
|
@@ -6555,6 +6444,7 @@ function SessionFilterFunction(p, uid, f) {
|
|
|
6555
6444
|
}
|
|
6556
6445
|
return !p.deleted;
|
|
6557
6446
|
}
|
|
6447
|
+
exports.SessionFilterFunction = SessionFilterFunction;
|
|
6558
6448
|
|
|
6559
6449
|
|
|
6560
6450
|
/***/ }),
|
|
@@ -6690,25 +6580,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6690
6580
|
}) : function(o, v) {
|
|
6691
6581
|
o["default"] = v;
|
|
6692
6582
|
});
|
|
6693
|
-
var __importStar = (this && this.__importStar) ||
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
return ownKeys(o);
|
|
6701
|
-
};
|
|
6702
|
-
return function (mod) {
|
|
6703
|
-
if (mod && mod.__esModule) return mod;
|
|
6704
|
-
var result = {};
|
|
6705
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6706
|
-
__setModuleDefault(result, mod);
|
|
6707
|
-
return result;
|
|
6708
|
-
};
|
|
6709
|
-
})();
|
|
6583
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6584
|
+
if (mod && mod.__esModule) return mod;
|
|
6585
|
+
var result = {};
|
|
6586
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6587
|
+
__setModuleDefault(result, mod);
|
|
6588
|
+
return result;
|
|
6589
|
+
};
|
|
6710
6590
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6711
|
-
exports.blend =
|
|
6591
|
+
exports.blend = void 0;
|
|
6712
6592
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
6713
6593
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
6714
6594
|
// Takes array of polygon or multi-polygon coordinate structures and returns a single multi-polygon
|
|
@@ -6730,6 +6610,7 @@ function blend(polys) {
|
|
|
6730
6610
|
}
|
|
6731
6611
|
return result;
|
|
6732
6612
|
}
|
|
6613
|
+
exports.blend = blend;
|
|
6733
6614
|
|
|
6734
6615
|
|
|
6735
6616
|
/***/ }),
|
|
@@ -6757,42 +6638,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6757
6638
|
}) : function(o, v) {
|
|
6758
6639
|
o["default"] = v;
|
|
6759
6640
|
});
|
|
6760
|
-
var __importStar = (this && this.__importStar) ||
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
return ownKeys(o);
|
|
6768
|
-
};
|
|
6769
|
-
return function (mod) {
|
|
6770
|
-
if (mod && mod.__esModule) return mod;
|
|
6771
|
-
var result = {};
|
|
6772
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6773
|
-
__setModuleDefault(result, mod);
|
|
6774
|
-
return result;
|
|
6775
|
-
};
|
|
6776
|
-
})();
|
|
6641
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6642
|
+
if (mod && mod.__esModule) return mod;
|
|
6643
|
+
var result = {};
|
|
6644
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6645
|
+
__setModuleDefault(result, mod);
|
|
6646
|
+
return result;
|
|
6647
|
+
};
|
|
6777
6648
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6778
|
-
exports.boundboxWidth =
|
|
6779
|
-
exports.boundboxHeight = boundboxHeight;
|
|
6780
|
-
exports.boundboxCX = boundboxCX;
|
|
6781
|
-
exports.boundboxCY = boundboxCY;
|
|
6782
|
-
exports.clipLon = clipLon;
|
|
6783
|
-
exports.boundboxExtend = boundboxExtend;
|
|
6784
|
-
exports.boundbox = boundbox;
|
|
6785
|
-
exports.boundboxPoly = boundboxPoly;
|
|
6786
|
-
exports.boundboxEmpty = boundboxEmpty;
|
|
6787
|
-
exports.boundboxArea = boundboxArea;
|
|
6788
|
-
exports.boundboxIntersects = boundboxIntersects;
|
|
6789
|
-
exports.boundboxContains = boundboxContains;
|
|
6649
|
+
exports.boundboxContains = exports.boundboxIntersects = exports.boundboxArea = exports.boundboxEmpty = exports.boundboxPoly = exports.boundbox = exports.boundboxExtend = exports.clipLon = exports.boundboxCY = exports.boundboxCX = exports.boundboxHeight = exports.boundboxWidth = void 0;
|
|
6790
6650
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
6791
6651
|
function boundboxWidth(bb) { return Math.abs(bb.right - bb.left); }
|
|
6652
|
+
exports.boundboxWidth = boundboxWidth;
|
|
6792
6653
|
function boundboxHeight(bb) { return Math.abs(bb.bottom - bb.top); }
|
|
6654
|
+
exports.boundboxHeight = boundboxHeight;
|
|
6793
6655
|
function boundboxCX(bb) { return bb.left + (bb.right - bb.left) / 2; }
|
|
6656
|
+
exports.boundboxCX = boundboxCX;
|
|
6794
6657
|
function boundboxCY(bb) { return bb.top + (bb.bottom - bb.top) / 2; }
|
|
6658
|
+
exports.boundboxCY = boundboxCY;
|
|
6795
6659
|
function clipLon(lon) { return lon <= 0 ? lon : -179; }
|
|
6660
|
+
exports.clipLon = clipLon;
|
|
6796
6661
|
function boundboxExtend(bbox, x, y) {
|
|
6797
6662
|
x = clipLon(x);
|
|
6798
6663
|
if (bbox.left === undefined || x < bbox.left)
|
|
@@ -6804,6 +6669,7 @@ function boundboxExtend(bbox, x, y) {
|
|
|
6804
6669
|
if (bbox.bottom === undefined || y < bbox.bottom)
|
|
6805
6670
|
bbox.bottom = y;
|
|
6806
6671
|
}
|
|
6672
|
+
exports.boundboxExtend = boundboxExtend;
|
|
6807
6673
|
function boundboxExtendPacked(pp, bbox) {
|
|
6808
6674
|
let buffer = pp.buffer;
|
|
6809
6675
|
let offset = pp.buffer[pp.offset + 1] + pp.offset;
|
|
@@ -6842,21 +6708,27 @@ function boundbox(poly, bbox) {
|
|
|
6842
6708
|
}
|
|
6843
6709
|
return bbox;
|
|
6844
6710
|
}
|
|
6711
|
+
exports.boundbox = boundbox;
|
|
6845
6712
|
function boundboxPoly(bb) {
|
|
6846
6713
|
return [[[bb.left, bb.top], [bb.left, bb.bottom], [bb.right, bb.bottom], [bb.right, bb.top], [bb.left, bb.top]]];
|
|
6847
6714
|
}
|
|
6715
|
+
exports.boundboxPoly = boundboxPoly;
|
|
6848
6716
|
function boundboxEmpty(bb) {
|
|
6849
6717
|
return !bb || bb.left === undefined || P.polyArea(boundboxPoly(bb)) == 0;
|
|
6850
6718
|
}
|
|
6719
|
+
exports.boundboxEmpty = boundboxEmpty;
|
|
6851
6720
|
function boundboxArea(poly) {
|
|
6852
6721
|
return P.polyArea(boundboxPoly(boundbox(poly)));
|
|
6853
6722
|
}
|
|
6723
|
+
exports.boundboxArea = boundboxArea;
|
|
6854
6724
|
function boundboxIntersects(bb1, bb2) {
|
|
6855
6725
|
return !(bb1.left > bb2.right || bb1.right < bb2.left || bb1.top < bb2.bottom || bb1.bottom > bb2.top);
|
|
6856
6726
|
}
|
|
6727
|
+
exports.boundboxIntersects = boundboxIntersects;
|
|
6857
6728
|
function boundboxContains(bb, x, y) {
|
|
6858
6729
|
return !(bb.left >= x || bb.right < x || bb.top <= y || bb.bottom > y);
|
|
6859
6730
|
}
|
|
6731
|
+
exports.boundboxContains = boundboxContains;
|
|
6860
6732
|
|
|
6861
6733
|
|
|
6862
6734
|
/***/ }),
|
|
@@ -6887,28 +6759,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
6887
6759
|
}) : function(o, v) {
|
|
6888
6760
|
o["default"] = v;
|
|
6889
6761
|
});
|
|
6890
|
-
var __importStar = (this && this.__importStar) ||
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
return ownKeys(o);
|
|
6898
|
-
};
|
|
6899
|
-
return function (mod) {
|
|
6900
|
-
if (mod && mod.__esModule) return mod;
|
|
6901
|
-
var result = {};
|
|
6902
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
6903
|
-
__setModuleDefault(result, mod);
|
|
6904
|
-
return result;
|
|
6905
|
-
};
|
|
6906
|
-
})();
|
|
6762
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6763
|
+
if (mod && mod.__esModule) return mod;
|
|
6764
|
+
var result = {};
|
|
6765
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6766
|
+
__setModuleDefault(result, mod);
|
|
6767
|
+
return result;
|
|
6768
|
+
};
|
|
6907
6769
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6908
|
-
exports.polyParts =
|
|
6909
|
-
exports.polyAreaFlat = polyAreaFlat;
|
|
6910
|
-
exports.polyPerimeterFlat = polyPerimeterFlat;
|
|
6911
|
-
exports.polyDiameterFlat = polyDiameterFlat;
|
|
6770
|
+
exports.polyDiameterFlat = exports.polyPerimeterFlat = exports.polyAreaFlat = exports.polyParts = void 0;
|
|
6912
6771
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
6913
6772
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
6914
6773
|
// HELPER
|
|
@@ -6937,6 +6796,7 @@ function polyParts(poly) {
|
|
|
6937
6796
|
});
|
|
6938
6797
|
return parts;
|
|
6939
6798
|
}
|
|
6799
|
+
exports.polyParts = polyParts;
|
|
6940
6800
|
// CARTESIAN ("FLAT") AREA, PERIMETER, AND DIAMETER
|
|
6941
6801
|
function polyAreaFlat(poly) {
|
|
6942
6802
|
let pp = P.polyNormalize(poly);
|
|
@@ -6946,6 +6806,7 @@ function polyAreaFlat(poly) {
|
|
|
6946
6806
|
});
|
|
6947
6807
|
return a;
|
|
6948
6808
|
}
|
|
6809
|
+
exports.polyAreaFlat = polyAreaFlat;
|
|
6949
6810
|
// Algorithm for the area of a simple/single planar polygon:
|
|
6950
6811
|
// https://algorithmtutor.com/Computational-Geometry/Area-of-a-polygon-given-a-set-of-points/
|
|
6951
6812
|
// https://mathopenref.com/coordpolygonarea2.html
|
|
@@ -6990,6 +6851,7 @@ function polyPerimeterFlat(poly) {
|
|
|
6990
6851
|
});
|
|
6991
6852
|
return perimeter;
|
|
6992
6853
|
}
|
|
6854
|
+
exports.polyPerimeterFlat = polyPerimeterFlat;
|
|
6993
6855
|
function _distance(x1, y1, x2, y2) {
|
|
6994
6856
|
const dLat = y2 - y1;
|
|
6995
6857
|
const dLon = x2 - x1;
|
|
@@ -7003,6 +6865,7 @@ function polyDiameterFlat(poly) {
|
|
|
7003
6865
|
let circle = P.polyToCircle(poly);
|
|
7004
6866
|
return circle ? circle.r * 2 : 0;
|
|
7005
6867
|
}
|
|
6868
|
+
exports.polyDiameterFlat = polyDiameterFlat;
|
|
7006
6869
|
|
|
7007
6870
|
|
|
7008
6871
|
/***/ }),
|
|
@@ -7015,7 +6878,7 @@ function polyDiameterFlat(poly) {
|
|
|
7015
6878
|
|
|
7016
6879
|
|
|
7017
6880
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7018
|
-
exports.featureCleanHoles =
|
|
6881
|
+
exports.featureCleanHoles = void 0;
|
|
7019
6882
|
const union_1 = __webpack_require__(/*! ./union */ "./lib/poly/union.ts");
|
|
7020
6883
|
const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
7021
6884
|
function flattenMultiPoly(polys) {
|
|
@@ -7093,6 +6956,7 @@ function featureCleanHoles(f) {
|
|
|
7093
6956
|
}
|
|
7094
6957
|
return f;
|
|
7095
6958
|
}
|
|
6959
|
+
exports.featureCleanHoles = featureCleanHoles;
|
|
7096
6960
|
|
|
7097
6961
|
|
|
7098
6962
|
/***/ }),
|
|
@@ -7128,25 +6992,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
7128
6992
|
}) : function(o, v) {
|
|
7129
6993
|
o["default"] = v;
|
|
7130
6994
|
});
|
|
7131
|
-
var __importStar = (this && this.__importStar) ||
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
return ownKeys(o);
|
|
7139
|
-
};
|
|
7140
|
-
return function (mod) {
|
|
7141
|
-
if (mod && mod.__esModule) return mod;
|
|
7142
|
-
var result = {};
|
|
7143
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
7144
|
-
__setModuleDefault(result, mod);
|
|
7145
|
-
return result;
|
|
7146
|
-
};
|
|
7147
|
-
})();
|
|
6995
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
6996
|
+
if (mod && mod.__esModule) return mod;
|
|
6997
|
+
var result = {};
|
|
6998
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
6999
|
+
__setModuleDefault(result, mod);
|
|
7000
|
+
return result;
|
|
7001
|
+
};
|
|
7148
7002
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7149
|
-
exports.makeConvexHullGrahamScan =
|
|
7003
|
+
exports.makeConvexHullGrahamScan = void 0;
|
|
7150
7004
|
const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
|
|
7151
7005
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
7152
7006
|
function makeConvexHullGrahamScan(poly, options) {
|
|
@@ -7160,6 +7014,7 @@ function makeConvexHullGrahamScan(poly, options) {
|
|
|
7160
7014
|
const ch = scanner.getHull();
|
|
7161
7015
|
return [ch];
|
|
7162
7016
|
}
|
|
7017
|
+
exports.makeConvexHullGrahamScan = makeConvexHullGrahamScan;
|
|
7163
7018
|
// NOTE - This finds the exterior points of a polygon in standard form and returns
|
|
7164
7019
|
// it as an array if [x, y] points, in contrast to polyToExteriorPoints() which
|
|
7165
7020
|
// uses the packed format and the poly.ts-private point form.
|
|
@@ -7508,26 +7363,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
7508
7363
|
}) : function(o, v) {
|
|
7509
7364
|
o["default"] = v;
|
|
7510
7365
|
});
|
|
7511
|
-
var __importStar = (this && this.__importStar) ||
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
return ownKeys(o);
|
|
7519
|
-
};
|
|
7520
|
-
return function (mod) {
|
|
7521
|
-
if (mod && mod.__esModule) return mod;
|
|
7522
|
-
var result = {};
|
|
7523
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
7524
|
-
__setModuleDefault(result, mod);
|
|
7525
|
-
return result;
|
|
7526
|
-
};
|
|
7527
|
-
})();
|
|
7366
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7367
|
+
if (mod && mod.__esModule) return mod;
|
|
7368
|
+
var result = {};
|
|
7369
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7370
|
+
__setModuleDefault(result, mod);
|
|
7371
|
+
return result;
|
|
7372
|
+
};
|
|
7528
7373
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7529
|
-
exports.polyMapToByCentroid =
|
|
7530
|
-
exports.polyMapTo = polyMapTo;
|
|
7374
|
+
exports.polyMapTo = exports.polyMapToByCentroid = void 0;
|
|
7531
7375
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
7532
7376
|
const PL = __importStar(__webpack_require__(/*! ./polylabel */ "./lib/poly/polylabel.ts"));
|
|
7533
7377
|
const BB = __importStar(__webpack_require__(/*! ./boundbox */ "./lib/poly/boundbox.ts"));
|
|
@@ -7588,6 +7432,7 @@ function polyMapToByCentroid(districts, centroids) {
|
|
|
7588
7432
|
});
|
|
7589
7433
|
return map;
|
|
7590
7434
|
}
|
|
7435
|
+
exports.polyMapToByCentroid = polyMapToByCentroid;
|
|
7591
7436
|
function polyMapTo(districts, blocks) {
|
|
7592
7437
|
// Cache labelx, labely if necessary
|
|
7593
7438
|
setLabels(blocks);
|
|
@@ -7597,6 +7442,7 @@ function polyMapTo(districts, blocks) {
|
|
|
7597
7442
|
});
|
|
7598
7443
|
return polyMapToByCentroid(districts, centroids);
|
|
7599
7444
|
}
|
|
7445
|
+
exports.polyMapTo = polyMapTo;
|
|
7600
7446
|
|
|
7601
7447
|
|
|
7602
7448
|
/***/ }),
|
|
@@ -7612,24 +7458,11 @@ function polyMapTo(districts, blocks) {
|
|
|
7612
7458
|
// SOME BASIC MATRIX OPERATIONS FOR MBR
|
|
7613
7459
|
//
|
|
7614
7460
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7615
|
-
exports.matrix =
|
|
7616
|
-
exports.multiply = multiply;
|
|
7617
|
-
exports.transpose = transpose;
|
|
7618
|
-
exports.apply = apply;
|
|
7619
|
-
exports.min = min;
|
|
7620
|
-
exports.max = max;
|
|
7621
|
-
exports.concat = concat;
|
|
7622
|
-
exports.row = row;
|
|
7623
|
-
exports.column = column;
|
|
7624
|
-
exports.subtract = subtract;
|
|
7625
|
-
exports.dotMultiply = dotMultiply;
|
|
7626
|
-
exports.index = index;
|
|
7627
|
-
exports.range = range;
|
|
7628
|
-
exports.subset = subset;
|
|
7629
|
-
exports.dotProduct = dotProduct;
|
|
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;
|
|
7630
7462
|
function matrix(a) {
|
|
7631
7463
|
return a;
|
|
7632
7464
|
}
|
|
7465
|
+
exports.matrix = matrix;
|
|
7633
7466
|
function multiply(a, b) {
|
|
7634
7467
|
protect((nRows(a) > 0), "In multiply, input matrix 'a' has no rows. ");
|
|
7635
7468
|
protect((nCols(a) > 0), "In multiply, input matrix 'a' has no columns. ");
|
|
@@ -7650,6 +7483,7 @@ function multiply(a, b) {
|
|
|
7650
7483
|
}
|
|
7651
7484
|
return c;
|
|
7652
7485
|
}
|
|
7486
|
+
exports.multiply = multiply;
|
|
7653
7487
|
function transpose(a) {
|
|
7654
7488
|
protect((nRows(a) > 0), "In transpose, input matrix has no rows. ");
|
|
7655
7489
|
protect((nCols(a) > 0), "In transpose, input matrix has no columns. ");
|
|
@@ -7663,6 +7497,7 @@ function transpose(a) {
|
|
|
7663
7497
|
}
|
|
7664
7498
|
return b;
|
|
7665
7499
|
}
|
|
7500
|
+
exports.transpose = transpose;
|
|
7666
7501
|
function apply(a, over, cb) {
|
|
7667
7502
|
protect((nRows(a) > 0), "In apply, input matrix has no rows. ");
|
|
7668
7503
|
protect((nCols(a) > 0), "In apply, input matrix has no columns. ");
|
|
@@ -7677,12 +7512,15 @@ function apply(a, over, cb) {
|
|
|
7677
7512
|
}
|
|
7678
7513
|
return result;
|
|
7679
7514
|
}
|
|
7515
|
+
exports.apply = apply;
|
|
7680
7516
|
function min(v) {
|
|
7681
7517
|
return Math.min(...v);
|
|
7682
7518
|
}
|
|
7519
|
+
exports.min = min;
|
|
7683
7520
|
function max(v) {
|
|
7684
7521
|
return Math.max(...v);
|
|
7685
7522
|
}
|
|
7523
|
+
exports.max = max;
|
|
7686
7524
|
function concat(a, b, by) {
|
|
7687
7525
|
protect((nRows(a) > 0), "In concat, input matrix 'a' has no rows. ");
|
|
7688
7526
|
protect((nCols(a) > 0), "In concat, input matrix 'a' has no columns. ");
|
|
@@ -7714,12 +7552,14 @@ function concat(a, b, by) {
|
|
|
7714
7552
|
}
|
|
7715
7553
|
return c;
|
|
7716
7554
|
}
|
|
7555
|
+
exports.concat = concat;
|
|
7717
7556
|
function row(a, i) {
|
|
7718
7557
|
protect((nRows(a) > 0), "In row, input matrix has no rows. ");
|
|
7719
7558
|
protect((nCols(a) > 0), "In row, input matrix has no columns. ");
|
|
7720
7559
|
protect((i >= 0), "In row, invalid row index.");
|
|
7721
7560
|
return a[i];
|
|
7722
7561
|
}
|
|
7562
|
+
exports.row = row;
|
|
7723
7563
|
function column(a, j) {
|
|
7724
7564
|
protect((nRows(a) > 0), "In column, input matrix has no rows. ");
|
|
7725
7565
|
protect((nCols(a) > 0), "In column, input matrix has no columns. ");
|
|
@@ -7730,6 +7570,7 @@ function column(a, j) {
|
|
|
7730
7570
|
}
|
|
7731
7571
|
return v;
|
|
7732
7572
|
}
|
|
7573
|
+
exports.column = column;
|
|
7733
7574
|
function subtract(a, b) {
|
|
7734
7575
|
protect((a.length == b.length), "In subtract, the input vectors have different lengths.");
|
|
7735
7576
|
let c = [];
|
|
@@ -7738,6 +7579,7 @@ function subtract(a, b) {
|
|
|
7738
7579
|
}
|
|
7739
7580
|
return c;
|
|
7740
7581
|
}
|
|
7582
|
+
exports.subtract = subtract;
|
|
7741
7583
|
function dotMultiply(a, b) {
|
|
7742
7584
|
protect((a.length > 0) && (a.length == b.length), "In dotMultiply, the vectors aren't the same length. ");
|
|
7743
7585
|
let c = [];
|
|
@@ -7746,9 +7588,11 @@ function dotMultiply(a, b) {
|
|
|
7746
7588
|
}
|
|
7747
7589
|
return c;
|
|
7748
7590
|
}
|
|
7591
|
+
exports.dotMultiply = dotMultiply;
|
|
7749
7592
|
function index(a, b) {
|
|
7750
7593
|
return [a, b];
|
|
7751
7594
|
}
|
|
7595
|
+
exports.index = index;
|
|
7752
7596
|
function range(start, end, includeEnd = false) {
|
|
7753
7597
|
let r = [];
|
|
7754
7598
|
end += includeEnd ? 1 : 0;
|
|
@@ -7757,6 +7601,7 @@ function range(start, end, includeEnd = false) {
|
|
|
7757
7601
|
}
|
|
7758
7602
|
return r;
|
|
7759
7603
|
}
|
|
7604
|
+
exports.range = range;
|
|
7760
7605
|
function subset(a, select) {
|
|
7761
7606
|
protect((nRows(a) > 0), "In subset, input matrix has no rows. ");
|
|
7762
7607
|
protect((nCols(a) > 0), "In subset, input matrix has no columns. ");
|
|
@@ -7776,6 +7621,7 @@ function subset(a, select) {
|
|
|
7776
7621
|
}
|
|
7777
7622
|
return b;
|
|
7778
7623
|
}
|
|
7624
|
+
exports.subset = subset;
|
|
7779
7625
|
// HELPERS
|
|
7780
7626
|
function initialize(rows, cols) {
|
|
7781
7627
|
protect(((rows > 0) || (cols > 0)), "In initialize, the # of rows or columns is not positive. ");
|
|
@@ -7788,6 +7634,7 @@ function dotProduct(a, b) {
|
|
|
7788
7634
|
protect((a.length > 0) && (a.length == b.length), "In dotProduct, the vectors aren't the same length. ");
|
|
7789
7635
|
return a.map((value, i) => value * b[i]).reduce((acc, val) => acc + val, 0);
|
|
7790
7636
|
}
|
|
7637
|
+
exports.dotProduct = dotProduct;
|
|
7791
7638
|
;
|
|
7792
7639
|
function protect(condition, message) {
|
|
7793
7640
|
if (!condition)
|
|
@@ -7823,25 +7670,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
7823
7670
|
}) : function(o, v) {
|
|
7824
7671
|
o["default"] = v;
|
|
7825
7672
|
});
|
|
7826
|
-
var __importStar = (this && this.__importStar) ||
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
return ownKeys(o);
|
|
7834
|
-
};
|
|
7835
|
-
return function (mod) {
|
|
7836
|
-
if (mod && mod.__esModule) return mod;
|
|
7837
|
-
var result = {};
|
|
7838
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
7839
|
-
__setModuleDefault(result, mod);
|
|
7840
|
-
return result;
|
|
7841
|
-
};
|
|
7842
|
-
})();
|
|
7673
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7674
|
+
if (mod && mod.__esModule) return mod;
|
|
7675
|
+
var result = {};
|
|
7676
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7677
|
+
__setModuleDefault(result, mod);
|
|
7678
|
+
return result;
|
|
7679
|
+
};
|
|
7843
7680
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7844
|
-
exports.minimumBoundingRectangle =
|
|
7681
|
+
exports.minimumBoundingRectangle = void 0;
|
|
7845
7682
|
//
|
|
7846
7683
|
// WHUBER'S ELEGANT, TRIG-FREE SOLUTION IN R
|
|
7847
7684
|
//
|
|
@@ -7925,6 +7762,7 @@ function minimumBoundingRectangle(poly) {
|
|
|
7925
7762
|
// Convert to standard polygon form
|
|
7926
7763
|
return [points];
|
|
7927
7764
|
}
|
|
7765
|
+
exports.minimumBoundingRectangle = minimumBoundingRectangle;
|
|
7928
7766
|
//
|
|
7929
7767
|
// THIS RE-IMPLEMENTS THE R IN TYPESCRIPT, USING MATHJS FOR MATRIX OPERATIONS
|
|
7930
7768
|
//
|
|
@@ -8047,25 +7885,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
8047
7885
|
}) : function(o, v) {
|
|
8048
7886
|
o["default"] = v;
|
|
8049
7887
|
});
|
|
8050
|
-
var __importStar = (this && this.__importStar) ||
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
return ownKeys(o);
|
|
8058
|
-
};
|
|
8059
|
-
return function (mod) {
|
|
8060
|
-
if (mod && mod.__esModule) return mod;
|
|
8061
|
-
var result = {};
|
|
8062
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
8063
|
-
__setModuleDefault(result, mod);
|
|
8064
|
-
return result;
|
|
8065
|
-
};
|
|
8066
|
-
})();
|
|
7888
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7889
|
+
if (mod && mod.__esModule) return mod;
|
|
7890
|
+
var result = {};
|
|
7891
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7892
|
+
__setModuleDefault(result, mod);
|
|
7893
|
+
return result;
|
|
7894
|
+
};
|
|
8067
7895
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8068
|
-
exports.polyContainsPoint =
|
|
7896
|
+
exports.polyContainsPoint = void 0;
|
|
8069
7897
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
8070
7898
|
function polyContainsPoint(poly, x, y) {
|
|
8071
7899
|
let pp = PP.polyPack(poly);
|
|
@@ -8098,6 +7926,7 @@ function polyContainsPoint(poly, x, y) {
|
|
|
8098
7926
|
bInside = true;
|
|
8099
7927
|
return bInside;
|
|
8100
7928
|
}
|
|
7929
|
+
exports.polyContainsPoint = polyContainsPoint;
|
|
8101
7930
|
|
|
8102
7931
|
|
|
8103
7932
|
/***/ }),
|
|
@@ -8125,45 +7954,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
8125
7954
|
}) : function(o, v) {
|
|
8126
7955
|
o["default"] = v;
|
|
8127
7956
|
});
|
|
8128
|
-
var __importStar = (this && this.__importStar) ||
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
return ownKeys(o);
|
|
8136
|
-
};
|
|
8137
|
-
return function (mod) {
|
|
8138
|
-
if (mod && mod.__esModule) return mod;
|
|
8139
|
-
var result = {};
|
|
8140
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
8141
|
-
__setModuleDefault(result, mod);
|
|
8142
|
-
return result;
|
|
8143
|
-
};
|
|
8144
|
-
})();
|
|
7957
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
7958
|
+
if (mod && mod.__esModule) return mod;
|
|
7959
|
+
var result = {};
|
|
7960
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
7961
|
+
__setModuleDefault(result, mod);
|
|
7962
|
+
return result;
|
|
7963
|
+
};
|
|
8145
7964
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8146
|
-
exports.Circle = exports.DefaultOptions = exports.EARTH_RADIUS = exports.DefaultTickOptions = void 0;
|
|
8147
|
-
exports.polySimpleArea = polySimpleArea;
|
|
8148
|
-
exports.polyNormalize = polyNormalize;
|
|
8149
|
-
exports.polyNull = polyNull;
|
|
8150
|
-
exports.polyArea = polyArea;
|
|
8151
|
-
exports.polyDiameter = polyDiameter;
|
|
8152
|
-
exports.polyPerimeter = polyPerimeter;
|
|
8153
|
-
exports.polyToCircle = polyToCircle;
|
|
8154
|
-
exports.polyToPolsbyPopperCircle = polyToPolsbyPopperCircle;
|
|
8155
|
-
exports.polyFromCircle = polyFromCircle;
|
|
8156
|
-
exports.polyToExteriorPoints = polyToExteriorPoints;
|
|
8157
|
-
exports.polyConvexHull = polyConvexHull;
|
|
8158
|
-
exports.makeConvexHullMonotoneChain2D = makeConvexHullMonotoneChain2D;
|
|
8159
|
-
exports.polyCompactness = polyCompactness;
|
|
8160
|
-
exports.polyDescribe = polyDescribe;
|
|
8161
|
-
exports.npoints = npoints;
|
|
8162
|
-
exports.polyTransform = polyTransform;
|
|
8163
|
-
exports.polyRingWindings = polyRingWindings;
|
|
8164
|
-
exports.featureRewind = featureRewind;
|
|
8165
|
-
exports.polyRewindRings = polyRewindRings;
|
|
8166
|
-
exports.polyBadCoordinates = polyBadCoordinates;
|
|
7965
|
+
exports.polyBadCoordinates = exports.polyRewindRings = exports.featureRewind = exports.polyRingWindings = exports.polyTransform = exports.npoints = exports.polyDescribe = exports.polyCompactness = exports.makeConvexHullMonotoneChain2D = exports.polyConvexHull = exports.polyToExteriorPoints = exports.polyFromCircle = exports.polyToPolsbyPopperCircle = exports.polyToCircle = exports.Circle = exports.polyPerimeter = exports.polyDiameter = exports.polyArea = exports.polyNull = exports.polyNormalize = exports.polySimpleArea = exports.DefaultOptions = exports.EARTH_RADIUS = exports.DefaultTickOptions = void 0;
|
|
8167
7966
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
8168
7967
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
8169
7968
|
const graham_scan_1 = __webpack_require__(/*! ./graham-scan */ "./lib/poly/graham-scan.ts");
|
|
@@ -8217,15 +8016,18 @@ function polySimpleArea(b, iOffset, n) {
|
|
|
8217
8016
|
}
|
|
8218
8017
|
return Math.abs(total);
|
|
8219
8018
|
}
|
|
8019
|
+
exports.polySimpleArea = polySimpleArea;
|
|
8220
8020
|
// Allow bare polygon coordinates array or GeoJSON feature.
|
|
8221
8021
|
// Normalize to multipolygon points array.
|
|
8222
8022
|
function polyNormalize(poly) {
|
|
8223
8023
|
return PP.polyPack(poly);
|
|
8224
8024
|
}
|
|
8025
|
+
exports.polyNormalize = polyNormalize;
|
|
8225
8026
|
function polyNull(poly) {
|
|
8226
8027
|
let pp = PP.polyPack(poly);
|
|
8227
8028
|
return pp == null || pp.length == 2;
|
|
8228
8029
|
}
|
|
8030
|
+
exports.polyNull = polyNull;
|
|
8229
8031
|
// Area of geodesic polygon
|
|
8230
8032
|
function polyArea(poly) {
|
|
8231
8033
|
let pp = polyNormalize(poly);
|
|
@@ -8236,6 +8038,7 @@ function polyArea(poly) {
|
|
|
8236
8038
|
});
|
|
8237
8039
|
return a;
|
|
8238
8040
|
}
|
|
8041
|
+
exports.polyArea = polyArea;
|
|
8239
8042
|
// NOTE - COMPACTNESS: Added the diameter of the geodesic polygon in meters
|
|
8240
8043
|
function polyDiameter(poly, options) {
|
|
8241
8044
|
if (options === undefined)
|
|
@@ -8250,6 +8053,7 @@ function polyDiameter(poly, options) {
|
|
|
8250
8053
|
const diameter = Math.max(lonDistance, latDistance);
|
|
8251
8054
|
return diameter;
|
|
8252
8055
|
}
|
|
8056
|
+
exports.polyDiameter = polyDiameter;
|
|
8253
8057
|
// Return distance in meters given two lat/lon points
|
|
8254
8058
|
function haversine(x1, y1, x2, y2, options) {
|
|
8255
8059
|
let dLat = Util.deg2rad(y2 - y1);
|
|
@@ -8286,6 +8090,7 @@ function polyPerimeter(poly, options) {
|
|
|
8286
8090
|
});
|
|
8287
8091
|
return perimeter;
|
|
8288
8092
|
}
|
|
8093
|
+
exports.polyPerimeter = polyPerimeter;
|
|
8289
8094
|
class Point {
|
|
8290
8095
|
constructor(x, y) {
|
|
8291
8096
|
this.x = x;
|
|
@@ -8309,6 +8114,7 @@ exports.Circle = Circle;
|
|
|
8309
8114
|
function polyToCircle(poly) {
|
|
8310
8115
|
return makeCircle(polyToExteriorPoints(poly));
|
|
8311
8116
|
}
|
|
8117
|
+
exports.polyToCircle = polyToCircle;
|
|
8312
8118
|
//
|
|
8313
8119
|
// Returns the circle whose perimeter is equal to the perimeter of the bounding perimeter
|
|
8314
8120
|
// of the polygon. Use binary search to find an approximation.
|
|
@@ -8322,6 +8128,7 @@ function polyToPolsbyPopperCircle(poly, options) {
|
|
|
8322
8128
|
c.r = (p / (2 * Math.PI)) / 111139;
|
|
8323
8129
|
return c;
|
|
8324
8130
|
}
|
|
8131
|
+
exports.polyToPolsbyPopperCircle = polyToPolsbyPopperCircle;
|
|
8325
8132
|
function makeCircle(points) {
|
|
8326
8133
|
if (points == null)
|
|
8327
8134
|
return null;
|
|
@@ -8484,6 +8291,7 @@ function polyFromCircle(c, nSegments) {
|
|
|
8484
8291
|
// return multi-polygon
|
|
8485
8292
|
return [[poly]];
|
|
8486
8293
|
}
|
|
8294
|
+
exports.polyFromCircle = polyFromCircle;
|
|
8487
8295
|
// isLeft(): tests if a point is Left|On|Right of an infinite line.
|
|
8488
8296
|
// Input: three points P0, P1, and P2
|
|
8489
8297
|
// Return: >0 for P2 left of the line through P0 and P1
|
|
@@ -8511,6 +8319,7 @@ function polyToExteriorPoints(poly) {
|
|
|
8511
8319
|
});
|
|
8512
8320
|
return points.length > 0 ? points : null;
|
|
8513
8321
|
}
|
|
8322
|
+
exports.polyToExteriorPoints = polyToExteriorPoints;
|
|
8514
8323
|
//
|
|
8515
8324
|
// polyConvexHull() - Two algorithms:
|
|
8516
8325
|
// * Gram Scan (default) - in graham-scan.ts
|
|
@@ -8521,6 +8330,7 @@ function polyConvexHull(poly, altAlgorithm) {
|
|
|
8521
8330
|
return makeConvexHullMonotoneChain2D(poly);
|
|
8522
8331
|
return (0, graham_scan_1.makeConvexHullGrahamScan)(poly);
|
|
8523
8332
|
}
|
|
8333
|
+
exports.polyConvexHull = polyConvexHull;
|
|
8524
8334
|
function makeConvexHullMonotoneChain2D(poly) {
|
|
8525
8335
|
// Normalize input
|
|
8526
8336
|
let points = polyToExteriorPoints(poly);
|
|
@@ -8597,6 +8407,7 @@ function makeConvexHullMonotoneChain2D(poly) {
|
|
|
8597
8407
|
H[++top] = points[minmin]; // push joining endpoint onto stack
|
|
8598
8408
|
return pointsToPoly(H);
|
|
8599
8409
|
}
|
|
8410
|
+
exports.makeConvexHullMonotoneChain2D = makeConvexHullMonotoneChain2D;
|
|
8600
8411
|
function polyCompactness(poly, options) {
|
|
8601
8412
|
if (options === undefined)
|
|
8602
8413
|
options = exports.DefaultOptions;
|
|
@@ -8618,6 +8429,7 @@ function polyCompactness(poly, options) {
|
|
|
8618
8429
|
result.value = Math.trunc(((result.reock + result.polsby_popper) / 2) * 100);
|
|
8619
8430
|
return result;
|
|
8620
8431
|
}
|
|
8432
|
+
exports.polyCompactness = polyCompactness;
|
|
8621
8433
|
const EmptyPolyDescription = { npoly: 0, nhole: 0, npoint: 0 };
|
|
8622
8434
|
function polyDescribe(poly) {
|
|
8623
8435
|
let pp = polyNormalize(poly);
|
|
@@ -8631,10 +8443,12 @@ function polyDescribe(poly) {
|
|
|
8631
8443
|
});
|
|
8632
8444
|
return d;
|
|
8633
8445
|
}
|
|
8446
|
+
exports.polyDescribe = polyDescribe;
|
|
8634
8447
|
function npoints(poly) {
|
|
8635
8448
|
let d = polyDescribe(poly);
|
|
8636
8449
|
return d.npoint;
|
|
8637
8450
|
}
|
|
8451
|
+
exports.npoints = npoints;
|
|
8638
8452
|
//
|
|
8639
8453
|
// polyTransform: transform each point. Called for all polygons and all rings.
|
|
8640
8454
|
// point, by point. Returns a packed structure.
|
|
@@ -8652,6 +8466,7 @@ function polyTransform(poly, transformFn) {
|
|
|
8652
8466
|
});
|
|
8653
8467
|
return pp;
|
|
8654
8468
|
}
|
|
8469
|
+
exports.polyTransform = polyTransform;
|
|
8655
8470
|
function identityTransform(pt) {
|
|
8656
8471
|
return [pt[0], pt[1]];
|
|
8657
8472
|
}
|
|
@@ -8711,6 +8526,7 @@ function polyRingWindings(poly) {
|
|
|
8711
8526
|
});
|
|
8712
8527
|
return windings;
|
|
8713
8528
|
}
|
|
8529
|
+
exports.polyRingWindings = polyRingWindings;
|
|
8714
8530
|
function flattenMultiPoly(polys) {
|
|
8715
8531
|
let c = [];
|
|
8716
8532
|
polys.forEach((poly) => {
|
|
@@ -8762,6 +8578,7 @@ function featureRewind(f, options) {
|
|
|
8762
8578
|
});
|
|
8763
8579
|
return f;
|
|
8764
8580
|
}
|
|
8581
|
+
exports.featureRewind = featureRewind;
|
|
8765
8582
|
//
|
|
8766
8583
|
// polyRewindRings: Check the winding order of the polygon's ring. Rewind them,
|
|
8767
8584
|
// if necessary. Return a packed polygon.
|
|
@@ -8808,6 +8625,7 @@ function polyRewindRings(pp, bLog = false) {
|
|
|
8808
8625
|
});
|
|
8809
8626
|
return pp;
|
|
8810
8627
|
}
|
|
8628
|
+
exports.polyRewindRings = polyRewindRings;
|
|
8811
8629
|
//
|
|
8812
8630
|
// To figure out which way a ring is wound:
|
|
8813
8631
|
//
|
|
@@ -8841,6 +8659,7 @@ function polyBadCoordinates(f) {
|
|
|
8841
8659
|
}
|
|
8842
8660
|
return bad;
|
|
8843
8661
|
}
|
|
8662
|
+
exports.polyBadCoordinates = polyBadCoordinates;
|
|
8844
8663
|
|
|
8845
8664
|
|
|
8846
8665
|
/***/ }),
|
|
@@ -8868,28 +8687,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
8868
8687
|
}) : function(o, v) {
|
|
8869
8688
|
o["default"] = v;
|
|
8870
8689
|
});
|
|
8871
|
-
var __importStar = (this && this.__importStar) ||
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
return ownKeys(o);
|
|
8879
|
-
};
|
|
8880
|
-
return function (mod) {
|
|
8881
|
-
if (mod && mod.__esModule) return mod;
|
|
8882
|
-
var result = {};
|
|
8883
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
8884
|
-
__setModuleDefault(result, mod);
|
|
8885
|
-
return result;
|
|
8886
|
-
};
|
|
8887
|
-
})();
|
|
8690
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
8691
|
+
if (mod && mod.__esModule) return mod;
|
|
8692
|
+
var result = {};
|
|
8693
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
8694
|
+
__setModuleDefault(result, mod);
|
|
8695
|
+
return result;
|
|
8696
|
+
};
|
|
8888
8697
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8889
|
-
exports.packCollection =
|
|
8890
|
-
exports.unpackCollection = unpackCollection;
|
|
8891
|
-
exports.topoToBuffer = topoToBuffer;
|
|
8892
|
-
exports.topoFromBuffer = topoFromBuffer;
|
|
8698
|
+
exports.topoFromBuffer = exports.topoToBuffer = exports.unpackCollection = exports.packCollection = void 0;
|
|
8893
8699
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
8894
8700
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
8895
8701
|
const T = __importStar(__webpack_require__(/*! ./topo */ "./lib/poly/topo.ts"));
|
|
@@ -8970,6 +8776,7 @@ function packCollection(coder, col) {
|
|
|
8970
8776
|
PP.featureUnpack(col);
|
|
8971
8777
|
return ab;
|
|
8972
8778
|
}
|
|
8779
|
+
exports.packCollection = packCollection;
|
|
8973
8780
|
function reverse(buf8, s, n) {
|
|
8974
8781
|
let e = s + n - 1;
|
|
8975
8782
|
while (s < e) {
|
|
@@ -9021,6 +8828,7 @@ function unpackCollection(coder, ab) {
|
|
|
9021
8828
|
f.geometry.packed.buffer = buf64; });
|
|
9022
8829
|
return col;
|
|
9023
8830
|
}
|
|
8831
|
+
exports.unpackCollection = unpackCollection;
|
|
9024
8832
|
// Format of packed buffer:
|
|
9025
8833
|
// [Size of JSON string] [4 bytes]
|
|
9026
8834
|
// [Size of packedarcs] [4 bytes]
|
|
@@ -9069,6 +8877,7 @@ function topoToBuffer(coder, topo) {
|
|
|
9069
8877
|
topo.packed = savepack;
|
|
9070
8878
|
return ab;
|
|
9071
8879
|
}
|
|
8880
|
+
exports.topoToBuffer = topoToBuffer;
|
|
9072
8881
|
function topoFromBuffer(coder, ab) {
|
|
9073
8882
|
let buf8 = new Uint8Array(ab);
|
|
9074
8883
|
let buf32 = new Int32Array(ab);
|
|
@@ -9082,6 +8891,7 @@ function topoFromBuffer(coder, ab) {
|
|
|
9082
8891
|
topo.packed.arcindices = new Int32Array(ab, stringLength + HeaderSize + arcsByteLength, arcindicesByteLength / 4);
|
|
9083
8892
|
return topo;
|
|
9084
8893
|
}
|
|
8894
|
+
exports.topoFromBuffer = topoFromBuffer;
|
|
9085
8895
|
|
|
9086
8896
|
|
|
9087
8897
|
/***/ }),
|
|
@@ -9109,29 +8919,18 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
9109
8919
|
}) : function(o, v) {
|
|
9110
8920
|
o["default"] = v;
|
|
9111
8921
|
});
|
|
9112
|
-
var __importStar = (this && this.__importStar) ||
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
return ownKeys(o);
|
|
9120
|
-
};
|
|
9121
|
-
return function (mod) {
|
|
9122
|
-
if (mod && mod.__esModule) return mod;
|
|
9123
|
-
var result = {};
|
|
9124
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
9125
|
-
__setModuleDefault(result, mod);
|
|
9126
|
-
return result;
|
|
9127
|
-
};
|
|
9128
|
-
})();
|
|
8922
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
8923
|
+
if (mod && mod.__esModule) return mod;
|
|
8924
|
+
var result = {};
|
|
8925
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
8926
|
+
__setModuleDefault(result, mod);
|
|
8927
|
+
return result;
|
|
8928
|
+
};
|
|
9129
8929
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9130
8930
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9131
8931
|
};
|
|
9132
8932
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9133
|
-
exports.polyDistance =
|
|
9134
|
-
exports.polyLabel = polyLabel;
|
|
8933
|
+
exports.polyLabel = exports.polyDistance = void 0;
|
|
9135
8934
|
const tinyqueue_1 = __importDefault(__webpack_require__(/*! tinyqueue */ "tinyqueue"));
|
|
9136
8935
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
9137
8936
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
@@ -9206,6 +9005,7 @@ function polyDistance(poly, x, y) {
|
|
|
9206
9005
|
});
|
|
9207
9006
|
return minInside;
|
|
9208
9007
|
}
|
|
9008
|
+
exports.polyDistance = polyDistance;
|
|
9209
9009
|
//
|
|
9210
9010
|
// polyLabel: given polygon, return contained point furthest from any edge, and that distance
|
|
9211
9011
|
//
|
|
@@ -9303,6 +9103,7 @@ function polyLabel(poly, precision, debug) {
|
|
|
9303
9103
|
}
|
|
9304
9104
|
return { x: bestCell.x, y: bestCell.y, d: bestCell.d };
|
|
9305
9105
|
}
|
|
9106
|
+
exports.polyLabel = polyLabel;
|
|
9306
9107
|
function compareMax(a, b) { return b.max - a.max; }
|
|
9307
9108
|
class Cell {
|
|
9308
9109
|
constructor(x, y, h, forEachPointPair) {
|
|
@@ -9389,45 +9190,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
9389
9190
|
}) : function(o, v) {
|
|
9390
9191
|
o["default"] = v;
|
|
9391
9192
|
});
|
|
9392
|
-
var __importStar = (this && this.__importStar) ||
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
return ownKeys(o);
|
|
9400
|
-
};
|
|
9401
|
-
return function (mod) {
|
|
9402
|
-
if (mod && mod.__esModule) return mod;
|
|
9403
|
-
var result = {};
|
|
9404
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
9405
|
-
__setModuleDefault(result, mod);
|
|
9406
|
-
return result;
|
|
9407
|
-
};
|
|
9408
|
-
})();
|
|
9193
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
9194
|
+
if (mod && mod.__esModule) return mod;
|
|
9195
|
+
var result = {};
|
|
9196
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
9197
|
+
__setModuleDefault(result, mod);
|
|
9198
|
+
return result;
|
|
9199
|
+
};
|
|
9409
9200
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9410
|
-
exports.polyPackSize =
|
|
9411
|
-
exports.polyPackEachRing = polyPackEachRing;
|
|
9412
|
-
exports.polyPackEachPoint = polyPackEachPoint;
|
|
9413
|
-
exports.polyPackCountPoints = polyPackCountPoints;
|
|
9414
|
-
exports.polyPacked = polyPacked;
|
|
9415
|
-
exports.normalizeArcs = normalizeArcs;
|
|
9416
|
-
exports.countArcPolygons = countArcPolygons;
|
|
9417
|
-
exports.countArcRings = countArcRings;
|
|
9418
|
-
exports.countOneArcPoints = countOneArcPoints;
|
|
9419
|
-
exports.countArcPoints = countArcPoints;
|
|
9420
|
-
exports.polyPackTopoArcs = polyPackTopoArcs;
|
|
9421
|
-
exports.polyPack = polyPack;
|
|
9422
|
-
exports.polyPackCopy = polyPackCopy;
|
|
9423
|
-
exports.polyUnpack = polyUnpack;
|
|
9424
|
-
exports.featurePackSize = featurePackSize;
|
|
9425
|
-
exports.featurePack = featurePack;
|
|
9426
|
-
exports.featureUnpack = featureUnpack;
|
|
9427
|
-
exports.featureUnpackTemporarily = featureUnpackTemporarily;
|
|
9428
|
-
exports.featureRepack = featureRepack;
|
|
9429
|
-
exports.featurePackString = featurePackString;
|
|
9430
|
-
exports.featureUnpackString = featureUnpackString;
|
|
9201
|
+
exports.featureUnpackString = exports.featurePackString = exports.featureRepack = exports.featureUnpackTemporarily = exports.featureUnpack = exports.featurePack = exports.featurePackSize = exports.polyUnpack = exports.polyPackCopy = exports.polyPack = exports.polyPackTopoArcs = exports.countArcPoints = exports.countOneArcPoints = exports.countArcRings = exports.countArcPolygons = exports.normalizeArcs = exports.polyPacked = exports.polyPackCountPoints = exports.polyPackEachPoint = exports.polyPackEachRing = exports.polyPackSize = void 0;
|
|
9431
9202
|
// Shared libraries
|
|
9432
9203
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
9433
9204
|
function polyPackSize(coords) {
|
|
@@ -9455,6 +9226,7 @@ function polyPackSize(coords) {
|
|
|
9455
9226
|
}
|
|
9456
9227
|
return nFloats;
|
|
9457
9228
|
}
|
|
9229
|
+
exports.polyPackSize = polyPackSize;
|
|
9458
9230
|
function polyPackEachRing(pack, cb) {
|
|
9459
9231
|
if (pack == null || pack.buffer == null)
|
|
9460
9232
|
return;
|
|
@@ -9479,6 +9251,7 @@ function polyPackEachRing(pack, cb) {
|
|
|
9479
9251
|
}
|
|
9480
9252
|
}
|
|
9481
9253
|
}
|
|
9254
|
+
exports.polyPackEachRing = polyPackEachRing;
|
|
9482
9255
|
function polyPackEachPoint(pack, cb) {
|
|
9483
9256
|
polyPackEachRing(pack, (b, iPoly, iRing, iOffset, nPoints) => {
|
|
9484
9257
|
let iEnd = iOffset + (nPoints * 2);
|
|
@@ -9486,11 +9259,13 @@ function polyPackEachPoint(pack, cb) {
|
|
|
9486
9259
|
cb(b, iPoly, iRing, iOffset);
|
|
9487
9260
|
});
|
|
9488
9261
|
}
|
|
9262
|
+
exports.polyPackEachPoint = polyPackEachPoint;
|
|
9489
9263
|
function polyPackCountPoints(pack) {
|
|
9490
9264
|
let n = 0;
|
|
9491
9265
|
polyPackEachRing(pack, (b, iPoly, iRing, iOffset, nPoints) => { n += nPoints; });
|
|
9492
9266
|
return n;
|
|
9493
9267
|
}
|
|
9268
|
+
exports.polyPackCountPoints = polyPackCountPoints;
|
|
9494
9269
|
function polyPacked(f) {
|
|
9495
9270
|
if (f == null)
|
|
9496
9271
|
return false;
|
|
@@ -9502,6 +9277,7 @@ function polyPacked(f) {
|
|
|
9502
9277
|
return polyPacked(f.features[0]);
|
|
9503
9278
|
return false;
|
|
9504
9279
|
}
|
|
9280
|
+
exports.polyPacked = polyPacked;
|
|
9505
9281
|
// Convert to multi-polygon format if necessary
|
|
9506
9282
|
function normalizeArcs(arcs) {
|
|
9507
9283
|
let d = Util.depthof(arcs);
|
|
@@ -9510,10 +9286,12 @@ function normalizeArcs(arcs) {
|
|
|
9510
9286
|
} // note that depth is n-1 compared to coords because leaf is just number, not [x,y]
|
|
9511
9287
|
return arcs;
|
|
9512
9288
|
}
|
|
9289
|
+
exports.normalizeArcs = normalizeArcs;
|
|
9513
9290
|
function countArcPolygons(arcs) {
|
|
9514
9291
|
arcs = normalizeArcs(arcs);
|
|
9515
9292
|
return arcs.length;
|
|
9516
9293
|
}
|
|
9294
|
+
exports.countArcPolygons = countArcPolygons;
|
|
9517
9295
|
function countArcRings(arcs, iPoly) {
|
|
9518
9296
|
arcs = normalizeArcs(arcs);
|
|
9519
9297
|
let r = 0;
|
|
@@ -9521,6 +9299,7 @@ function countArcRings(arcs, iPoly) {
|
|
|
9521
9299
|
r += a.length; });
|
|
9522
9300
|
return r;
|
|
9523
9301
|
}
|
|
9302
|
+
exports.countArcRings = countArcRings;
|
|
9524
9303
|
function countOneArcPoints(topo, ring) {
|
|
9525
9304
|
// for each ring
|
|
9526
9305
|
let n = 0;
|
|
@@ -9535,6 +9314,7 @@ function countOneArcPoints(topo, ring) {
|
|
|
9535
9314
|
n = 4;
|
|
9536
9315
|
return n;
|
|
9537
9316
|
}
|
|
9317
|
+
exports.countOneArcPoints = countOneArcPoints;
|
|
9538
9318
|
function countArcPoints(topo, arcs, iPoly) {
|
|
9539
9319
|
arcs = normalizeArcs(arcs);
|
|
9540
9320
|
let npoints = 0;
|
|
@@ -9544,6 +9324,7 @@ function countArcPoints(topo, arcs, iPoly) {
|
|
|
9544
9324
|
});
|
|
9545
9325
|
return npoints;
|
|
9546
9326
|
}
|
|
9327
|
+
exports.countArcPoints = countArcPoints;
|
|
9547
9328
|
// This packs the TopoJSON arc format into a PolyPack. Basics:
|
|
9548
9329
|
// 1) Negative indices indicate arc should be traversed backward.
|
|
9549
9330
|
// 2) First and last point of sequential arcs are duplicated, so only include one instance. Easiest way
|
|
@@ -9605,6 +9386,7 @@ function polyPackTopoArcs(topo, arcs, iPoly) {
|
|
|
9605
9386
|
});
|
|
9606
9387
|
return prepack;
|
|
9607
9388
|
}
|
|
9389
|
+
exports.polyPackTopoArcs = polyPackTopoArcs;
|
|
9608
9390
|
function polyPack(coords, prepack) {
|
|
9609
9391
|
// Null feature?
|
|
9610
9392
|
if (coords == null || (coords.length !== undefined && coords.length == 0))
|
|
@@ -9669,6 +9451,7 @@ function polyPack(coords, prepack) {
|
|
|
9669
9451
|
}
|
|
9670
9452
|
return prepack;
|
|
9671
9453
|
}
|
|
9454
|
+
exports.polyPack = polyPack;
|
|
9672
9455
|
function polyPackCopy(coords) {
|
|
9673
9456
|
let pp = polyPack(coords);
|
|
9674
9457
|
if (pp == null)
|
|
@@ -9682,6 +9465,7 @@ function polyPackCopy(coords) {
|
|
|
9682
9465
|
afDst[i] = afSrc[i + pp.offset];
|
|
9683
9466
|
return copy;
|
|
9684
9467
|
}
|
|
9468
|
+
exports.polyPackCopy = polyPackCopy;
|
|
9685
9469
|
function polyUnpack(prepack) {
|
|
9686
9470
|
// Check if not packed
|
|
9687
9471
|
if (prepack == null)
|
|
@@ -9710,11 +9494,13 @@ function polyUnpack(prepack) {
|
|
|
9710
9494
|
}
|
|
9711
9495
|
return coords.length > 1 ? coords : coords[0];
|
|
9712
9496
|
}
|
|
9497
|
+
exports.polyUnpack = polyUnpack;
|
|
9713
9498
|
function featurePackSize(f) {
|
|
9714
9499
|
if (f && f.geometry && f.geometry.coordinates && f.geometry.type !== 'Point')
|
|
9715
9500
|
return polyPackSize(f.geometry.coordinates);
|
|
9716
9501
|
return 0;
|
|
9717
9502
|
}
|
|
9503
|
+
exports.featurePackSize = featurePackSize;
|
|
9718
9504
|
function featurePack(f, prepack) {
|
|
9719
9505
|
if (f && f.type === 'Feature') {
|
|
9720
9506
|
if (f.geometry && f.geometry.type === 'Point')
|
|
@@ -9765,6 +9551,7 @@ function featurePack(f, prepack) {
|
|
|
9765
9551
|
}
|
|
9766
9552
|
return null;
|
|
9767
9553
|
}
|
|
9554
|
+
exports.featurePack = featurePack;
|
|
9768
9555
|
function featureUnpack(f) {
|
|
9769
9556
|
if (f && f.geometry && f.geometry.packed !== undefined) {
|
|
9770
9557
|
f.geometry.coordinates = polyUnpack(f.geometry.packed);
|
|
@@ -9786,6 +9573,7 @@ function featureUnpack(f) {
|
|
|
9786
9573
|
}
|
|
9787
9574
|
return f;
|
|
9788
9575
|
}
|
|
9576
|
+
exports.featureUnpack = featureUnpack;
|
|
9789
9577
|
function featureUnpackTemporarily(f, save) {
|
|
9790
9578
|
if (save === undefined)
|
|
9791
9579
|
save = new WeakMap();
|
|
@@ -9804,6 +9592,7 @@ function featureUnpackTemporarily(f, save) {
|
|
|
9804
9592
|
}
|
|
9805
9593
|
return save;
|
|
9806
9594
|
}
|
|
9595
|
+
exports.featureUnpackTemporarily = featureUnpackTemporarily;
|
|
9807
9596
|
function featureRepack(f, save) {
|
|
9808
9597
|
if (f && f.type === 'Feature') {
|
|
9809
9598
|
if (f.geometry) {
|
|
@@ -9819,6 +9608,7 @@ function featureRepack(f, save) {
|
|
|
9819
9608
|
}
|
|
9820
9609
|
return f;
|
|
9821
9610
|
}
|
|
9611
|
+
exports.featureRepack = featureRepack;
|
|
9822
9612
|
function featurePackString(f) {
|
|
9823
9613
|
let packed = f.offset ? f : (f.geometry.packed ? f.geometry.packed : polyPack(f.geometry.coordinates));
|
|
9824
9614
|
let af = packed.buffer;
|
|
@@ -9827,6 +9617,7 @@ function featurePackString(f) {
|
|
|
9827
9617
|
a.push(String(af[i]));
|
|
9828
9618
|
return a.join(' ');
|
|
9829
9619
|
}
|
|
9620
|
+
exports.featurePackString = featurePackString;
|
|
9830
9621
|
function featureUnpackString(s) {
|
|
9831
9622
|
let a = s.split(' ');
|
|
9832
9623
|
let ab = new ArrayBuffer(a.length * 8);
|
|
@@ -9839,6 +9630,7 @@ function featureUnpackString(s) {
|
|
|
9839
9630
|
f.geometry.type = 'MultiPolygon';
|
|
9840
9631
|
return f;
|
|
9841
9632
|
}
|
|
9633
|
+
exports.featureUnpackString = featureUnpackString;
|
|
9842
9634
|
|
|
9843
9635
|
|
|
9844
9636
|
/***/ }),
|
|
@@ -9866,25 +9658,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
9866
9658
|
}) : function(o, v) {
|
|
9867
9659
|
o["default"] = v;
|
|
9868
9660
|
});
|
|
9869
|
-
var __importStar = (this && this.__importStar) ||
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
return ownKeys(o);
|
|
9877
|
-
};
|
|
9878
|
-
return function (mod) {
|
|
9879
|
-
if (mod && mod.__esModule) return mod;
|
|
9880
|
-
var result = {};
|
|
9881
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
9882
|
-
__setModuleDefault(result, mod);
|
|
9883
|
-
return result;
|
|
9884
|
-
};
|
|
9885
|
-
})();
|
|
9661
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
9662
|
+
if (mod && mod.__esModule) return mod;
|
|
9663
|
+
var result = {};
|
|
9664
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
9665
|
+
__setModuleDefault(result, mod);
|
|
9666
|
+
return result;
|
|
9667
|
+
};
|
|
9886
9668
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9887
|
-
exports.polyRound =
|
|
9669
|
+
exports.polyRound = void 0;
|
|
9888
9670
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
9889
9671
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
9890
9672
|
// Round feature geometry to 6 decimal precision
|
|
@@ -9910,6 +9692,7 @@ function polyRound(o) {
|
|
|
9910
9692
|
}
|
|
9911
9693
|
return o;
|
|
9912
9694
|
}
|
|
9695
|
+
exports.polyRound = polyRound;
|
|
9913
9696
|
|
|
9914
9697
|
|
|
9915
9698
|
/***/ }),
|
|
@@ -9937,25 +9720,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
9937
9720
|
}) : function(o, v) {
|
|
9938
9721
|
o["default"] = v;
|
|
9939
9722
|
});
|
|
9940
|
-
var __importStar = (this && this.__importStar) ||
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
return ownKeys(o);
|
|
9948
|
-
};
|
|
9949
|
-
return function (mod) {
|
|
9950
|
-
if (mod && mod.__esModule) return mod;
|
|
9951
|
-
var result = {};
|
|
9952
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
9953
|
-
__setModuleDefault(result, mod);
|
|
9954
|
-
return result;
|
|
9955
|
-
};
|
|
9956
|
-
})();
|
|
9723
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
9724
|
+
if (mod && mod.__esModule) return mod;
|
|
9725
|
+
var result = {};
|
|
9726
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
9727
|
+
__setModuleDefault(result, mod);
|
|
9728
|
+
return result;
|
|
9729
|
+
};
|
|
9957
9730
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9958
|
-
exports.polySimplify =
|
|
9731
|
+
exports.polySimplify = void 0;
|
|
9959
9732
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
9960
9733
|
const simplify_1 = __webpack_require__(/*! ./simplify */ "./lib/poly/simplify.ts");
|
|
9961
9734
|
function polySimplify(poly, tolerance = 0.0001) {
|
|
@@ -9976,6 +9749,7 @@ function polySimplify(poly, tolerance = 0.0001) {
|
|
|
9976
9749
|
p[j] = (0, simplify_1.simplify)(p[j], tolerance, true);
|
|
9977
9750
|
}
|
|
9978
9751
|
}
|
|
9752
|
+
exports.polySimplify = polySimplify;
|
|
9979
9753
|
|
|
9980
9754
|
|
|
9981
9755
|
/***/ }),
|
|
@@ -10003,26 +9777,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
10003
9777
|
}) : function(o, v) {
|
|
10004
9778
|
o["default"] = v;
|
|
10005
9779
|
});
|
|
10006
|
-
var __importStar = (this && this.__importStar) ||
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
return ownKeys(o);
|
|
10014
|
-
};
|
|
10015
|
-
return function (mod) {
|
|
10016
|
-
if (mod && mod.__esModule) return mod;
|
|
10017
|
-
var result = {};
|
|
10018
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10019
|
-
__setModuleDefault(result, mod);
|
|
10020
|
-
return result;
|
|
10021
|
-
};
|
|
10022
|
-
})();
|
|
9780
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
9781
|
+
if (mod && mod.__esModule) return mod;
|
|
9782
|
+
var result = {};
|
|
9783
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
9784
|
+
__setModuleDefault(result, mod);
|
|
9785
|
+
return result;
|
|
9786
|
+
};
|
|
10023
9787
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10024
|
-
exports.FsmQuadTree = exports.DefaultQuadOptions = void 0;
|
|
10025
|
-
exports.unionPolys = unionPolys;
|
|
9788
|
+
exports.FsmQuadTree = exports.DefaultQuadOptions = exports.unionPolys = void 0;
|
|
10026
9789
|
// Public libraries
|
|
10027
9790
|
const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
|
|
10028
9791
|
// Shared libraries
|
|
@@ -10068,6 +9831,7 @@ function unionPolys(polys) {
|
|
|
10068
9831
|
let poly = cleanPolys.pop();
|
|
10069
9832
|
return PR.polyRound(_union(poly, ...cleanPolys));
|
|
10070
9833
|
}
|
|
9834
|
+
exports.unionPolys = unionPolys;
|
|
10071
9835
|
exports.DefaultQuadOptions = { maxLeafCount: 20, maxDepth: 20, tickStep: 1 };
|
|
10072
9836
|
;
|
|
10073
9837
|
// Use geo orientation for t/b (that is, t > b)
|
|
@@ -10249,25 +10013,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
10249
10013
|
}) : function(o, v) {
|
|
10250
10014
|
o["default"] = v;
|
|
10251
10015
|
});
|
|
10252
|
-
var __importStar = (this && this.__importStar) ||
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
return ownKeys(o);
|
|
10260
|
-
};
|
|
10261
|
-
return function (mod) {
|
|
10262
|
-
if (mod && mod.__esModule) return mod;
|
|
10263
|
-
var result = {};
|
|
10264
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10265
|
-
__setModuleDefault(result, mod);
|
|
10266
|
-
return result;
|
|
10267
|
-
};
|
|
10268
|
-
})();
|
|
10016
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
10017
|
+
if (mod && mod.__esModule) return mod;
|
|
10018
|
+
var result = {};
|
|
10019
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
10020
|
+
__setModuleDefault(result, mod);
|
|
10021
|
+
return result;
|
|
10022
|
+
};
|
|
10269
10023
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10270
|
-
exports.selfIntersect =
|
|
10024
|
+
exports.selfIntersect = void 0;
|
|
10271
10025
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
10272
10026
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
10273
10027
|
// Given three colinear points p, q, r, the function checks if
|
|
@@ -10342,6 +10096,7 @@ function selfIntersect(poly) {
|
|
|
10342
10096
|
});
|
|
10343
10097
|
return bIntersect;
|
|
10344
10098
|
}
|
|
10099
|
+
exports.selfIntersect = selfIntersect;
|
|
10345
10100
|
|
|
10346
10101
|
|
|
10347
10102
|
/***/ }),
|
|
@@ -10369,28 +10124,18 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
10369
10124
|
}) : function(o, v) {
|
|
10370
10125
|
o["default"] = v;
|
|
10371
10126
|
});
|
|
10372
|
-
var __importStar = (this && this.__importStar) ||
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
return ownKeys(o);
|
|
10380
|
-
};
|
|
10381
|
-
return function (mod) {
|
|
10382
|
-
if (mod && mod.__esModule) return mod;
|
|
10383
|
-
var result = {};
|
|
10384
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10385
|
-
__setModuleDefault(result, mod);
|
|
10386
|
-
return result;
|
|
10387
|
-
};
|
|
10388
|
-
})();
|
|
10127
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
10128
|
+
if (mod && mod.__esModule) return mod;
|
|
10129
|
+
var result = {};
|
|
10130
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
10131
|
+
__setModuleDefault(result, mod);
|
|
10132
|
+
return result;
|
|
10133
|
+
};
|
|
10389
10134
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10390
10135
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10391
10136
|
};
|
|
10392
10137
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10393
|
-
exports.selfIntersectFast =
|
|
10138
|
+
exports.selfIntersectFast = void 0;
|
|
10394
10139
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
10395
10140
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
10396
10141
|
// Adapted from rowanwins/shamos-hoey
|
|
@@ -10615,6 +10360,7 @@ function selfIntersectFast(poly) {
|
|
|
10615
10360
|
});
|
|
10616
10361
|
return runCheck(eventQueue);
|
|
10617
10362
|
}
|
|
10363
|
+
exports.selfIntersectFast = selfIntersectFast;
|
|
10618
10364
|
|
|
10619
10365
|
|
|
10620
10366
|
/***/ }),
|
|
@@ -10633,7 +10379,7 @@ function selfIntersectFast(poly) {
|
|
|
10633
10379
|
mourner.github.io/simplify-js
|
|
10634
10380
|
*/
|
|
10635
10381
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10636
|
-
exports.simplify =
|
|
10382
|
+
exports.simplify = void 0;
|
|
10637
10383
|
// square distance between 2 points
|
|
10638
10384
|
function getSqDist(p1, p2) {
|
|
10639
10385
|
var dx = p1[0] - p2[0], dy = p1[1] - p2[1];
|
|
@@ -10706,6 +10452,7 @@ function simplify(points, tolerance = 1, highestQuality = false) {
|
|
|
10706
10452
|
points = simplifyDouglasPeucker(points, sqTolerance);
|
|
10707
10453
|
return points;
|
|
10708
10454
|
}
|
|
10455
|
+
exports.simplify = simplify;
|
|
10709
10456
|
|
|
10710
10457
|
|
|
10711
10458
|
/***/ }),
|
|
@@ -10733,36 +10480,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
10733
10480
|
}) : function(o, v) {
|
|
10734
10481
|
o["default"] = v;
|
|
10735
10482
|
});
|
|
10736
|
-
var __importStar = (this && this.__importStar) ||
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
return ownKeys(o);
|
|
10744
|
-
};
|
|
10745
|
-
return function (mod) {
|
|
10746
|
-
if (mod && mod.__esModule) return mod;
|
|
10747
|
-
var result = {};
|
|
10748
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
10749
|
-
__setModuleDefault(result, mod);
|
|
10750
|
-
return result;
|
|
10751
|
-
};
|
|
10752
|
-
})();
|
|
10483
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
10484
|
+
if (mod && mod.__esModule) return mod;
|
|
10485
|
+
var result = {};
|
|
10486
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
10487
|
+
__setModuleDefault(result, mod);
|
|
10488
|
+
return result;
|
|
10489
|
+
};
|
|
10753
10490
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10754
|
-
exports.FsmTopoUnion = void 0;
|
|
10755
|
-
exports.topoFromCollection = topoFromCollection;
|
|
10756
|
-
exports.topoContiguity = topoContiguity;
|
|
10757
|
-
exports.topoToFeature = topoToFeature;
|
|
10758
|
-
exports.topoSplice = topoSplice;
|
|
10759
|
-
exports.topoToCollection = topoToCollection;
|
|
10760
|
-
exports.topoSimplifyCollection = topoSimplifyCollection;
|
|
10761
|
-
exports.topoMerge = topoMerge;
|
|
10762
|
-
exports.topoMergeFeatures = topoMergeFeatures;
|
|
10763
|
-
exports.topoPacked = topoPacked;
|
|
10764
|
-
exports.topoPack = topoPack;
|
|
10765
|
-
exports.topoUnpack = topoUnpack;
|
|
10491
|
+
exports.topoUnpack = exports.topoPack = exports.topoPacked = exports.FsmTopoUnion = exports.topoMergeFeatures = exports.topoMerge = exports.topoSimplifyCollection = exports.topoToCollection = exports.topoSplice = exports.topoToFeature = exports.topoContiguity = exports.topoFromCollection = void 0;
|
|
10766
10492
|
// Forked version that supports packing
|
|
10767
10493
|
const TopoClient = __importStar(__webpack_require__(/*! @dra2020/topojson-client */ "@dra2020/topojson-client"));
|
|
10768
10494
|
// Forked version that fixes self-looping hole problem
|
|
@@ -10807,6 +10533,7 @@ function topoFromCollection(col) {
|
|
|
10807
10533
|
topo.datasets = col.datasets;
|
|
10808
10534
|
return topo;
|
|
10809
10535
|
}
|
|
10536
|
+
exports.topoFromCollection = topoFromCollection;
|
|
10810
10537
|
function ringsCancel(outerPoly, innerRing) {
|
|
10811
10538
|
if (outerPoly.length != 1)
|
|
10812
10539
|
return false;
|
|
@@ -10842,14 +10569,17 @@ function topoContiguity(topo) {
|
|
|
10842
10569
|
});
|
|
10843
10570
|
return result;
|
|
10844
10571
|
}
|
|
10572
|
+
exports.topoContiguity = topoContiguity;
|
|
10845
10573
|
function topoToFeature(topo, geoid) {
|
|
10846
10574
|
return correctGeometry(TopoClient.feature(topo, topo.objects[geoid]));
|
|
10847
10575
|
}
|
|
10576
|
+
exports.topoToFeature = topoToFeature;
|
|
10848
10577
|
function topoSplice(topoarray) {
|
|
10849
10578
|
if (topoarray)
|
|
10850
10579
|
topoarray.forEach(e => topoPack(e.topology));
|
|
10851
10580
|
return TopoClient.splice(topoarray);
|
|
10852
10581
|
}
|
|
10582
|
+
exports.topoSplice = topoSplice;
|
|
10853
10583
|
function topoToCollection(topo) {
|
|
10854
10584
|
let col = { type: 'FeatureCollection', features: [] };
|
|
10855
10585
|
if (topo)
|
|
@@ -10860,6 +10590,7 @@ function topoToCollection(topo) {
|
|
|
10860
10590
|
col.datasets = topo.datasets;
|
|
10861
10591
|
return col;
|
|
10862
10592
|
}
|
|
10593
|
+
exports.topoToCollection = topoToCollection;
|
|
10863
10594
|
function keepArcs(topo, arcs, keepweight) {
|
|
10864
10595
|
arcs.forEach((a) => {
|
|
10865
10596
|
if (Array.isArray(a))
|
|
@@ -11050,6 +10781,7 @@ function topoSimplifyCollection(col, options) {
|
|
|
11050
10781
|
log(options.log, `topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
|
|
11051
10782
|
return col;
|
|
11052
10783
|
}
|
|
10784
|
+
exports.topoSimplifyCollection = topoSimplifyCollection;
|
|
11053
10785
|
function topoMerge(topo, geoids) {
|
|
11054
10786
|
if (geoids == null || geoids.length == 0)
|
|
11055
10787
|
return null;
|
|
@@ -11057,12 +10789,14 @@ function topoMerge(topo, geoids) {
|
|
|
11057
10789
|
geoids.forEach((geoid) => objects.push(topo.objects[geoid]));
|
|
11058
10790
|
return correctGeometry({ type: 'Feature', properties: {}, geometry: TopoClient.merge(topo, objects) });
|
|
11059
10791
|
}
|
|
10792
|
+
exports.topoMerge = topoMerge;
|
|
11060
10793
|
function topoMergeFeatures(topo, features) {
|
|
11061
10794
|
if (features == null || features.length == 0)
|
|
11062
10795
|
return null;
|
|
11063
10796
|
let prop = getGEOID(features);
|
|
11064
10797
|
return topoMerge(topo, features.map(f => f.properties[prop]));
|
|
11065
10798
|
}
|
|
10799
|
+
exports.topoMergeFeatures = topoMergeFeatures;
|
|
11066
10800
|
let UniqueState = FSM.FSM_CUSTOM1;
|
|
11067
10801
|
let FSM_COMPUTING = UniqueState++;
|
|
11068
10802
|
class FsmIncrementalUnion extends FSM.Fsm {
|
|
@@ -11170,17 +10904,20 @@ exports.FsmTopoUnion = FsmTopoUnion;
|
|
|
11170
10904
|
function topoPacked(topo) {
|
|
11171
10905
|
return topo.packed !== undefined;
|
|
11172
10906
|
}
|
|
10907
|
+
exports.topoPacked = topoPacked;
|
|
11173
10908
|
function topoPack(topo) {
|
|
11174
10909
|
let tc = TopoClient;
|
|
11175
10910
|
TopoClient.packArcs(topo);
|
|
11176
10911
|
TopoClient.packArcIndices(topo);
|
|
11177
10912
|
return topo;
|
|
11178
10913
|
}
|
|
10914
|
+
exports.topoPack = topoPack;
|
|
11179
10915
|
function topoUnpack(topo) {
|
|
11180
10916
|
TopoClient.unpackArcs(topo);
|
|
11181
10917
|
TopoClient.unpackArcIndices(topo);
|
|
11182
10918
|
return topo;
|
|
11183
10919
|
}
|
|
10920
|
+
exports.topoUnpack = topoUnpack;
|
|
11184
10921
|
|
|
11185
10922
|
|
|
11186
10923
|
/***/ }),
|
|
@@ -11208,28 +10945,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11208
10945
|
}) : function(o, v) {
|
|
11209
10946
|
o["default"] = v;
|
|
11210
10947
|
});
|
|
11211
|
-
var __importStar = (this && this.__importStar) ||
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
return ownKeys(o);
|
|
11219
|
-
};
|
|
11220
|
-
return function (mod) {
|
|
11221
|
-
if (mod && mod.__esModule) return mod;
|
|
11222
|
-
var result = {};
|
|
11223
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
11224
|
-
__setModuleDefault(result, mod);
|
|
11225
|
-
return result;
|
|
11226
|
-
};
|
|
11227
|
-
})();
|
|
10948
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
10949
|
+
if (mod && mod.__esModule) return mod;
|
|
10950
|
+
var result = {};
|
|
10951
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
10952
|
+
__setModuleDefault(result, mod);
|
|
10953
|
+
return result;
|
|
10954
|
+
};
|
|
11228
10955
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11229
|
-
exports.FsmUnion = void 0;
|
|
11230
|
-
exports.polyIntersects = polyIntersects;
|
|
11231
|
-
exports.polyIntersectArea = polyIntersectArea;
|
|
11232
|
-
exports.polyDifference = polyDifference;
|
|
10956
|
+
exports.FsmUnion = exports.polyDifference = exports.polyIntersectArea = exports.polyIntersects = void 0;
|
|
11233
10957
|
const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
|
|
11234
10958
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
11235
10959
|
const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
|
|
@@ -11287,6 +11011,7 @@ function polyIntersects(p1, p2) {
|
|
|
11287
11011
|
});
|
|
11288
11012
|
return bIntersects;
|
|
11289
11013
|
}
|
|
11014
|
+
exports.polyIntersects = polyIntersects;
|
|
11290
11015
|
function polyIntersectArea(p1, p2) {
|
|
11291
11016
|
let pp1 = Poly.polyNormalize(p1);
|
|
11292
11017
|
let pp2 = Poly.polyNormalize(p2);
|
|
@@ -11302,6 +11027,7 @@ function polyIntersectArea(p1, p2) {
|
|
|
11302
11027
|
});
|
|
11303
11028
|
return area;
|
|
11304
11029
|
}
|
|
11030
|
+
exports.polyIntersectArea = polyIntersectArea;
|
|
11305
11031
|
function polyDifference(main, parts) {
|
|
11306
11032
|
main = PP.polyUnpack(coords(main));
|
|
11307
11033
|
// need to explode multipolygon so that "exploded" is a valid multipolygon input to underlying difference routine
|
|
@@ -11315,6 +11041,7 @@ function polyDifference(main, parts) {
|
|
|
11315
11041
|
});
|
|
11316
11042
|
return PR.polyRound(_difference(main, exploded));
|
|
11317
11043
|
}
|
|
11044
|
+
exports.polyDifference = polyDifference;
|
|
11318
11045
|
class FsmDifference extends FSM.Fsm {
|
|
11319
11046
|
constructor(env, accum, polys) {
|
|
11320
11047
|
super(env);
|
|
@@ -11601,27 +11328,15 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11601
11328
|
}) : function(o, v) {
|
|
11602
11329
|
o["default"] = v;
|
|
11603
11330
|
});
|
|
11604
|
-
var __importStar = (this && this.__importStar) ||
|
|
11605
|
-
|
|
11606
|
-
|
|
11607
|
-
|
|
11608
|
-
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
return ownKeys(o);
|
|
11612
|
-
};
|
|
11613
|
-
return function (mod) {
|
|
11614
|
-
if (mod && mod.__esModule) return mod;
|
|
11615
|
-
var result = {};
|
|
11616
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
11617
|
-
__setModuleDefault(result, mod);
|
|
11618
|
-
return result;
|
|
11619
|
-
};
|
|
11620
|
-
})();
|
|
11331
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
11332
|
+
if (mod && mod.__esModule) return mod;
|
|
11333
|
+
var result = {};
|
|
11334
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
11335
|
+
__setModuleDefault(result, mod);
|
|
11336
|
+
return result;
|
|
11337
|
+
};
|
|
11621
11338
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11622
|
-
exports.BinTrieBuilder = exports.BinTrie = void 0;
|
|
11623
|
-
exports.s2u8 = s2u8;
|
|
11624
|
-
exports.u82s = u82s;
|
|
11339
|
+
exports.BinTrieBuilder = exports.BinTrie = exports.u82s = exports.s2u8 = void 0;
|
|
11625
11340
|
const U = __importStar(__webpack_require__(/*! ./util */ "./lib/util/util.ts"));
|
|
11626
11341
|
/*
|
|
11627
11342
|
-- For Node
|
|
@@ -11635,9 +11350,11 @@ const MaxKeyLength = 128;
|
|
|
11635
11350
|
function s2u8(coder, s) {
|
|
11636
11351
|
return coder.encoder.encode(s);
|
|
11637
11352
|
}
|
|
11353
|
+
exports.s2u8 = s2u8;
|
|
11638
11354
|
function u82s(coder, u8, offset, n) {
|
|
11639
11355
|
return coder.decoder.decode(u8.subarray(offset, offset + n));
|
|
11640
11356
|
}
|
|
11357
|
+
exports.u82s = u82s;
|
|
11641
11358
|
const NullFragment = { count: 0, used: 0, offset: 0, s: '' };
|
|
11642
11359
|
function sortBestPair(p1, p2) {
|
|
11643
11360
|
let d = (p1.f1.count + p1.f2.count) - (p2.f1.count + p2.f2.count);
|
|
@@ -12223,9 +11940,7 @@ exports.CountedHash = CountedHash;
|
|
|
12223
11940
|
|
|
12224
11941
|
|
|
12225
11942
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12226
|
-
exports.execGradient =
|
|
12227
|
-
exports.parseGradient = parseGradient;
|
|
12228
|
-
exports.asCSSGradient = asCSSGradient;
|
|
11943
|
+
exports.asCSSGradient = exports.parseGradient = exports.execGradient = void 0;
|
|
12229
11944
|
function parseStops(stops) {
|
|
12230
11945
|
if (stops[0].rgb)
|
|
12231
11946
|
return;
|
|
@@ -12262,6 +11977,7 @@ function execGradient(stops, value) {
|
|
|
12262
11977
|
}
|
|
12263
11978
|
return toHexColor(r, g, b);
|
|
12264
11979
|
}
|
|
11980
|
+
exports.execGradient = execGradient;
|
|
12265
11981
|
function parseGradient(sStops) {
|
|
12266
11982
|
let stops = [];
|
|
12267
11983
|
let re = / ?([^ ]+) ([^ ,]+%?),?(.*)/;
|
|
@@ -12288,6 +12004,7 @@ function parseGradient(sStops) {
|
|
|
12288
12004
|
}
|
|
12289
12005
|
return stops;
|
|
12290
12006
|
}
|
|
12007
|
+
exports.parseGradient = parseGradient;
|
|
12291
12008
|
function asCSSGradient(stops) {
|
|
12292
12009
|
parseStops(stops);
|
|
12293
12010
|
let a = [];
|
|
@@ -12297,6 +12014,7 @@ function asCSSGradient(stops) {
|
|
|
12297
12014
|
});
|
|
12298
12015
|
return `linear-gradient(to right, ${a.join(', ')})`;
|
|
12299
12016
|
}
|
|
12017
|
+
exports.asCSSGradient = asCSSGradient;
|
|
12300
12018
|
|
|
12301
12019
|
|
|
12302
12020
|
/***/ }),
|
|
@@ -12378,46 +12096,9 @@ exports.IndexedArray = IndexedArray;
|
|
|
12378
12096
|
|
|
12379
12097
|
|
|
12380
12098
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12381
|
-
exports.Deadline = exports.MultiTimer = exports.Elapsed = void 0;
|
|
12382
|
-
exports.Now = Now;
|
|
12383
|
-
exports.createGuid = createGuid;
|
|
12384
|
-
exports.isGuid = isGuid;
|
|
12385
|
-
exports.createKeyedGuid = createKeyedGuid;
|
|
12386
|
-
exports.guidKey = guidKey;
|
|
12387
|
-
exports.sizeof = sizeof;
|
|
12388
|
-
exports.depthof = depthof;
|
|
12389
|
-
exports.isEmpty = isEmpty;
|
|
12390
|
-
exports.countKeys = countKeys;
|
|
12391
|
-
exports.nthProperty = nthProperty;
|
|
12392
|
-
exports.nthKey = nthKey;
|
|
12393
|
-
exports.partialEqual = partialEqual;
|
|
12394
|
-
exports.deepEqual = deepEqual;
|
|
12395
|
-
exports.prettyDate = prettyDate;
|
|
12396
|
-
exports.relativeDate = relativeDate;
|
|
12397
|
-
exports.recentDate = recentDate;
|
|
12398
|
-
exports.textToHtml = textToHtml;
|
|
12399
|
-
exports.shallowCopy = shallowCopy;
|
|
12400
|
-
exports.shallowAssign = shallowAssign;
|
|
12401
|
-
exports.shallowDelete = shallowDelete;
|
|
12402
|
-
exports.shallowAssignImmutable = shallowAssignImmutable;
|
|
12403
|
-
exports.shallowEqual = shallowEqual;
|
|
12404
|
-
exports.deepCopy = deepCopy;
|
|
12405
|
-
exports.deepAccum = deepAccum;
|
|
12406
|
-
exports.precisionRound = precisionRound;
|
|
12407
|
-
exports.percentString = percentString;
|
|
12408
|
-
exports.hash = hash;
|
|
12409
|
-
exports.hashObject = hashObject;
|
|
12410
|
-
exports.toHex = toHex;
|
|
12411
|
-
exports.toRGBA = toRGBA;
|
|
12412
|
-
exports.toRGBAIntensity = toRGBAIntensity;
|
|
12413
|
-
exports.distance = distance;
|
|
12414
|
-
exports.deg2rad = deg2rad;
|
|
12415
|
-
exports.rad2deg = rad2deg;
|
|
12416
|
-
exports.wrapLon = wrapLon;
|
|
12417
|
-
exports.isNumber = isNumber;
|
|
12418
|
-
exports.toNumber = toNumber;
|
|
12419
|
-
exports.toSafeNumber = toSafeNumber;
|
|
12099
|
+
exports.toSafeNumber = exports.toNumber = exports.isNumber = exports.wrapLon = exports.rad2deg = exports.deg2rad = exports.distance = exports.toRGBAIntensity = exports.toRGBA = exports.toHex = exports.hashObject = exports.hash = exports.percentString = exports.precisionRound = exports.deepAccum = exports.deepCopy = exports.shallowEqual = exports.shallowAssignImmutable = exports.shallowDelete = exports.shallowAssign = exports.shallowCopy = exports.textToHtml = exports.recentDate = exports.relativeDate = exports.prettyDate = exports.deepEqual = exports.partialEqual = exports.nthKey = exports.nthProperty = exports.countKeys = exports.isEmpty = exports.depthof = exports.sizeof = exports.guidKey = exports.createKeyedGuid = exports.isGuid = exports.createGuid = exports.Deadline = exports.MultiTimer = exports.Elapsed = exports.Now = void 0;
|
|
12420
12100
|
function Now() { return (new Date()).toJSON(); }
|
|
12101
|
+
exports.Now = Now;
|
|
12421
12102
|
// polyfill
|
|
12422
12103
|
let hrtime = global && global.process && global.process.hrtime ? global.process.hrtime : null;
|
|
12423
12104
|
class Elapsed {
|
|
@@ -12513,19 +12194,23 @@ function createGuid() {
|
|
|
12513
12194
|
return v.toString(16);
|
|
12514
12195
|
});
|
|
12515
12196
|
}
|
|
12197
|
+
exports.createGuid = createGuid;
|
|
12516
12198
|
const reGuid = /.*-.*-.*-.*-/;
|
|
12517
12199
|
function isGuid(s) {
|
|
12518
12200
|
return reGuid.test(s) && s.length >= 36;
|
|
12519
12201
|
}
|
|
12202
|
+
exports.isGuid = isGuid;
|
|
12520
12203
|
function createKeyedGuid(key) {
|
|
12521
12204
|
return `xxxxxxxx-xxxx-${key}xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g, function (c) {
|
|
12522
12205
|
var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
|
|
12523
12206
|
return v.toString(16);
|
|
12524
12207
|
});
|
|
12525
12208
|
}
|
|
12209
|
+
exports.createKeyedGuid = createKeyedGuid;
|
|
12526
12210
|
function guidKey(guid) {
|
|
12527
12211
|
return guid.substr(14, 1); // See above
|
|
12528
12212
|
}
|
|
12213
|
+
exports.guidKey = guidKey;
|
|
12529
12214
|
function _sizeof(a, loops) {
|
|
12530
12215
|
if (a === null || a === undefined)
|
|
12531
12216
|
return 0;
|
|
@@ -12568,6 +12253,7 @@ function sizeof(a) {
|
|
|
12568
12253
|
let n = _sizeof(a, loops);
|
|
12569
12254
|
return n;
|
|
12570
12255
|
}
|
|
12256
|
+
exports.sizeof = sizeof;
|
|
12571
12257
|
function depthof(a) {
|
|
12572
12258
|
if (a === null || a === undefined)
|
|
12573
12259
|
return 1;
|
|
@@ -12594,6 +12280,7 @@ function depthof(a) {
|
|
|
12594
12280
|
}
|
|
12595
12281
|
}
|
|
12596
12282
|
}
|
|
12283
|
+
exports.depthof = depthof;
|
|
12597
12284
|
function isEmpty(o) {
|
|
12598
12285
|
if (o === null || o === undefined)
|
|
12599
12286
|
return true;
|
|
@@ -12602,6 +12289,7 @@ function isEmpty(o) {
|
|
|
12602
12289
|
return false;
|
|
12603
12290
|
return true;
|
|
12604
12291
|
}
|
|
12292
|
+
exports.isEmpty = isEmpty;
|
|
12605
12293
|
function countKeys(o) {
|
|
12606
12294
|
if (o === undefined || typeof o !== 'object')
|
|
12607
12295
|
return -1;
|
|
@@ -12611,6 +12299,7 @@ function countKeys(o) {
|
|
|
12611
12299
|
count++;
|
|
12612
12300
|
return count;
|
|
12613
12301
|
}
|
|
12302
|
+
exports.countKeys = countKeys;
|
|
12614
12303
|
function nthProperty(o, n = 0) {
|
|
12615
12304
|
for (let p in o)
|
|
12616
12305
|
if (o.hasOwnProperty(p)) {
|
|
@@ -12620,6 +12309,7 @@ function nthProperty(o, n = 0) {
|
|
|
12620
12309
|
}
|
|
12621
12310
|
return undefined;
|
|
12622
12311
|
}
|
|
12312
|
+
exports.nthProperty = nthProperty;
|
|
12623
12313
|
function nthKey(o, n = 0) {
|
|
12624
12314
|
for (let p in o)
|
|
12625
12315
|
if (o.hasOwnProperty(p)) {
|
|
@@ -12629,6 +12319,7 @@ function nthKey(o, n = 0) {
|
|
|
12629
12319
|
}
|
|
12630
12320
|
return undefined;
|
|
12631
12321
|
}
|
|
12322
|
+
exports.nthKey = nthKey;
|
|
12632
12323
|
function partialEqual(o, subset) {
|
|
12633
12324
|
for (let p in subset)
|
|
12634
12325
|
if (subset.hasOwnProperty(p))
|
|
@@ -12636,6 +12327,7 @@ function partialEqual(o, subset) {
|
|
|
12636
12327
|
return false;
|
|
12637
12328
|
return true;
|
|
12638
12329
|
}
|
|
12330
|
+
exports.partialEqual = partialEqual;
|
|
12639
12331
|
function exactEqual(o1, o2, options) {
|
|
12640
12332
|
if (o1 === o2)
|
|
12641
12333
|
return true;
|
|
@@ -12695,6 +12387,7 @@ function deepEqual(o1, o2, options) {
|
|
|
12695
12387
|
}
|
|
12696
12388
|
return true;
|
|
12697
12389
|
}
|
|
12390
|
+
exports.deepEqual = deepEqual;
|
|
12698
12391
|
const Months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
12699
12392
|
function prettyDate(d) {
|
|
12700
12393
|
if (d == null)
|
|
@@ -12710,6 +12403,7 @@ function prettyDate(d) {
|
|
|
12710
12403
|
hh -= 12;
|
|
12711
12404
|
return `${mmm} ${dd}, ${yyyy} at ${hh}:${mm} ${ampm}`;
|
|
12712
12405
|
}
|
|
12406
|
+
exports.prettyDate = prettyDate;
|
|
12713
12407
|
function relativeDate(d) {
|
|
12714
12408
|
if (d == null)
|
|
12715
12409
|
return 'unknown';
|
|
@@ -12733,6 +12427,7 @@ function relativeDate(d) {
|
|
|
12733
12427
|
else
|
|
12734
12428
|
return `${mmm} ${dd}, ${yyyy}`;
|
|
12735
12429
|
}
|
|
12430
|
+
exports.relativeDate = relativeDate;
|
|
12736
12431
|
const OneMinute = 1000 * 60;
|
|
12737
12432
|
const OneHour = OneMinute * 60;
|
|
12738
12433
|
const OneDay = OneHour * 24;
|
|
@@ -12753,6 +12448,7 @@ function recentDate(d) {
|
|
|
12753
12448
|
else
|
|
12754
12449
|
return relativeDate(d);
|
|
12755
12450
|
}
|
|
12451
|
+
exports.recentDate = recentDate;
|
|
12756
12452
|
function textToHtml(sText) {
|
|
12757
12453
|
let lines = sText.split('\n');
|
|
12758
12454
|
let aHtml = [];
|
|
@@ -12786,6 +12482,7 @@ function textToHtml(sText) {
|
|
|
12786
12482
|
aHtml.push('</body>');
|
|
12787
12483
|
return aHtml.join('');
|
|
12788
12484
|
}
|
|
12485
|
+
exports.textToHtml = textToHtml;
|
|
12789
12486
|
function shallowCopy(src) {
|
|
12790
12487
|
if (src === null || src === undefined)
|
|
12791
12488
|
return src;
|
|
@@ -12809,6 +12506,7 @@ function shallowCopy(src) {
|
|
|
12809
12506
|
}
|
|
12810
12507
|
}
|
|
12811
12508
|
}
|
|
12509
|
+
exports.shallowCopy = shallowCopy;
|
|
12812
12510
|
function shallowAssign(o1, o2) {
|
|
12813
12511
|
if (o1 === null || o1 === undefined)
|
|
12814
12512
|
o1 = {};
|
|
@@ -12821,6 +12519,7 @@ function shallowAssign(o1, o2) {
|
|
|
12821
12519
|
o1[p] = o2[p];
|
|
12822
12520
|
return o1;
|
|
12823
12521
|
}
|
|
12522
|
+
exports.shallowAssign = shallowAssign;
|
|
12824
12523
|
function shallowDelete(o1, o2) {
|
|
12825
12524
|
if (o1 == null || o2 == null)
|
|
12826
12525
|
return o1;
|
|
@@ -12831,6 +12530,7 @@ function shallowDelete(o1, o2) {
|
|
|
12831
12530
|
delete o1[p];
|
|
12832
12531
|
return o1;
|
|
12833
12532
|
}
|
|
12533
|
+
exports.shallowDelete = shallowDelete;
|
|
12834
12534
|
function shallowAssignImmutable(o1, o2) {
|
|
12835
12535
|
if (o1 === null || o1 === undefined)
|
|
12836
12536
|
o1 = {};
|
|
@@ -12851,6 +12551,7 @@ function shallowAssignImmutable(o1, o2) {
|
|
|
12851
12551
|
shallowAssign(oNew, o2);
|
|
12852
12552
|
return oNew;
|
|
12853
12553
|
}
|
|
12554
|
+
exports.shallowAssignImmutable = shallowAssignImmutable;
|
|
12854
12555
|
function shallowEqual(o1, o2) {
|
|
12855
12556
|
if (o1 === undefined || o2 === undefined || typeof o1 !== 'object' || typeof o2 !== 'object')
|
|
12856
12557
|
return o1 === o2;
|
|
@@ -12875,6 +12576,7 @@ function shallowEqual(o1, o2) {
|
|
|
12875
12576
|
return true;
|
|
12876
12577
|
}
|
|
12877
12578
|
}
|
|
12579
|
+
exports.shallowEqual = shallowEqual;
|
|
12878
12580
|
function deepCopy(src) {
|
|
12879
12581
|
// Beware typeof oddities
|
|
12880
12582
|
if (src === null || src === undefined)
|
|
@@ -12899,6 +12601,7 @@ function deepCopy(src) {
|
|
|
12899
12601
|
else
|
|
12900
12602
|
return src;
|
|
12901
12603
|
}
|
|
12604
|
+
exports.deepCopy = deepCopy;
|
|
12902
12605
|
function deepAccum(accum, o) {
|
|
12903
12606
|
if (accum == null)
|
|
12904
12607
|
accum = {};
|
|
@@ -12933,16 +12636,19 @@ function deepAccum(accum, o) {
|
|
|
12933
12636
|
}
|
|
12934
12637
|
return accum;
|
|
12935
12638
|
}
|
|
12639
|
+
exports.deepAccum = deepAccum;
|
|
12936
12640
|
function precisionRound(n, p) {
|
|
12937
12641
|
let f = Math.pow(10, p);
|
|
12938
12642
|
return Math.round(n * f) / f;
|
|
12939
12643
|
}
|
|
12644
|
+
exports.precisionRound = precisionRound;
|
|
12940
12645
|
function percentString(num, den, precision = 0) {
|
|
12941
12646
|
if (den == 0)
|
|
12942
12647
|
return '(-)';
|
|
12943
12648
|
let p = precisionRound((num / den) * 100, precision);
|
|
12944
12649
|
return String(p) + '%';
|
|
12945
12650
|
}
|
|
12651
|
+
exports.percentString = percentString;
|
|
12946
12652
|
function hash(s) {
|
|
12947
12653
|
let hash = 5381;
|
|
12948
12654
|
let i = s.length;
|
|
@@ -12953,9 +12659,11 @@ function hash(s) {
|
|
|
12953
12659
|
* signed int to an unsigned by doing an unsigned bitshift. */
|
|
12954
12660
|
return hash >>> 0;
|
|
12955
12661
|
}
|
|
12662
|
+
exports.hash = hash;
|
|
12956
12663
|
function hashObject(o) {
|
|
12957
12664
|
return hash(o ? JSON.stringify(o) : '');
|
|
12958
12665
|
}
|
|
12666
|
+
exports.hashObject = hashObject;
|
|
12959
12667
|
const HexTable = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
|
|
12960
12668
|
function toHex(n) {
|
|
12961
12669
|
if (n < 0 || n > 255)
|
|
@@ -12963,6 +12671,7 @@ function toHex(n) {
|
|
|
12963
12671
|
n = Math.floor(n);
|
|
12964
12672
|
return HexTable[n >> 4] + HexTable[n & 15];
|
|
12965
12673
|
}
|
|
12674
|
+
exports.toHex = toHex;
|
|
12966
12675
|
function toRGBA(color, alpha) {
|
|
12967
12676
|
// Allow passing rgba in rather than only '#ffffff' form
|
|
12968
12677
|
if (color.indexOf('rgba') === 0)
|
|
@@ -12989,24 +12698,31 @@ function toRGBA(color, alpha) {
|
|
|
12989
12698
|
}
|
|
12990
12699
|
return `rgba(${String(r)}, ${String(g)}, ${String(b)}, ${String(alpha)})`;
|
|
12991
12700
|
}
|
|
12701
|
+
exports.toRGBA = toRGBA;
|
|
12992
12702
|
function toRGBAIntensity(color, intensity, alpha) {
|
|
12993
12703
|
// for now assume color is black
|
|
12994
12704
|
let g = precisionRound(255 * intensity, 0);
|
|
12995
12705
|
return `rgba(${String(g)}, ${String(g)}, ${String(g)}, ${String(alpha)})`;
|
|
12996
12706
|
}
|
|
12707
|
+
exports.toRGBAIntensity = toRGBAIntensity;
|
|
12997
12708
|
// Geo functions
|
|
12998
12709
|
function distance(x0, y0, x1, y1) {
|
|
12999
12710
|
return Math.hypot(x0 - x1, y0 - y1);
|
|
13000
12711
|
}
|
|
12712
|
+
exports.distance = distance;
|
|
13001
12713
|
function deg2rad(num) { return num * Math.PI / 180; }
|
|
12714
|
+
exports.deg2rad = deg2rad;
|
|
13002
12715
|
function rad2deg(num) { return num / Math.PI * 180; }
|
|
12716
|
+
exports.rad2deg = rad2deg;
|
|
13003
12717
|
// Restricts lon to range [-180..180]
|
|
13004
12718
|
function wrapLon(lon) {
|
|
13005
12719
|
let worlds = Math.floor((lon + 180) / 360);
|
|
13006
12720
|
return lon - (worlds * 360);
|
|
13007
12721
|
}
|
|
12722
|
+
exports.wrapLon = wrapLon;
|
|
13008
12723
|
let reNumber = /^\s*-?\d+(\.\d+)?([eE][+-]?\d+)?\s*$/;
|
|
13009
12724
|
function isNumber(s) { return !!s && reNumber.test(s); }
|
|
12725
|
+
exports.isNumber = isNumber;
|
|
13010
12726
|
function toNumber(a) {
|
|
13011
12727
|
if (typeof a === 'number')
|
|
13012
12728
|
return a;
|
|
@@ -13014,10 +12730,12 @@ function toNumber(a) {
|
|
|
13014
12730
|
return NaN;
|
|
13015
12731
|
return Number(a);
|
|
13016
12732
|
}
|
|
12733
|
+
exports.toNumber = toNumber;
|
|
13017
12734
|
function toSafeNumber(a) {
|
|
13018
12735
|
let n = toNumber(a);
|
|
13019
12736
|
return (isNaN(n) || typeof n !== 'number') ? 0 : n;
|
|
13020
12737
|
}
|
|
12738
|
+
exports.toSafeNumber = toSafeNumber;
|
|
13021
12739
|
|
|
13022
12740
|
|
|
13023
12741
|
/***/ }),
|