@dra2020/baseclient 1.0.64 → 1.0.67

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.
@@ -5296,7 +5296,7 @@ exports.makeConvexHullGrahamScan = makeConvexHullGrahamScan;
5296
5296
  // it as an array if [x, y] points, in contrast to polyToExteriorPoints() which
5297
5297
  // uses the packed format and the poly.ts-private point form.
5298
5298
  function getExteriorPoints(poly) {
5299
- let pp = poly_1.polyNormalize(poly);
5299
+ let pp = (0, poly_1.polyNormalize)(poly);
5300
5300
  if (pp == null)
5301
5301
  return null;
5302
5302
  let points = [];
@@ -5687,7 +5687,7 @@ function polyMapToByCentroid(districts, centroids) {
5687
5687
  let fIn = [];
5688
5688
  fs.forEach((fDistrict, i) => {
5689
5689
  if (BB.boundboxContains(bbDistricts[i], x, y))
5690
- if (pointinpoly_1.polyContainsPoint(fDistrict, x, y))
5690
+ if ((0, pointinpoly_1.polyContainsPoint)(fDistrict, x, y))
5691
5691
  fIn.push(i);
5692
5692
  });
5693
5693
  if (fIn.length == 1)
@@ -5985,7 +5985,7 @@ const M = __importStar(__webpack_require__(/*! ./matrix */ "./lib/poly/matrix.ts
5985
5985
  const X = 0, Y = 1;
5986
5986
  function minimumBoundingRectangle(poly) {
5987
5987
  // Get the convex hull polygon in standard form
5988
- const ch = poly_1.polyConvexHull(poly);
5988
+ const ch = (0, poly_1.polyConvexHull)(poly);
5989
5989
  // Select the exterior points (outer ring = 0)
5990
5990
  let chExt = ch[0];
5991
5991
  // Close the loop (ring)
@@ -6593,7 +6593,7 @@ exports.polyToExteriorPoints = polyToExteriorPoints;
6593
6593
  function polyConvexHull(poly, altAlgorithm) {
6594
6594
  if (altAlgorithm !== undefined)
6595
6595
  return makeConvexHullMonotoneChain2D(poly);
6596
- return graham_scan_1.makeConvexHullGrahamScan(poly);
6596
+ return (0, graham_scan_1.makeConvexHullGrahamScan)(poly);
6597
6597
  }
6598
6598
  exports.polyConvexHull = polyConvexHull;
6599
6599
  function makeConvexHullMonotoneChain2D(poly) {
@@ -6814,24 +6814,30 @@ function featureRewind(f, options) {
6814
6814
  // Only applies to multi-polygons with no holes
6815
6815
  let d = Util.depthof(f.geometry.coordinates);
6816
6816
  let windings = polyRingWindings(f);
6817
- if (options.validateHoles && d === 5 && windings.length) {
6818
- // If there are explicit holes, don't look for implicit ones
6819
- let nHoles = 0;
6820
- windings.forEach(w => { if (w.iRing)
6821
- nHoles++; });
6822
- if (nHoles == 0 && !misWound(windings[0])) {
6823
- // Looking for pattern: of (G (B*))*
6824
- // To convert to ((GH*))*
6825
- let iWinding = 0;
6817
+ if (options.validateHoles && d === 5 && windings.length > 1) {
6818
+ // First winding needs to be correct so we have a poly to add holes to
6819
+ if (!misWound(windings[0])) {
6820
+ // Flatten everything out and then rebuild hole structure based on windings
6821
+ let nHoles = 0;
6822
+ windings.forEach(w => { nHoles += w.iRing ? 1 : 0; });
6823
+ if (nHoles) {
6824
+ let c = [];
6825
+ f.geometry.coordinates.forEach((poly) => {
6826
+ poly.forEach((ring) => {
6827
+ c.push([ring]);
6828
+ });
6829
+ });
6830
+ f.geometry.coordinates = c;
6831
+ windings = polyRingWindings(f);
6832
+ }
6826
6833
  let polys = f.geometry.coordinates;
6827
- let iPoly;
6828
- for (; iWinding < windings.length; iWinding++) {
6834
+ let iPoly = 0;
6835
+ for (let iWinding = 0; iWinding < windings.length; iWinding++) {
6829
6836
  let good = !misWound(windings[iWinding]);
6830
- if (!good && iWinding == 0) // First is miswound - no good
6831
- break;
6832
6837
  if (good)
6833
6838
  iPoly = iWinding;
6834
6839
  else {
6840
+ // If hole, add to previous poly
6835
6841
  polys[iPoly].push(polys[iWinding][0]);
6836
6842
  polys[iWinding] = null;
6837
6843
  }
@@ -6842,10 +6848,13 @@ function featureRewind(f, options) {
6842
6848
  if (f.geometry.coordinates.length == 1) {
6843
6849
  f.geometry.type = 'Polygon';
6844
6850
  f.geometry.coordinates = f.geometry.coordinates[0];
6851
+ d = 4;
6845
6852
  }
6846
6853
  }
6847
6854
  // OK, now go through each ring
6848
6855
  let polys = f.geometry.coordinates;
6856
+ if (d == 4)
6857
+ polys = [polys];
6849
6858
  windings = polyRingWindings(f);
6850
6859
  windings.forEach((w) => {
6851
6860
  let good = !misWound(w);
@@ -7986,7 +7995,7 @@ function polySimplify(poly, tolerance = 0.0001) {
7986
7995
  // p is polygon, array of rings, each ring is array of points which is what gets fed to underlying simplify routine.
7987
7996
  let p = poly[i];
7988
7997
  for (let j = 0; j < p.length; j++)
7989
- p[j] = simplify_1.simplify(p[j], tolerance, true);
7998
+ p[j] = (0, simplify_1.simplify)(p[j], tolerance, true);
7990
7999
  }
7991
8000
  }
7992
8001
  exports.polySimplify = polySimplify;
@@ -8120,7 +8129,7 @@ class QuadLevel {
8120
8129
  if (!BB.boundboxContains(this.box, coord[0], coord[1]))
8121
8130
  return null;
8122
8131
  if (this.features) {
8123
- let wp = this.features.find(wp => pointinpoly_1.polyContainsPoint(wp.p, coord[0], coord[1]));
8132
+ let wp = this.features.find(wp => (0, pointinpoly_1.polyContainsPoint)(wp.p, coord[0], coord[1]));
8124
8133
  return wp ? wp.f : null;
8125
8134
  }
8126
8135
  else {
@@ -8962,7 +8971,7 @@ function topoSimplifyCollection(col, options) {
8962
8971
  if (!bDecided) {
8963
8972
  let pp = PP.polyPackTopoArcs(testtopo, arcs);
8964
8973
  P.polyRewindRings(pp);
8965
- if (shamos_1.selfIntersectFast(pp)) {
8974
+ if ((0, shamos_1.selfIntersectFast)(pp)) {
8966
8975
  keepArcs(topo, oOld.arcs, keepweight);
8967
8976
  nBad++;
8968
8977
  }
@@ -10906,7 +10915,7 @@ exports.wrapLon = wrapLon;
10906
10915
  \*******************************************/
10907
10916
  /***/ ((module) => {
10908
10917
 
10909
- module.exports = require("@dra2020/topojson-client");;
10918
+ module.exports = require("@dra2020/topojson-client");
10910
10919
 
10911
10920
  /***/ }),
10912
10921
 
@@ -10916,7 +10925,7 @@ module.exports = require("@dra2020/topojson-client");;
10916
10925
  \*******************************************/
10917
10926
  /***/ ((module) => {
10918
10927
 
10919
- module.exports = require("@dra2020/topojson-server");;
10928
+ module.exports = require("@dra2020/topojson-server");
10920
10929
 
10921
10930
  /***/ }),
10922
10931
 
@@ -10926,7 +10935,7 @@ module.exports = require("@dra2020/topojson-server");;
10926
10935
  \*********************************************/
10927
10936
  /***/ ((module) => {
10928
10937
 
10929
- module.exports = require("@dra2020/topojson-simplify");;
10938
+ module.exports = require("@dra2020/topojson-simplify");
10930
10939
 
10931
10940
  /***/ }),
10932
10941
 
@@ -10936,7 +10945,7 @@ module.exports = require("@dra2020/topojson-simplify");;
10936
10945
  \***********************************/
10937
10946
  /***/ ((module) => {
10938
10947
 
10939
- module.exports = require("diff-match-patch");;
10948
+ module.exports = require("diff-match-patch");
10940
10949
 
10941
10950
  /***/ }),
10942
10951
 
@@ -10946,7 +10955,7 @@ module.exports = require("diff-match-patch");;
10946
10955
  \***********************************/
10947
10956
  /***/ ((module) => {
10948
10957
 
10949
- module.exports = require("polygon-clipping");;
10958
+ module.exports = require("polygon-clipping");
10950
10959
 
10951
10960
  /***/ }),
10952
10961
 
@@ -10956,7 +10965,7 @@ module.exports = require("polygon-clipping");;
10956
10965
  \****************************/
10957
10966
  /***/ ((module) => {
10958
10967
 
10959
- module.exports = require("splaytree");;
10968
+ module.exports = require("splaytree");
10960
10969
 
10961
10970
  /***/ }),
10962
10971
 
@@ -10966,7 +10975,7 @@ module.exports = require("splaytree");;
10966
10975
  \****************************/
10967
10976
  /***/ ((module) => {
10968
10977
 
10969
- module.exports = require("tinyqueue");;
10978
+ module.exports = require("tinyqueue");
10970
10979
 
10971
10980
  /***/ })
10972
10981
 
@@ -10978,8 +10987,9 @@ module.exports = require("tinyqueue");;
10978
10987
  /******/ // The require function
10979
10988
  /******/ function __webpack_require__(moduleId) {
10980
10989
  /******/ // Check if module is in cache
10981
- /******/ if(__webpack_module_cache__[moduleId]) {
10982
- /******/ return __webpack_module_cache__[moduleId].exports;
10990
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
10991
+ /******/ if (cachedModule !== undefined) {
10992
+ /******/ return cachedModule.exports;
10983
10993
  /******/ }
10984
10994
  /******/ // Create a new module (and put it into the cache)
10985
10995
  /******/ var module = __webpack_module_cache__[moduleId] = {
@@ -10996,10 +11006,13 @@ module.exports = require("tinyqueue");;
10996
11006
  /******/ }
10997
11007
  /******/
10998
11008
  /************************************************************************/
10999
- /******/ // module exports must be returned from runtime so entry inlining is disabled
11009
+ /******/
11000
11010
  /******/ // startup
11001
11011
  /******/ // Load entry module and return exports
11002
- /******/ return __webpack_require__("./lib/all/all.ts");
11012
+ /******/ // This entry module is referenced by other modules so it can't be inlined
11013
+ /******/ var __webpack_exports__ = __webpack_require__("./lib/all/all.ts");
11014
+ /******/
11015
+ /******/ return __webpack_exports__;
11003
11016
  /******/ })()
11004
11017
  ;
11005
11018
  });