public class MCIndexSegmentSetMutualIntersector extends java.lang.Object implements SegmentSetMutualIntersector
SegmentString
s using a index based
on MonotoneChain
s and a SpatialIndex
.
Thread-safe and immutable.Modifier and Type | Class and Description |
---|---|
static class |
MCIndexSegmentSetMutualIntersector.SegmentOverlapAction |
Modifier and Type | Field and Description |
---|---|
private STRtree |
index
The
SpatialIndex used should be something that supports
envelope (range) queries efficiently (such as a
Quadtree
or STRtree . |
Constructor and Description |
---|
MCIndexSegmentSetMutualIntersector(java.util.Collection baseSegStrings)
Constructs a new intersector for a given set of
SegmentString s. |
Modifier and Type | Method and 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)
Calls
SegmentIntersector.processIntersections(SegmentString, int, SegmentString, int)
for all candidate intersections between
the given collection of SegmentStrings and the set of indexed segments. |
private STRtree index
SpatialIndex
used should be something that supports
envelope (range) queries efficiently (such as a
Quadtree
or STRtree
.public MCIndexSegmentSetMutualIntersector(java.util.Collection baseSegStrings)
SegmentString
s.baseSegStrings
- the base segment strings to intersectpublic SpatialIndex getIndex()
private void initBaseSegments(java.util.Collection segStrings)
private void addToIndex(SegmentString segStr)
public void process(java.util.Collection segStrings, SegmentIntersector segInt)
SegmentIntersector.processIntersections(SegmentString, int, SegmentString, int)
for all candidate intersections between
the given collection of SegmentStrings and the set of indexed segments.process
in interface SegmentSetMutualIntersector
a
- set of segments to intersectthe
- segment intersector to useprivate void addToMonoChains(SegmentString segStr, java.util.List monoChains)
private void intersectChains(java.util.List monoChains, SegmentIntersector segInt)