I want to check if two polygons with are intersecting.
When the polygons have overlapping coords, intersection still returns that they are not intersecting
Example:
const poly1 = [
[
[72.723999, 18.976429],
[72.723999, 19.324103],
[73.100281, 19.324103], // <-- overlapping coords
[73.100281, 18.976429], // <-- overlapping coords
[72.723999, 18.976429],
],
];
const poly2 = [
[
[73.100281, 18.976429], // <-- overlapping coords
[73.100281, 19.324103], // <-- overlapping coords
[74.900281, 19.324103],
[74.900281, 18.976429],
[73.100281, 18.976429],
],
];
polyclip.intersection(poly1, poly2);
Is not intersecting ... Why? Bounds are overlapping:
[]
polyclip.union(poly1, poly2);
Union returns single polygon (correctly), because bounds are overlapping:
[[[[72.723999,18.976429],[74.900281,18.976429],[74.900281,19.324103],[72.723999,19.324103],[72.723999,18.976429]]]]
https://plnkr.co/edit/qDSAFfMQUsJFog2S
I want to check if two polygons with are intersecting.
When the polygons have overlapping coords,
intersectionstill returns that they are not intersectingExample:
Is not intersecting ... Why? Bounds are overlapping:
[]Union returns single polygon (correctly), because bounds are overlapping:
[[[[72.723999,18.976429],[74.900281,18.976429],[74.900281,19.324103],[72.723999,19.324103],[72.723999,18.976429]]]]https://plnkr.co/edit/qDSAFfMQUsJFog2S