public class LineDissolver extends Object
Geometrys into a set of maximal-length
Linestrings in which every unique segment appears once only. The output linestrings run between node vertices of the input, which are vertices which have either degree 1, or degree 3 or greater.
Use cases for dissolving linear components include generalization (in particular, simplifying polygonal coverages), and visualization (in particular, avoiding symbology conflicts when depicting shared polygon boundaries).
This class does not node the input lines. If there are line segments crossing in the input, they will still cross in the output.
| Constructor and Description |
|---|
LineDissolver()
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Collection
Adds a collection of Geometries to be processed.
|
void |
add(Geometry
Adds a
Geometry to be dissolved.
|
static Geometry |
dissolve(Geometry
Dissolves the linear components in a geometry.
|
Geometry |
getResult()
Gets the dissolved result as a MultiLineString.
|
public static Geometrydissolve(Geometry g)
g - the geometry to dissolve
public void add(Geometrygeometry)
Geometry to be dissolved. Any number of geometries may be adde by calling this method multiple times. Any type of Geometry may be added. The constituent linework will be extracted to be dissolved.
geometry - geometry to be line-merged
public void add(Collectiongeometries)
geometries - the geometries to be line-merged
public GeometrygetResult()