Package org.locationtech.jts.noding
Class MCIndexSegmentSetMutualIntersector
- java.lang.Object
-
- org.locationtech.jts.noding.MCIndexSegmentSetMutualIntersector
-
- All Implemented Interfaces:
SegmentSetMutualIntersector
public class MCIndexSegmentSetMutualIntersector extends java.lang.Object implements SegmentSetMutualIntersector
Intersects two sets ofSegmentString
s using a index based onMonotoneChain
s and aSpatialIndex
. Thread-safe and immutable.- Version:
- 1.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MCIndexSegmentSetMutualIntersector.SegmentOverlapAction
-
Field Summary
Fields Modifier and Type Field Description private STRtree
index
TheSpatialIndex
used should be something that supports envelope (range) queries efficiently (such as aQuadtree
orSTRtree
.
-
Constructor Summary
Constructors Constructor Description MCIndexSegmentSetMutualIntersector(java.util.Collection baseSegStrings)
Constructs a new intersector for a given set ofSegmentString
s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addToIndex(SegmentString segStr)
private void
addToMonoChains(SegmentString segStr, java.util.List monoChains)
SpatialIndex
getIndex()
Gets the index constructed over the base segment strings.private void
initBaseSegments(java.util.Collection segStrings)
private void
intersectChains(java.util.List monoChains, SegmentIntersector segInt)
void
process(java.util.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 Detail
-
index
private STRtree index
TheSpatialIndex
used should be something that supports envelope (range) queries efficiently (such as aQuadtree
orSTRtree
.
-
-
Constructor Detail
-
MCIndexSegmentSetMutualIntersector
public MCIndexSegmentSetMutualIntersector(java.util.Collection baseSegStrings)
Constructs a new intersector for a given set ofSegmentString
s.- Parameters:
baseSegStrings
- the base segment strings to intersect
-
-
Method Detail
-
getIndex
public SpatialIndex 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
private void initBaseSegments(java.util.Collection segStrings)
-
addToIndex
private void addToIndex(SegmentString segStr)
-
process
public void process(java.util.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.- Specified by:
process
in interfaceSegmentSetMutualIntersector
- Parameters:
a
- set of segments to intersectthe
- segment intersector to use
-
addToMonoChains
private void addToMonoChains(SegmentString segStr, java.util.List monoChains)
-
intersectChains
private void intersectChains(java.util.List monoChains, SegmentIntersector segInt)
-
-