mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-26 23:07:45 +00:00
Updating connect method to prevent duplicate edges
This commit is contained in:
parent
f8f92f816a
commit
9466e16e24
@ -404,7 +404,8 @@ public abstract class BasePolygonBuilder<E extends BasePolygonBuilder<E>> extend
|
|||||||
// The connect method creates a new edge for these paired edges in the linked list.
|
// The connect method creates a new edge for these paired edges in the linked list.
|
||||||
// For boundary conditions (e.g., intersect but not crossing) there is no sibling edge
|
// For boundary conditions (e.g., intersect but not crossing) there is no sibling edge
|
||||||
// to connect. Thus the following enforces the pairwise rule
|
// to connect. Thus the following enforces the pairwise rule
|
||||||
if (e1.intersect != Edge.MAX_COORDINATE && e2.intersect != Edge.MAX_COORDINATE) {
|
if (e1.intersect != Edge.MAX_COORDINATE && e2.intersect != Edge.MAX_COORDINATE
|
||||||
|
&& (e1.next.next.coordinate != e2.coordinate) ) {
|
||||||
connect(e1, e2);
|
connect(e1, e2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -431,7 +432,7 @@ public abstract class BasePolygonBuilder<E extends BasePolygonBuilder<E>> extend
|
|||||||
in.next = new Edge(in.intersect, out.next, in.intersect);
|
in.next = new Edge(in.intersect, out.next, in.intersect);
|
||||||
}
|
}
|
||||||
out.next = new Edge(out.intersect, e1, out.intersect);
|
out.next = new Edge(out.intersect, e1, out.intersect);
|
||||||
} else if (in.next != out){
|
} else if (in.next != out && in.coordinate != out.intersect) {
|
||||||
// first edge intersects with dateline
|
// first edge intersects with dateline
|
||||||
Edge e2 = new Edge(out.intersect, in.next, out.intersect);
|
Edge e2 = new Edge(out.intersect, in.next, out.intersect);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user