19 #ifndef GEOS_OP_UNION_UNARYUNION_H
20 #define GEOS_OP_UNION_UNARYUNION_H
25 #include <geos/export.h>
26 #include <geos/geom/GeometryFactory.h>
27 #include <geos/geom/Point.h>
28 #include <geos/geom/LineString.h>
29 #include <geos/geom/Polygon.h>
30 #include <geos/geom/util/GeometryExtracter.h>
31 #include <geos/operation/overlay/OverlayOp.h>
32 #include <geos/operation/union/CascadedPolygonUnion.h>
37 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
43 class GeometryFactory;
93 static std::unique_ptr<geom::Geometry>
101 static std::unique_ptr<geom::Geometry>
102 Union(
const T& geoms,
109 static std::unique_ptr<geom::Geometry>
118 : geomFact(&geomFactIn)
119 , unionFunction(&defaultUnionFunction)
127 , unionFunction(&defaultUnionFunction)
134 , unionFunction(&defaultUnionFunction)
141 unionFunction = unionFun;
154 std::unique_ptr<geom::Geometry>
Union();
158 template <
typename T>
160 extractGeoms(
const T& geoms)
162 for(
typename T::const_iterator
175 using namespace geom::util;
181 GeometryExtracter::extract<geom::Polygon>(geom, polygons);
182 GeometryExtracter::extract<geom::LineString>(geom, lines);
183 GeometryExtracter::extract<geom::Point>(geom, points);
198 std::unique_ptr<geom::Geometry>
199 unionNoOpt(
const geom::Geometry& g0)
208 return unionFunction->Union(&g0, empty.get());
220 std::unique_ptr<geom::Geometry> unionWithNull(
221 std::unique_ptr<geom::Geometry> g0,
222 std::unique_ptr<geom::Geometry> g1
226 std::vector<const geom::Polygon*> polygons;
227 std::vector<const geom::LineString*> lines;
228 std::vector<const geom::Point*> points;
230 const geom::GeometryFactory* geomFact;
231 std::unique_ptr<geom::Geometry> empty;
233 UnionStrategy* unionFunction;
234 ClassicUnionStrategy defaultUnionFunction;