@dra2020/baseclient 1.0.97 → 1.0.99

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.
@@ -2693,8 +2693,12 @@ class GeoMultiCollection {
2693
2693
  let map = {};
2694
2694
  this.all.map = map;
2695
2695
  this.forEachEntry(e => {
2696
- let col = this._col(e); // this ensures we convert feature geometry from topo to polygon
2697
- col.features.forEach(f => { map[String(f.properties.id)] = f; });
2696
+ let col = this._col(e); // convert feature geometry from topo to polygon
2697
+ col.features.forEach(f => {
2698
+ let id = f.properties.id;
2699
+ if (!this.hidden[id])
2700
+ map[id] = f;
2701
+ });
2698
2702
  });
2699
2703
  }
2700
2704
  }
@@ -10163,7 +10167,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
10163
10167
  return result;
10164
10168
  };
10165
10169
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10166
- exports.FsmUnion = exports.polyDifference = exports.polyIntersects = void 0;
10170
+ exports.FsmUnion = exports.polyDifference = exports.polyIntersectArea = exports.polyIntersects = void 0;
10167
10171
  const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
10168
10172
  const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
10169
10173
  const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
@@ -10222,6 +10226,26 @@ function polyIntersects(p1, p2) {
10222
10226
  return bIntersects;
10223
10227
  }
10224
10228
  exports.polyIntersects = polyIntersects;
10229
+ function polyIntersectArea(p1, p2) {
10230
+ let pp1 = Poly.polyNormalize(p1);
10231
+ let pp2 = Poly.polyNormalize(p2);
10232
+ let area = 0;
10233
+ PP.polyPackEachRing(pp1, (buffer1, iPoly1, iRing1, iOffset1, nPoints1) => {
10234
+ if (iRing1 == 0) {
10235
+ let c1 = unpackCoords(buffer1, iOffset1, nPoints1);
10236
+ PP.polyPackEachRing(pp2, (buffer2, iPoly2, iRing2, iOffset2, nPoints2) => {
10237
+ if (iRing2 == 0) {
10238
+ let c2 = unpackCoords(buffer2, iOffset2, nPoints2);
10239
+ let result = _intersection(c1, c2);
10240
+ if (result && result.length > 0)
10241
+ area += Poly.polyArea(result);
10242
+ }
10243
+ });
10244
+ }
10245
+ });
10246
+ return area;
10247
+ }
10248
+ exports.polyIntersectArea = polyIntersectArea;
10225
10249
  function polyDifference(main, parts) {
10226
10250
  main = PP.polyUnpack(coords(main));
10227
10251
  // need to explode multipolygon so that "exploded" is a valid multipolygon input to underlying difference routine