@dra2020/baseclient 1.0.40 → 1.0.43
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 +25 -1
- package/dist/baseclient.js.map +1 -1
- package/lib/poly/topo.ts +31 -1
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -8309,6 +8309,7 @@ const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
|
8309
8309
|
const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
|
|
8310
8310
|
const PL = __importStar(__webpack_require__(/*! ./polylabel */ "./lib/poly/polylabel.ts"));
|
|
8311
8311
|
const shamos_1 = __webpack_require__(/*! ./shamos */ "./lib/poly/shamos.ts");
|
|
8312
|
+
const pointinpoly_1 = __webpack_require__(/*! ./pointinpoly */ "./lib/poly/pointinpoly.ts");
|
|
8312
8313
|
function getGEOID(f) {
|
|
8313
8314
|
if (f.features && f.features.length)
|
|
8314
8315
|
f = f.features[0];
|
|
@@ -8464,9 +8465,23 @@ function bigTimeString(ms) {
|
|
|
8464
8465
|
seconds -= minutes * 60;
|
|
8465
8466
|
return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
|
8466
8467
|
}
|
|
8468
|
+
function intpt(f) {
|
|
8469
|
+
let x = 0, y = 0;
|
|
8470
|
+
for (let p of ['INTPTLON20', 'INTPTLON10', 'INTPTLON', 'labelx'])
|
|
8471
|
+
if (f.properties[p] && !isNaN(Number(f.properties[p]))) {
|
|
8472
|
+
x = Number(f.properties[p]);
|
|
8473
|
+
break;
|
|
8474
|
+
}
|
|
8475
|
+
for (let p of ['INTPTLAT20', 'INTPTLAT10', 'INTPTLAT', 'labely'])
|
|
8476
|
+
if (f.properties[p] && !isNaN(Number(f.properties[p]))) {
|
|
8477
|
+
y = Number(f.properties[p]);
|
|
8478
|
+
break;
|
|
8479
|
+
}
|
|
8480
|
+
return { x: x, y: y };
|
|
8481
|
+
}
|
|
8467
8482
|
const DefaultSimplifyOptions = { minArea: 500 };
|
|
8468
8483
|
function log(s) {
|
|
8469
|
-
|
|
8484
|
+
console.log(s);
|
|
8470
8485
|
}
|
|
8471
8486
|
//
|
|
8472
8487
|
// topoSimplifyCollection:
|
|
@@ -8549,6 +8564,15 @@ function topoSimplifyCollection(col, options) {
|
|
|
8549
8564
|
keepArcs(topo, oOld.arcs, keepweight);
|
|
8550
8565
|
nBad++;
|
|
8551
8566
|
}
|
|
8567
|
+
else {
|
|
8568
|
+
let { x, y } = intpt(f);
|
|
8569
|
+
if (x && y && !pointinpoly_1.polyContainsPoint(pp, x, y)) {
|
|
8570
|
+
keepTiny.set(f, f);
|
|
8571
|
+
keepArcs(topo, oOld.arcs, 0); // keeps all points to avoid reprocessing these tiny shapes
|
|
8572
|
+
nBad++, nTiny++;
|
|
8573
|
+
log(`topoSimplifyCollection: ${f.properties.id}: preserving full feature because of intpt problem`);
|
|
8574
|
+
}
|
|
8575
|
+
}
|
|
8552
8576
|
}
|
|
8553
8577
|
}
|
|
8554
8578
|
});
|