24#include <geos/export.h>
25#include <geos/geom/GeometryFactory.h>
26#include <geos/geom/Point.h>
27#include <geos/geom/LineString.h>
28#include <geos/geom/Polygon.h>
29#include <geos/geom/util/GeometryExtracter.h>
30#include <geos/operation/overlay/OverlayOp.h>
31#include <geos/operation/union/CascadedPolygonUnion.h>
35#pragma warning(disable: 4251)
91 static std::unique_ptr<geom::Geometry>
99 static std::unique_ptr<geom::Geometry>
100 Union(
const T& geoms,
107 static std::unique_ptr<geom::Geometry>
116 : geomFact(&geomFactIn)
117 , unionFunction(&defaultUnionFunction)
125 , unionFunction(&defaultUnionFunction)
132 , unionFunction(&defaultUnionFunction)
139 unionFunction = unionFun;
152 std::unique_ptr<geom::Geometry>
Union();
156 template <
typename T>
158 extractGeoms(
const T& geoms)
160 for(
typename T::const_iterator
173 using namespace geom::util;
179 GeometryExtracter::extract<geom::Polygon>(geom, polygons);
180 GeometryExtracter::extract<geom::LineString>(geom, lines);
181 GeometryExtracter::extract<geom::Point>(geom, points);
196 std::unique_ptr<geom::Geometry>
197 unionNoOpt(
const geom::Geometry& g0)
204 return unionFunction->Union(&g0, empty.get());
216 std::unique_ptr<geom::Geometry> unionWithNull(
217 std::unique_ptr<geom::Geometry> g0,
218 std::unique_ptr<geom::Geometry> g1
222 std::vector<const geom::Polygon*> polygons;
223 std::vector<const geom::LineString*> lines;
224 std::vector<const geom::Point*> points;
226 const geom::GeometryFactory* geomFact;
227 std::unique_ptr<geom::Geometry> empty;
229 UnionStrategy* unionFunction;
230 ClassicUnionStrategy defaultUnionFunction;
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:66
std::unique_ptr< Geometry > createEmptyGeometry() const
Construct the EMPTY Geometry.
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
const GeometryFactory * getFactory() const
Gets the factory which contains the context in which this geometry was created.
Definition: Geometry.h:216
Unions a collection of Geometry or a single Geometry (which may be a collection) together.
Definition: UnaryUnionOp.h:87
std::unique_ptr< geom::Geometry > Union()
Gets the union of the input geometries.
Definition: UnionStrategy.h:40
Computes the geometric overlay of two Geometry.
Definition: OverlayOp.h:69
Basic namespace for all GEOS functionalities.
Definition: geos.h:39