public class UnaryUnionOp
- extends java.lang.Object
Unions a collection of Geometry or a single Geometry
(which may be a collection) together.
By using this special-purpose operation over a collection of geometries
it is possible to take advantage of various optimizations to improve performance.
GeometryCollections are fully supported.
The result obeys the following contract:
UnaryUnion always operates on the individual components of MultiGeometries.
So it is possible to use it to "clean" invalid self-intersecting MultiPolygons
(although the polygon components must all still be individually valid.)
- Unioning a set of overlapping
Polygonss has the effect of
merging the areas (i.e. the same effect as
iteratively unioning all individual polygons together).
- Unioning a set of
LineStrings has the effect of noding
and dissolving the input linework.
In this context "fully noded" means that there will be a node or endpoint in the result
for every endpoint or line segment crossing in the input.
"Dissolved" means that any duplicate (i.e. coincident) line segments or portions
of line segments will be reduced to a single line segment in the result.
This is consistent with the semantics of the
If merged linework is required, the
LineMerger class can be used.
- Unioning a set of
Pointss has the effect of merging
all identical points (producing a set with no duplicates).
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public UnaryUnionOp(java.util.Collection geoms,
public UnaryUnionOp(java.util.Collection geoms)
public UnaryUnionOp(Geometry geom)
public static Geometry union(java.util.Collection geoms)
public static Geometry union(java.util.Collection geoms,
public static Geometry union(Geometry geom)
public Geometry union()
- Gets the union of the input geometries.
If no input geometries were provided, a POINT EMPTY is returned.
- a Geometry containing the union