@dra2020/baseclient 1.0.45 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baseclient.js +10 -7
- package/dist/baseclient.js.map +1 -1
- package/lib/poly/topo.ts +9 -6
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -8350,7 +8350,6 @@ const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
|
8350
8350
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
8351
8351
|
const PL = __importStar(__webpack_require__(/*! ./polylabel */ "./lib/poly/polylabel.ts"));
|
|
8352
8352
|
const shamos_1 = __webpack_require__(/*! ./shamos */ "./lib/poly/shamos.ts");
|
|
8353
|
-
const pointinpoly_1 = __webpack_require__(/*! ./pointinpoly */ "./lib/poly/pointinpoly.ts");
|
|
8354
8353
|
function getGEOID(f) {
|
|
8355
8354
|
if (f.features && f.features.length)
|
|
8356
8355
|
f = f.features[0];
|
|
@@ -8499,7 +8498,7 @@ function misMatchObject(o1, o2) {
|
|
|
8499
8498
|
return true;
|
|
8500
8499
|
return (o1.type === 'MultiPolygon') ? misMatchMulti(o1.arcs, o2.arcs) : misMatchPoly(o1.arcs, o2.arcs);
|
|
8501
8500
|
}
|
|
8502
|
-
const MAX_TRIES =
|
|
8501
|
+
const MAX_TRIES = 30;
|
|
8503
8502
|
function bigTimeString(ms) {
|
|
8504
8503
|
let seconds = Math.trunc(ms / 1000);
|
|
8505
8504
|
let minutes = Math.trunc(seconds / 60);
|
|
@@ -8522,7 +8521,7 @@ function intpt(f) {
|
|
|
8522
8521
|
}
|
|
8523
8522
|
const DefaultSimplifyOptions = { minArea: 500 };
|
|
8524
8523
|
function log(s) {
|
|
8525
|
-
|
|
8524
|
+
console.log(s);
|
|
8526
8525
|
}
|
|
8527
8526
|
//
|
|
8528
8527
|
// topoSimplifyCollection:
|
|
@@ -8601,16 +8600,20 @@ function topoSimplifyCollection(col, options) {
|
|
|
8601
8600
|
}
|
|
8602
8601
|
if (!bDecided) {
|
|
8603
8602
|
let pp = PP.polyPackTopoArcs(testtopo, arcs);
|
|
8603
|
+
P.polyRewindRings(pp);
|
|
8604
8604
|
if (shamos_1.selfIntersectFast(pp)) {
|
|
8605
8605
|
keepArcs(topo, oOld.arcs, keepweight);
|
|
8606
8606
|
nBad++;
|
|
8607
8607
|
}
|
|
8608
8608
|
else {
|
|
8609
8609
|
let { x, y } = intpt(f);
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8610
|
+
let d = PL.polyDistance(pp, x, y);
|
|
8611
|
+
if (d < 0.00001) // d is negative if outside the polygon, so that qualifies here
|
|
8612
|
+
{
|
|
8613
|
+
keepTiny.set(f, f);
|
|
8614
|
+
keepArcs(topo, oOld.arcs, 0); // keeps all points to avoid reprocessing these tiny shapes
|
|
8615
|
+
nBad++, nTiny++;
|
|
8616
|
+
log(`topoSimplifyCollection: ${f.properties.id}: increasing feature fidelity because intpt dist is ${d}`);
|
|
8614
8617
|
}
|
|
8615
8618
|
}
|
|
8616
8619
|
}
|