Namespace NetTopologySuite.GeometriesGraph.Index
Contains classes that implement indexes for performing noding on geometry graph edges.
Classes
EdgeSetIntersector
An EdgeSetIntersector
computes all the intersections between the
edges in the set. It adds the computed intersections to each edge
they are found on. It may be used in two scenarios:
determining the internal intersections between a single set of edges
determining the mutual intersections between two different sets of edges
It uses a SegmentIntersector
to compute the intersections between
segments and to record statistics about what kinds of intersections were found.
MonotoneChain
MonotoneChainEdge
MonotoneChains are a way of partitioning the segments of an edge to allow for fast searching of intersections. They have the following properties: the segments within a monotone chain will never intersect each other, and the envelope of any contiguous subset of the segments in a monotone chain is simply the envelope of the endpoints of the subset. Property 1 means that there is no need to test pairs of segments from within the same monotone chain for intersection. Property 2 allows binary search to be used to find the intersection points of two monotone chains. For many types of real-world data, these properties eliminate a large number of segment comparisons, producing substantial speed gains.
MonotoneChainIndexer
MonotoneChains are a way of partitioning the segments of an edge to allow for fast searching of intersections.
Specifically, a sequence of contiguous line segments is a monotone chain if all the vectors defined by the oriented segments lies in the same quadrant.
Monotone Chains have the following useful properties: the segments within a monotone chain will never intersect each other, and the envelope of any contiguous subset of the segments in a monotone chain is simply the envelope of the endpoints of the subset. Property 1 means that there is no need to test pairs of segments from within the same monotone chain for intersection. Property 2 allows binary search to be used to find the intersection points of two monotone chains. For many types of real-world data, these properties eliminate a large number of segment comparisons, producing substantial speed gains.
Note that due to the efficient intersection test, there is no need to limit the size of chains to obtain fast performance.
SegmentIntersector
Computes the intersection of line segments, and adds the intersection to the edges containing the segments.
SimpleEdgeSetIntersector
Finds all intersections in one or two sets of edges, using the straightforward method of comparing all segments. This algorithm is too slow for production use, but is useful for testing purposes.
SimpleMCSweepLineIntersector
Finds all intersections in one or two sets of edges, using an x-axis sweepline algorithm in conjunction with Monotone Chains. While still O(n^2) in the worst case, this algorithm drastically improves the average-case time. The use of MonotoneChains as the items in the index seems to offer an improvement in performance over a sweep-line alone.
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.