86class GEOS_DLL UnaryUnionOp {
90 static std::unique_ptr<geom::Geometry>
93 UnaryUnionOp op(geoms);
98 static std::unique_ptr<geom::Geometry>
102 UnaryUnionOp op(geoms, geomFact);
106 static std::unique_ptr<geom::Geometry>
109 UnaryUnionOp op(
geom);
115 : geomFact(&geomFactIn)
116 , unionFunction(&defaultUnionFunction)
122 UnaryUnionOp(
const T& geoms)
124 , unionFunction(&defaultUnionFunction)
130 : geomFact(
geom.getFactory())
131 , unionFunction(&defaultUnionFunction)
138 unionFunction = unionFun;
151 std::unique_ptr<geom::Geometry>
Union();
155 template <
typename T>
157 extractGeoms(
const T& geoms)
159 for(
typename T::const_iterator
175 geomFact =
geom.getFactory();
178 GeometryExtracter::extract<geom::Polygon>(
geom, polygons);
179 GeometryExtracter::extract<geom::LineString>(
geom, lines);
180 GeometryExtracter::extract<geom::Point>(
geom, points);
195 std::unique_ptr<geom::Geometry>
196 unionNoOpt(
const geom::Geometry& g0)
201 return unionFunction->Union(&g0, empty.get());
213 std::unique_ptr<geom::Geometry> unionWithNull(
214 std::unique_ptr<geom::Geometry> g0,
215 std::unique_ptr<geom::Geometry> g1
219 std::vector<const geom::Polygon*> polygons;
220 std::vector<const geom::LineString*> lines;
221 std::vector<const geom::Point*> points;
223 const geom::GeometryFactory* geomFact;
224 std::unique_ptr<geom::Geometry> empty;
226 UnionStrategy* unionFunction;
227 ClassicUnionStrategy defaultUnionFunction;