@dra2020/baseclient 1.0.156 → 1.0.157

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/union.ts CHANGED
@@ -49,9 +49,16 @@ export function polyIntersects(p1: any, p2: any): boolean
49
49
  if (iRing2 == 0)
50
50
  {
51
51
  let c2 = unpackCoords(buffer2, iOffset2, nPoints2);
52
- let result = _intersection(c1, c2);
53
- if (result && result.length > 0)
54
- bIntersects = true;
52
+ try
53
+ {
54
+ let result = _intersection(c1, c2);
55
+ if (result && result.length > 0)
56
+ bIntersects = true;
57
+ }
58
+ catch (err)
59
+ {
60
+ // Ignore, treat badly formed as non-intersecting
61
+ }
55
62
  }
56
63
  });
57
64
  }
@@ -69,9 +76,15 @@ export function polyIntersectArea(p1: any, p2: any): number
69
76
  let c1 = unpackCoords(buffer1, iOffset1, nPoints1);
70
77
  PP.polyPackEachRing(pp2, (buffer2: Float64Array, iPoly2: number, iRing2: number, iOffset2: number, nPoints2: number) => {
71
78
  let c2 = unpackCoords(buffer2, iOffset2, nPoints2);
72
- let result = _intersection(c1, c2);
73
- if (result && result.length > 0)
74
- area += Poly.polyArea(result) * ((!iRing1 == !iRing2) ? 1 : -1);
79
+ try
80
+ {
81
+ let result = _intersection(c1, c2);
82
+ if (result && result.length > 0)
83
+ area += Poly.polyArea(result) * ((!iRing1 == !iRing2) ? 1 : -1);
84
+ }
85
+ catch (err)
86
+ {
87
+ }
75
88
  });
76
89
  });
77
90
  return area;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.156",
3
+ "version": "1.0.157",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",