public class SegmentStringDissolver
extends java.lang.Object
SegmentString
s to produce
a set of merged linework with unique segments.
A custom SegmentStringDissolver.SegmentStringMerger
merging strategy
can be supplied.
This strategy will be called when two identical (up to orientation)
strings are dissolved together.
The default merging strategy is simply to discard one of the merged strings.
A common use for this class is to merge noded edges while preserving topological labelling. This requires a custom merging strategy to be supplied to merge the topology labels appropriately.
SegmentStringDissolver.SegmentStringMerger
Modifier and Type | Class and Description |
---|---|
static interface |
SegmentStringDissolver.SegmentStringMerger
A merging strategy which can be used to update the context data of
SegmentString s
which are merged during the dissolve process. |
Modifier and Type | Field and Description |
---|---|
private SegmentStringDissolver.SegmentStringMerger |
merger |
private java.util.Map |
ocaMap |
Constructor and Description |
---|
SegmentStringDissolver()
Creates a dissolver with the default merging strategy.
|
SegmentStringDissolver(SegmentStringDissolver.SegmentStringMerger merger)
Creates a dissolver with a user-defined merge strategy.
|
Modifier and Type | Method and Description |
---|---|
private void |
add(OrientedCoordinateArray oca,
SegmentString segString) |
void |
dissolve(java.util.Collection segStrings)
Dissolve all
SegmentString s in the input Collection |
void |
dissolve(SegmentString segString)
Dissolve the given
SegmentString . |
private SegmentString |
findMatching(OrientedCoordinateArray oca,
SegmentString segString) |
java.util.Collection |
getDissolved()
Gets the collection of dissolved (i.e.
|
private SegmentStringDissolver.SegmentStringMerger merger
private java.util.Map ocaMap
public SegmentStringDissolver(SegmentStringDissolver.SegmentStringMerger merger)
merger
- the merging strategy to usepublic SegmentStringDissolver()
public void dissolve(java.util.Collection segStrings)
SegmentString
s in the input Collection
segStrings
- private void add(OrientedCoordinateArray oca, SegmentString segString)
public void dissolve(SegmentString segString)
SegmentString
.segString
- the string to dissolveprivate SegmentString findMatching(OrientedCoordinateArray oca, SegmentString segString)
public java.util.Collection getDissolved()
SegmentString
sSegmentString
s