GEOS 3.15.0beta2
geos::operation::geounion::CascadedPolygonUnion Class Reference

Provides an efficient method of unioning a collection of polygonal geometries. More...

#include <CascadedPolygonUnion.h>

Public Member Functions

 CascadedPolygonUnion (const std::vector< const geom::Surface * > &polys)
 Creates a new instance to union the given collection of Geometrys.
 CascadedPolygonUnion (const std::vector< const geom::Surface * > &polys, UnionStrategy *unionFun)
std::unique_ptr< geom::GeometryUnion (geos::util::ProgressFunction *progressFunction)
 Computes the union of the input geometries.

Static Public Member Functions

static std::unique_ptr< geom::GeometryUnion (const std::vector< const geom::Surface * > &polys)
 Computes the union of a collection of polygonal Geometrys.
static std::unique_ptr< geom::GeometryUnion (const std::vector< const geom::Surface * > &polys, UnionStrategy *unionFun, geos::util::ProgressFunction *progressFunction)
template<class T>
static std::unique_ptr< geom::GeometryUnion (T start, T end, UnionStrategy *unionStrategy, geos::util::ProgressFunction *progressFunction)
 Computes the union of a set of surface Geometrys.
static std::unique_ptr< geom::GeometryUnion (const geom::MultiPolygon *polys, geos::util::ProgressFunction *progressFunction)
 Computes the union of a collection of polygonal Geometrys.

Detailed Description

Provides an efficient method of unioning a collection of polygonal geometries.

This algorithm is faster and likely more robust than the simple iterated approach of repeatedly unioning each polygon to a result geometry.

The buffer(0) trick is sometimes faster, but can be less robust and can sometimes take an exceptionally long time to complete. This is particularly the case where there is a high degree of overlap between the polygons. In this case, buffer(0) is forced to compute with all line segments from the outset, whereas cascading can eliminate many segments at each stage of processing. The best case for buffer(0) is the trivial case where there is no overlap between the input geometries. However, this case is likely rare in practice.

Constructor & Destructor Documentation

◆ CascadedPolygonUnion()

geos::operation::geounion::CascadedPolygonUnion::CascadedPolygonUnion ( const std::vector< const geom::Surface * > & polys)
inlineexplicit

Creates a new instance to union the given collection of Geometrys.

Parameters
polysa collection of surface Geometrys. Ownership of elements and vector are left to caller.

Member Function Documentation

◆ Union() [1/4]

std::unique_ptr< geom::Geometry > geos::operation::geounion::CascadedPolygonUnion::Union ( const geom::MultiPolygon * polys,
geos::util::ProgressFunction * progressFunction )
static

Computes the union of a collection of polygonal Geometrys.

Parameters
polysa collection of polygonal Geometrys. Ownership of elements and vector are left to caller.
progressFunctionprogress function

◆ Union() [2/4]

std::unique_ptr< geom::Geometry > geos::operation::geounion::CascadedPolygonUnion::Union ( const std::vector< const geom::Surface * > & polys)
static

Computes the union of a collection of polygonal Geometrys.

Parameters
polysa collection of polygonal Geometrys. ownership of elements and vector are left to caller.

References Union().

Referenced by Union(), and Union().

◆ Union() [3/4]

std::unique_ptr< geom::Geometry > geos::operation::geounion::CascadedPolygonUnion::Union ( geos::util::ProgressFunction * progressFunction)

Computes the union of the input geometries.

Parameters
progressFunctionprogress function
Returns
the union of the input geometries
null if no input geometries were provided

◆ Union() [4/4]

template<class T>
std::unique_ptr< geom::Geometry > geos::operation::geounion::CascadedPolygonUnion::Union ( T start,
T end,
UnionStrategy * unionStrategy,
geos::util::ProgressFunction * progressFunction )
inlinestatic

Computes the union of a set of surface Geometrys.

Template Parameters
Tan iterator yielding something castable to const Surface*
Parameters
startstart iterator
endend iterator
unionStrategystrategy to apply
progressFunctionprogress function

References Union().


The documentation for this class was generated from the following file: