@dra2020/baseclient 1.0.40 → 1.0.41

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.
@@ -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,6 +8465,20 @@ 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 in ['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 in ['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);
@@ -8545,7 +8560,8 @@ function topoSimplifyCollection(col, options) {
8545
8560
  }
8546
8561
  if (!bDecided) {
8547
8562
  let pp = PP.polyPackTopoArcs(testtopo, arcs);
8548
- if (shamos_1.selfIntersectFast(pp)) {
8563
+ let { x, y } = intpt(f);
8564
+ if (shamos_1.selfIntersectFast(pp) || (x && y && !pointinpoly_1.polyContainsPoint(pp, x, y))) {
8549
8565
  keepArcs(topo, oOld.arcs, keepweight);
8550
8566
  nBad++;
8551
8567
  }