Package org.locationtech.jts.geom.util
Class GeometryCombiner
java.lang.Object
org.locationtech.jts.geom.util.GeometryCombiner
Combines
Geometry
s
to produce a GeometryCollection
of the most appropriate type.
Input geometries which are already collections
will have their elements extracted first.
No validation of the result geometry is performed.
(The only case where invalidity is possible is where Polygonal
geometries
are combined and result in a self-intersection).- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGeometryCombiner
(Collection geoms) Creates a new combiner for a collection of geometries -
Method Summary
Modifier and TypeMethodDescriptioncombine()
Computes the combination of the input geometries to produce the most appropriateGeometry
orGeometryCollection
static Geometry
combine
(Collection geoms) Combines a collection of geometries.static Geometry
Combines two geometries.static Geometry
Combines three geometries.private static List
createList
(Object obj0, Object obj1) Creates a list from two itemsprivate static List
createList
(Object obj0, Object obj1, Object obj2) Creates a list from two itemsprivate void
extractElements
(Geometry geom, List elems) static GeometryFactory
extractFactory
(Collection geoms) Extracts the GeometryFactory used by the geometries in a collection
-
Field Details
-
geomFactory
-
skipEmpty
private boolean skipEmpty -
inputGeoms
-
-
Constructor Details
-
GeometryCombiner
Creates a new combiner for a collection of geometries- Parameters:
geoms
- the geometries to combine
-
-
Method Details
-
combine
Combines a collection of geometries.- Parameters:
geoms
- the geometries to combine- Returns:
- the combined geometry
-
combine
Combines two geometries.- Parameters:
g0
- a geometry to combineg1
- a geometry to combine- Returns:
- the combined geometry
-
combine
Combines three geometries.- Parameters:
g0
- a geometry to combineg1
- a geometry to combineg2
- a geometry to combine- Returns:
- the combined geometry
-
createList
Creates a list from two items- Parameters:
obj0
-obj1
-- Returns:
- a List containing the two items
-
createList
Creates a list from two items- Parameters:
obj0
-obj1
-- Returns:
- a List containing the two items
-
extractFactory
Extracts the GeometryFactory used by the geometries in a collection- Parameters:
geoms
-- Returns:
- a GeometryFactory
-
combine
Computes the combination of the input geometries to produce the most appropriateGeometry
orGeometryCollection
- Returns:
- a Geometry which is the combination of the inputs
-
extractElements
-