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
SegmentString
s using a index based
on MonotoneChain
s and a SpatialIndex
.
Thread-safe and immutable.- Version:
- 1.7
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate STRtree
TheSpatialIndex
used should be something that supports envelope (range) queries efficiently (such as aQuadtree
orSTRtree
. -
Constructor Summary
ConstructorsConstructorDescriptionMCIndexSegmentSetMutualIntersector
(Collection baseSegStrings) Constructs a new intersector for a given set ofSegmentString
s. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addToIndex
(SegmentString segStr) private void
addToMonoChains
(SegmentString segStr, List monoChains) getIndex()
Gets the index constructed over the base segment strings.private void
initBaseSegments
(Collection segStrings) private void
intersectChains
(List monoChains, SegmentIntersector segInt) void
process
(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
TheSpatialIndex
used should be something that supports envelope (range) queries efficiently (such as aQuadtree
orSTRtree
.
-
-
Constructor Details
-
MCIndexSegmentSetMutualIntersector
Constructs a new intersector for a given set ofSegmentString
s.- 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:
process
in interfaceSegmentSetMutualIntersector
- Parameters:
segStrings
- a collection ofSegmentString
s 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
-