Package org.locationtech.jts.noding
Class MCIndexSegmentSetMutualIntersector
java.lang.Object
org.locationtech.jts.noding.MCIndexSegmentSetMutualIntersector
- All Implemented Interfaces:
SegmentSetMutualIntersector
public class MCIndexSegmentSetMutualIntersector
extends Object
implements SegmentSetMutualIntersector
Intersects two sets of
SegmentStrings using a index based
on MonotoneChains and a SpatialIndex.
Thread-safe and immutable.- Version:
- 1.7
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate STRtreeTheSpatialIndexused should be something that supports envelope (range) queries efficiently (such as aQuadtreeorSTRtree. -
Constructor Summary
ConstructorsConstructorDescriptionMCIndexSegmentSetMutualIntersector(Collection baseSegStrings) Constructs a new intersector for a given set ofSegmentStrings. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddToIndex(SegmentString segStr) private voidaddToMonoChains(SegmentString segStr, List monoChains) getIndex()Gets the index constructed over the base segment strings.private voidinitBaseSegments(Collection segStrings) private voidintersectChains(List monoChains, SegmentIntersector segInt) voidprocess(Collection segStrings, SegmentIntersector segInt) CallsSegmentIntersector.processIntersections(SegmentString, int, SegmentString, int)for all candidate intersections between the given collection of SegmentStrings and the set of indexed segments.
-
Field Details
-
index
TheSpatialIndexused should be something that supports envelope (range) queries efficiently (such as aQuadtreeorSTRtree.
-
-
Constructor Details
-
MCIndexSegmentSetMutualIntersector
Constructs a new intersector for a given set ofSegmentStrings.- Parameters:
baseSegStrings- the base segment strings to intersect
-
-
Method Details
-
getIndex
Gets the index constructed over the base segment strings. NOTE: To retain thread-safety, treat returned value as immutable!- Returns:
- the constructed index
-
initBaseSegments
-
addToIndex
-
process
CallsSegmentIntersector.processIntersections(SegmentString, int, SegmentString, int)for all candidate intersections between the given collection of SegmentStrings and the set of indexed segments.- Specified by:
processin interfaceSegmentSetMutualIntersector- Parameters:
segStrings- a collection ofSegmentStrings to nodesegInt- the intersection detector to either record intersection occurrences or add intersection nodes to the input segment strings.a- set of segments to intersectthe- segment intersector to use
-
addToMonoChains
-
intersectChains
-