Class CascadedPolygonUnion
- java.lang.Object
-
- org.locationtech.jts.operation.union.CascadedPolygonUnion
-
public class CascadedPolygonUnion extends java.lang.ObjectProvides an efficient method of unioning a collection ofPolygonalgeometries. The geometries are indexed using a spatial index, and unioned recursively in index order. For geometries with a high degree of overlap, this has the effect of reducing the number of vertices early in the process, which increases speed and robustness.This algorithm is faster and more robust than the simple iterated approach of repeatedly unioning each polygon to a result geometry.
- Author:
- Martin Davis
-
-
Constructor Summary
Constructors Constructor Description CascadedPolygonUnion(java.util.Collection polys)Creates a new instance to union the given collection ofGeometrys.CascadedPolygonUnion(java.util.Collection polys, UnionStrategy unionFun)Creates a new instance to union the given collection ofGeometrys.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Geometryunion()Computes the union of the input geometries.static Geometryunion(java.util.Collection polys)static Geometryunion(java.util.Collection polys, UnionStrategy unionFun)
-
-
-
Constructor Detail
-
CascadedPolygonUnion
public CascadedPolygonUnion(java.util.Collection polys)
Creates a new instance to union the given collection ofGeometrys.
-
CascadedPolygonUnion
public CascadedPolygonUnion(java.util.Collection polys, UnionStrategy unionFun)Creates a new instance to union the given collection ofGeometrys.
-
-
Method Detail
-
union
public static Geometry union(java.util.Collection polys)
-
union
public static Geometry union(java.util.Collection polys, UnionStrategy unionFun)
-
union
public Geometry union()
Computes the union of the input geometries.This method discards the input geometries as they are processed. In many input cases this reduces the memory retained as the operation proceeds. Optimal memory usage is achieved by disposing of the original input collection before calling this method.
- Returns:
- the union of the input geometries or null if no input geometries were provided
- Throws:
java.lang.IllegalStateException- if this method is called more than once
-
-