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 ofSegmentStrings using a index based onMonotoneChains and aSpatialIndex. Thread-safe and immutable.- Version:
- 1.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMCIndexSegmentSetMutualIntersector.SegmentOverlapAction
-
Field Summary
Fields Modifier and Type Field Description private STRtreeindexTheSpatialIndexused should be something that supports envelope (range) queries efficiently (such as aQuadtreeorSTRtree.
-
Constructor Summary
Constructors Constructor Description MCIndexSegmentSetMutualIntersector(java.util.Collection baseSegStrings)Constructs a new intersector for a given set ofSegmentStrings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddToIndex(SegmentString segStr)private voidaddToMonoChains(SegmentString segStr, java.util.List monoChains)SpatialIndexgetIndex()Gets the index constructed over the base segment strings.private voidinitBaseSegments(java.util.Collection segStrings)private voidintersectChains(java.util.List monoChains, SegmentIntersector segInt)voidprocess(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
TheSpatialIndexused should be something that supports envelope (range) queries efficiently (such as aQuadtreeorSTRtree.
-
-
Constructor Detail
-
MCIndexSegmentSetMutualIntersector
public MCIndexSegmentSetMutualIntersector(java.util.Collection baseSegStrings)
Constructs a new intersector for a given set ofSegmentStrings.- 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:
processin 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)
-
-