@dra2020/baseclient 1.0.47 → 1.0.48

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.
package/lib/poly/topo.ts CHANGED
@@ -313,6 +313,7 @@ export function topoSimplifyCollection(col: any, options?: SimplifyOptions): any
313
313
  if (! bDecided)
314
314
  {
315
315
  let pp = PP.polyPackTopoArcs(testtopo, arcs);
316
+ P.polyRewindRings(pp);
316
317
  if (selfIntersectFast(pp))
317
318
  {
318
319
  keepArcs(topo, oOld.arcs, keepweight);
@@ -321,12 +322,13 @@ export function topoSimplifyCollection(col: any, options?: SimplifyOptions): any
321
322
  else
322
323
  {
323
324
  let {x,y} = intpt(f);
324
- if (x && y && !polyContainsPoint(pp, x, y))
325
+ let d = PL.polyDistance(pp, x, y);
326
+ if (d < 0.00001) // d is negative if outside the polygon, so that qualifies here
325
327
  {
326
328
  keepTiny.set(f, f);
327
329
  keepArcs(topo, oOld.arcs, 0); // keeps all points to avoid reprocessing these tiny shapes
328
330
  nBad++, nTiny++;
329
- log(`topoSimplifyCollection: ${f.properties.id}: increasing feature fidelity because of intpt problem`);
331
+ log(`topoSimplifyCollection: ${f.properties.id}: increasing feature fidelity because intpt dist is ${d}`);
330
332
  }
331
333
  }
332
334
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.47",
3
+ "version": "1.0.48",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",