@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/dist/baseclient.js +15 -6
- package/dist/baseclient.js.map +1 -1
- package/lib/poly/union.ts +19 -6
- package/package.json +1 -1
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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;
|