Package org.meteoinfo.jts.dissolve
Class LineDissolver
- java.lang.Object
-
- org.meteoinfo.jts.dissolve.LineDissolver
-
public class LineDissolver extends java.lang.ObjectDissolves the linear components from a collection ofGeometrys into a set of maximal-lengthLinestrings 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 Summary
Constructors Constructor Description LineDissolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.util.Collection geometries)Adds a collection of Geometries to be processed.voidadd(Geometry geometry)Adds aGeometryto be dissolved.static Geometrydissolve(Geometry g)Dissolves the linear components in a geometry.GeometrygetResult()Gets the dissolved result as a MultiLineString.
-
-
-
Method Detail
-
dissolve
public static Geometry dissolve(Geometry g)
Dissolves the linear components in a geometry.- Parameters:
g- the geometry to dissolve- Returns:
- the dissolved lines
-
add
public void add(Geometry geometry)
Adds aGeometryto 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.- Parameters:
geometry- geometry to be line-merged
-
add
public void add(java.util.Collection geometries)
Adds a collection of Geometries to be processed. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted.- Parameters:
geometries- the geometries to be line-merged
-
getResult
public Geometry getResult()
Gets the dissolved result as a MultiLineString.- Returns:
- the dissolved lines
-
-