@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/dist/baseclient.js
CHANGED
|
@@ -11002,9 +11002,14 @@ function polyIntersects(p1, p2) {
|
|
|
11002
11002
|
PP.polyPackEachRing(pp2, (buffer2, iPoly2, iRing2, iOffset2, nPoints2) => {
|
|
11003
11003
|
if (iRing2 == 0) {
|
|
11004
11004
|
let c2 = unpackCoords(buffer2, iOffset2, nPoints2);
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11005
|
+
try {
|
|
11006
|
+
let result = _intersection(c1, c2);
|
|
11007
|
+
if (result && result.length > 0)
|
|
11008
|
+
bIntersects = true;
|
|
11009
|
+
}
|
|
11010
|
+
catch (err) {
|
|
11011
|
+
// Ignore, treat badly formed as non-intersecting
|
|
11012
|
+
}
|
|
11008
11013
|
}
|
|
11009
11014
|
});
|
|
11010
11015
|
}
|
|
@@ -11020,9 +11025,13 @@ function polyIntersectArea(p1, p2) {
|
|
|
11020
11025
|
let c1 = unpackCoords(buffer1, iOffset1, nPoints1);
|
|
11021
11026
|
PP.polyPackEachRing(pp2, (buffer2, iPoly2, iRing2, iOffset2, nPoints2) => {
|
|
11022
11027
|
let c2 = unpackCoords(buffer2, iOffset2, nPoints2);
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11028
|
+
try {
|
|
11029
|
+
let result = _intersection(c1, c2);
|
|
11030
|
+
if (result && result.length > 0)
|
|
11031
|
+
area += Poly.polyArea(result) * ((!iRing1 == !iRing2) ? 1 : -1);
|
|
11032
|
+
}
|
|
11033
|
+
catch (err) {
|
|
11034
|
+
}
|
|
11026
11035
|
});
|
|
11027
11036
|
});
|
|
11028
11037
|
return area;
|