GEOS 3.11.1
Public Member Functions | Static Public Member Functions | List of all members
geos::geom::util::GeometryCombiner Class Reference

Combines Geometrys to produce a GeometryCollection of the most appropriate type. More...

#include <GeometryCombiner.h>

Public Member Functions

 GeometryCombiner (std::vector< const Geometry * > const &geoms)
 Creates a new combiner for a collection of geometries. More...
 
 GeometryCombiner (std::vector< std::unique_ptr< Geometry > > &&geoms)
 
GeometryFactory const * extractFactory () const
 Extracts the GeometryFactory used by the geometries in a collection. More...
 
std::unique_ptr< Geometrycombine ()
 Computes the combination of the input geometries to produce the most appropriate Geometry or GeometryCollection. More...
 
void setSkipEmpty (bool)
 Set a flag indicating that empty geometries should be omitted from the result.
 
 GeometryCombiner (const GeometryCombiner &other)=delete
 
GeometryCombineroperator= (const GeometryCombiner &rhs)=delete
 

Static Public Member Functions

static std::unique_ptr< Geometrycombine (std::vector< const Geometry * > const &geoms)
 Copies a collection of geometries and combines the result. More...
 
static std::unique_ptr< Geometrycombine (std::vector< std::unique_ptr< Geometry > > &&geoms)
 Combines a collection of geometries. More...
 
static std::unique_ptr< Geometrycombine (const Geometry *g0, const Geometry *g1)
 Copies two geometries and combines the result. More...
 
static std::unique_ptr< Geometrycombine (std::unique_ptr< Geometry > &&g0, std::unique_ptr< Geometry > &&g1)
 Combines two geometries. More...
 
static std::unique_ptr< Geometrycombine (const Geometry *g0, const Geometry *g1, const Geometry *g2)
 Copies three geometries and combines the result. More...
 
static std::unique_ptr< Geometrycombine (std::unique_ptr< Geometry > &&g0, std::unique_ptr< Geometry > &&g1, std::unique_ptr< Geometry > &&g2)
 Combines three geometries. More...
 

Detailed Description

Combines Geometrys 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
GeometryFactory::buildGeometry

Constructor & Destructor Documentation

◆ GeometryCombiner()

geos::geom::util::GeometryCombiner::GeometryCombiner ( std::vector< const Geometry * > const &  geoms)
explicit

Creates a new combiner for a collection of geometries.

Parameters
geomsthe geometries to combine

Member Function Documentation

◆ combine() [1/7]

std::unique_ptr< Geometry > geos::geom::util::GeometryCombiner::combine ( )

Computes the combination of the input geometries to produce the most appropriate Geometry or GeometryCollection.

Returns
a Geometry which is the combination of the inputs

◆ combine() [2/7]

static std::unique_ptr< Geometry > geos::geom::util::GeometryCombiner::combine ( const Geometry g0,
const Geometry g1 
)
static

Copies two geometries and combines the result.

Parameters
g0a geometry to combine (ownership left to caller)
g1a geometry to combine (ownership left to caller)
Returns
the combined geometry

◆ combine() [3/7]

static std::unique_ptr< Geometry > geos::geom::util::GeometryCombiner::combine ( const Geometry g0,
const Geometry g1,
const Geometry g2 
)
static

Copies three geometries and combines the result.

Parameters
g0a geometry to combine (ownership left to caller)
g1a geometry to combine (ownership left to caller)
g2a geometry to combine (ownership left to caller)
Returns
the combined geometry

◆ combine() [4/7]

static std::unique_ptr< Geometry > geos::geom::util::GeometryCombiner::combine ( std::unique_ptr< Geometry > &&  g0,
std::unique_ptr< Geometry > &&  g1 
)
static

Combines two geometries.

Parameters
g0a geometry to combine (ownership transferred to combined geometry)
g1a geometry to combine (ownership transferred to combined geometry)
Returns
the combined geometry

◆ combine() [5/7]

static std::unique_ptr< Geometry > geos::geom::util::GeometryCombiner::combine ( std::unique_ptr< Geometry > &&  g0,
std::unique_ptr< Geometry > &&  g1,
std::unique_ptr< Geometry > &&  g2 
)
static

Combines three geometries.

Parameters
g0a geometry to combine (ownership transferred to combined geometry)
g1a geometry to combine (ownership transferred to combined geometry)
g2a geometry to combine (ownership transferred to combined geometry)
Returns
the combined geometry

◆ combine() [6/7]

static std::unique_ptr< Geometry > geos::geom::util::GeometryCombiner::combine ( std::vector< const Geometry * > const &  geoms)
static

Copies a collection of geometries and combines the result.

Parameters
geomsthe geometries to combine (ownership left to caller)
Returns
the combined geometry

◆ combine() [7/7]

static std::unique_ptr< Geometry > geos::geom::util::GeometryCombiner::combine ( std::vector< std::unique_ptr< Geometry > > &&  geoms)
static

Combines a collection of geometries.

Parameters
geomsthe geometries to combine (ownership transferred to combined geometry)
Returns
the combined geometry

◆ extractFactory()

GeometryFactory const * geos::geom::util::GeometryCombiner::extractFactory ( ) const

Extracts the GeometryFactory used by the geometries in a collection.

Returns
a GeometryFactory

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