@dra2020/baseclient 1.0.49 → 1.0.50

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.
@@ -8551,8 +8551,9 @@ function intpt(f) {
8551
8551
  return { x: x, y: y };
8552
8552
  }
8553
8553
  const DefaultSimplifyOptions = { minArea: 500 };
8554
- function log(s) {
8555
- console.log(s);
8554
+ function log(emitlog, s) {
8555
+ if (emitlog)
8556
+ console.log(s);
8556
8557
  }
8557
8558
  //
8558
8559
  // topoSimplifyCollection:
@@ -8576,10 +8577,10 @@ function topoSimplifyCollection(col, options) {
8576
8577
  let elapsedTotal = new Util.Elapsed();
8577
8578
  let elapsed = new Util.Elapsed();
8578
8579
  let topo = topoFromCollection(col);
8579
- log(`topoSimplifyCollection: fromCollection: ${Math.round(elapsed.ms())}ms`);
8580
+ log(options.log, `topoSimplifyCollection: fromCollection: ${Math.round(elapsed.ms())}ms`);
8580
8581
  elapsed.start();
8581
8582
  topo = TopoSimplify.presimplify(topo, TopoSimplify['sphericalTriangleArea']);
8582
- log(`topoSimplifyCollection: presimplify: ${Math.round(elapsed.ms())}ms`);
8583
+ log(options.log, `topoSimplifyCollection: presimplify: ${Math.round(elapsed.ms())}ms`);
8583
8584
  elapsed.start();
8584
8585
  // Keep iterating on removing simplification from degenerate shapes
8585
8586
  let nTries = 1;
@@ -8644,17 +8645,17 @@ function topoSimplifyCollection(col, options) {
8644
8645
  keepTiny.set(f, f);
8645
8646
  keepArcs(topo, oOld.arcs, 0); // keeps all points to avoid reprocessing these tiny shapes
8646
8647
  nBad++, nTiny++;
8647
- log(`topoSimplifyCollection: ${f.properties.id}: increasing feature fidelity because intpt dist is ${d}`);
8648
+ log(options.log, `topoSimplifyCollection: ${f.properties.id}: increasing feature fidelity because intpt dist is ${d}`);
8648
8649
  }
8649
8650
  }
8650
8651
  }
8651
8652
  }
8652
8653
  });
8653
- log(`topoSimplifyCollection: pass ${nTries}: ${nBad} (${nTiny} tiny) of ${col.features.length} features are degenerate`);
8654
+ log(options.log, `topoSimplifyCollection: pass ${nTries}: ${nBad} (${nTiny} tiny) of ${col.features.length} features are degenerate`);
8654
8655
  // If not making progress, keep more points
8655
8656
  if (nBad >= nBadLast) {
8656
8657
  keepweight /= 10;
8657
- log(`topoSimplifyCollection: pass ${nTries}: reducing weight limit to ${keepweight}`);
8658
+ log(options.log, `topoSimplifyCollection: pass ${nTries}: reducing weight limit to ${keepweight}`);
8658
8659
  }
8659
8660
  nBadLast = nBad;
8660
8661
  if (nBad && nTries > MAX_TRIES)
@@ -8666,7 +8667,7 @@ function topoSimplifyCollection(col, options) {
8666
8667
  }
8667
8668
  nTries++;
8668
8669
  }
8669
- log(`topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
8670
+ log(options.log, `topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
8670
8671
  return col;
8671
8672
  }
8672
8673
  exports.topoSimplifyCollection = topoSimplifyCollection;