Class SimpleSweepLineIntersector
java.lang.Object
org.locationtech.jts.geomgraph.index.EdgeSetIntersector
org.locationtech.jts.geomgraph.index.SimpleSweepLineIntersector
Finds all intersections in one or two sets of edges,
using a simple x-axis sweepline algorithm.
While still O(n^2) in the worst case, this algorithm
drastically improves the average-case time.
- Version:
- 1.7
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
private void
void
computeIntersections
(List edges0, List edges1, SegmentIntersector si) Computes all mutual intersections between two sets of edges.void
computeIntersections
(List edges, SegmentIntersector si, boolean testAllSegments) Computes all self-intersections between edges in a set of edges, allowing client to choose whether self-intersections are computed.private void
private void
Because DELETE events have a link to their corresponding INSERT event, it is possible to compute exactly the range of events which must be compared to a given INSERT event object.private void
processOverlaps
(int start, int end, SweepLineEvent ev0, SegmentIntersector si)
-
Field Details
-
events
List events -
nOverlaps
int nOverlaps
-
-
Constructor Details
-
SimpleSweepLineIntersector
public SimpleSweepLineIntersector()
-
-
Method Details
-
computeIntersections
Description copied from class:EdgeSetIntersector
Computes all self-intersections between edges in a set of edges, allowing client to choose whether self-intersections are computed.- Specified by:
computeIntersections
in classEdgeSetIntersector
- Parameters:
edges
- a list of edges to test for intersectionssi
- the SegmentIntersector to usetestAllSegments
- true if self-intersections are to be tested as well
-
computeIntersections
Description copied from class:EdgeSetIntersector
Computes all mutual intersections between two sets of edges.- Specified by:
computeIntersections
in classEdgeSetIntersector
-
add
-
add
-
add
-
prepareEvents
private void prepareEvents()Because DELETE events have a link to their corresponding INSERT event, it is possible to compute exactly the range of events which must be compared to a given INSERT event object. -
computeIntersections
-
processOverlaps
-