GEOS  3.9.1dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
geos::operation::geounion::UnaryUnionOp Class Reference

Unions a collection of Geometry or a single Geometry (which may be a collection) together. More...

#include <UnaryUnionOp.h>

Collaboration diagram for geos::operation::geounion::UnaryUnionOp:
[legend]

Public Member Functions

template<class T >
 UnaryUnionOp (const T &geoms, geom::GeometryFactory &geomFactIn)
 
template<class T >
 UnaryUnionOp (const T &geoms)
 
 UnaryUnionOp (const geom::Geometry &geom)
 
void setUnionFunction (UnionStrategy *unionFun)
 
std::unique_ptr< geom::GeometryUnion ()
 Gets the union of the input geometries. More...
 

Static Public Member Functions

template<typename T >
static std::unique_ptr< geom::GeometryUnion (const T &geoms)
 
template<class T >
static std::unique_ptr< geom::GeometryUnion (const T &geoms, geom::GeometryFactory &geomFact)
 
static std::unique_ptr< geom::GeometryUnion (const geom::Geometry &geom)
 

Private Member Functions

template<typename T >
void extractGeoms (const T &geoms)
 
void extract (const geom::Geometry &geom)
 
std::unique_ptr< geom::GeometryunionNoOpt (const geom::Geometry &g0)
 
std::unique_ptr< geom::GeometryunionWithNull (std::unique_ptr< geom::Geometry > g0, std::unique_ptr< geom::Geometry > g1)
 

Private Attributes

std::vector< const geom::Polygon * > polygons
 
std::vector< const geom::LineString * > lines
 
std::vector< const geom::Point * > points
 
const geom::GeometryFactorygeomFact
 
std::unique_ptr< geom::Geometryempty
 
UnionStrategyunionFunction
 
ClassicUnionStrategy defaultUnionFunction
 

Detailed Description

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. Heterogeneous 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.)

Definition at line 89 of file UnaryUnionOp.h.

Constructor & Destructor Documentation

template<class T >
geos::operation::geounion::UnaryUnionOp::UnaryUnionOp ( const T &  geoms,
geom::GeometryFactory geomFactIn 
)
inline

Definition at line 117 of file UnaryUnionOp.h.

template<class T >
geos::operation::geounion::UnaryUnionOp::UnaryUnionOp ( const T &  geoms)
inline

Definition at line 125 of file UnaryUnionOp.h.

geos::operation::geounion::UnaryUnionOp::UnaryUnionOp ( const geom::Geometry geom)
inline

Definition at line 132 of file UnaryUnionOp.h.

Member Function Documentation

void geos::operation::geounion::UnaryUnionOp::extract ( const geom::Geometry geom)
inlineprivate

Definition at line 173 of file UnaryUnionOp.h.

References geos::geom::Geometry::getFactory().

Here is the call graph for this function:

template<typename T >
void geos::operation::geounion::UnaryUnionOp::extractGeoms ( const T &  geoms)
inlineprivate

Definition at line 160 of file UnaryUnionOp.h.

void geos::operation::geounion::UnaryUnionOp::setUnionFunction ( UnionStrategy unionFun)
inline

Definition at line 139 of file UnaryUnionOp.h.

template<typename T >
static std::unique_ptr<geom::Geometry> geos::operation::geounion::UnaryUnionOp::Union ( const T &  geoms)
inlinestatic

Definition at line 94 of file UnaryUnionOp.h.

References Union().

Referenced by Union().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
static std::unique_ptr<geom::Geometry> geos::operation::geounion::UnaryUnionOp::Union ( const T &  geoms,
geom::GeometryFactory geomFact 
)
inlinestatic

Definition at line 102 of file UnaryUnionOp.h.

References Union().

Here is the call graph for this function:

static std::unique_ptr<geom::Geometry> geos::operation::geounion::UnaryUnionOp::Union ( const geom::Geometry geom)
inlinestatic

Definition at line 110 of file UnaryUnionOp.h.

References Union().

Here is the call graph for this function:

std::unique_ptr<geom::Geometry> geos::operation::geounion::UnaryUnionOp::Union ( )

Gets the union of the input geometries.

If no input geometries were provided, an empty GEOMETRYCOLLECTION is returned.

Returns
a Geometry containing the union
an empty GEOMETRYCOLLECTION if no geometries were provided in the input
std::unique_ptr<geom::Geometry> geos::operation::geounion::UnaryUnionOp::unionNoOpt ( const geom::Geometry g0)
inlineprivate

Computes a unary union with no extra optimization, and no short-circuiting. Due to the way the overlay operations are implemented, this is still efficient in the case of linear and puntal geometries. Uses robust version of overlay operation to ensure identical behaviour to the union(Geometry) operation.

Parameters
g0a geometry
Returns
the union of the input geometry

Definition at line 199 of file UnaryUnionOp.h.

std::unique_ptr<geom::Geometry> geos::operation::geounion::UnaryUnionOp::unionWithNull ( std::unique_ptr< geom::Geometry g0,
std::unique_ptr< geom::Geometry g1 
)
private

Computes the union of two geometries, either of both of which may be null.

Parameters
g0a Geometry (ownership transferred)
g1a Geometry (ownership transferred)
Returns
the union of the input(s)
null if both inputs are null

Member Data Documentation

ClassicUnionStrategy geos::operation::geounion::UnaryUnionOp::defaultUnionFunction
private

Definition at line 234 of file UnaryUnionOp.h.

std::unique_ptr<geom::Geometry> geos::operation::geounion::UnaryUnionOp::empty
private

Definition at line 231 of file UnaryUnionOp.h.

const geom::GeometryFactory* geos::operation::geounion::UnaryUnionOp::geomFact
private

Definition at line 230 of file UnaryUnionOp.h.

std::vector<const geom::LineString*> geos::operation::geounion::UnaryUnionOp::lines
private

Definition at line 227 of file UnaryUnionOp.h.

std::vector<const geom::Point*> geos::operation::geounion::UnaryUnionOp::points
private

Definition at line 228 of file UnaryUnionOp.h.

std::vector<const geom::Polygon*> geos::operation::geounion::UnaryUnionOp::polygons
private

Definition at line 226 of file UnaryUnionOp.h.

UnionStrategy* geos::operation::geounion::UnaryUnionOp::unionFunction
private

Definition at line 233 of file UnaryUnionOp.h.


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