@dra2020/baseclient 1.0.125 → 1.0.127

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.
@@ -6481,6 +6481,12 @@ function featureCleanHoles(f) {
6481
6481
  || f.geometry.type !== 'MultiPolygon'
6482
6482
  || !Array.isArray(f.geometry.coordinates))
6483
6483
  return f;
6484
+ // Bail out if excessive computation cost (and complex poly likely already correct, heuristically)
6485
+ let d = (0, poly_1.polyDescribe)(f);
6486
+ if (d.npoly + d.nhole > 10) {
6487
+ //console.log(`featureCleanHoles: bailing out on polygon with ${d.npoly} polygons and ${d.nhole} holes`);
6488
+ return f;
6489
+ }
6484
6490
  // Normalize to flattened polygon
6485
6491
  f.geometry.coordinates = flattenMultiPoly(f.geometry.coordinates);
6486
6492
  let polys = f.geometry.coordinates;