GEOS
3.9.1dev
|
Provides an efficient method of unioning a collection of Geometries. More...
#include <CascadedUnion.h>
Public Member Functions | |
CascadedUnion () | |
CascadedUnion (const std::vector< geom::Geometry * > *geoms) | |
geom::Geometry * | Union () |
Static Public Member Functions | |
static geom::Geometry * | Union (std::vector< geom::Geometry * > *geoms) |
template<class T > | |
static geom::Geometry * | Union (T start, T end) |
Private Member Functions | |
geom::Geometry * | unionTree (index::strtree::ItemsList *geomTree) |
geom::Geometry * | binaryUnion (GeometryListHolder *geoms) |
geom::Geometry * | binaryUnion (GeometryListHolder *geoms, std::size_t start, std::size_t end) |
GeometryListHolder * | reduceToGeometries (index::strtree::ItemsList *geomTree) |
geom::Geometry * | unionSafe (geom::Geometry *g0, geom::Geometry *g1) |
geom::Geometry * | unionOptimized (geom::Geometry *g0, geom::Geometry *g1) |
geom::Geometry * | unionUsingEnvelopeIntersection (geom::Geometry *g0, geom::Geometry *g1, geom::Envelope const &common) |
geom::Geometry * | extractByEnvelope (geom::Envelope const &env, geom::Geometry *geom, std::vector< const geom::Geometry * > &disjointGeoms) |
Static Private Member Functions | |
static geom::Geometry * | unionActual (geom::Geometry *g0, geom::Geometry *g1) |
Private Attributes | |
const std::vector< geom::Geometry * > * | inputGeoms |
geom::GeometryFactory const * | geomFactory |
Static Private Attributes | |
static int const | STRTREE_NODE_CAPACITY = 4 |
Provides an efficient method of unioning a collection of Geometries.
This algorithm is more robust than the simple iterated approach of repeatedly unioning each geometry to a result geometry.
Definition at line 55 of file CascadedUnion.h.
geos::operation::geounion::CascadedUnion::CascadedUnion | ( | ) |
|
inline |
Creates a new instance to union the given collection of geom::Geometrys.
geoms | a collection of geom::Geometrys. Ownership of elements and vector are left to caller. |
Definition at line 106 of file CascadedUnion.h.
|
private |
Unions a list of geometries by treating the list as a flattened binary tree, and performing a cascaded union on the tree.
|
private |
Unions a section of a list using a recursive binary union on each half of the section.
geoms | |
start | |
end |
|
private |
|
private |
Reduces a tree of geometries to a list of geometries by recursively unioning the subtrees in the list.
geomTree | a tree-structured list of geometries |
|
static |
Computes the union of a collection of geom::Geometrys.
geoms | a collection of geom::Geometrys. ownership of elements and vector are left to caller. |
|
inlinestatic |
Computes the union of a set of geom::Geometrys.
T | an iterator yelding something castable to const Geometry * |
start | start iterator |
end | end iterator |
Definition at line 89 of file CascadedUnion.h.
geom::Geometry* geos::operation::geounion::CascadedUnion::Union | ( | ) |
Computes the union of the input geometries.
|
staticprivate |
Encapsulates the actual unioning of two polygonal geometries.
g0 | |
g1 |
|
private |
|
private |
Computes the union of two geometries, either of both of which may be null.
g0 | a Geometry |
g1 | a Geometry |
|
private |
|
private |
Unions two geometries. The case of multi geometries is optimized to union only the components which lie in the intersection of the two geometry's envelopes. Geometrys outside this region can simply be combined with the union result, which is potentially much faster. This case is likely to occur often during cascaded union, and may also occur in real world data (such as unioning data for parcels on different street blocks).
g0 | a geometry |
g1 | a geometry |
common | the intersection of the envelopes of the inputs |
|
private |
Definition at line 58 of file CascadedUnion.h.
|
private |
Definition at line 57 of file CascadedUnion.h.
|
staticprivate |
The effectiveness of the index is somewhat sensitive to the node capacity. Testing indicates that a smaller capacity is better. For an STRtree, 4 is probably a good number (since this produces 2x2 "squares").
Definition at line 67 of file CascadedUnion.h.