88class GEOS_DLL UnaryUnionOp {
92 static std::unique_ptr<geom::Geometry>
95 UnaryUnionOp op(geoms);
100 static std::unique_ptr<geom::Geometry>
101 Union(
const T& geoms,
104 UnaryUnionOp op(geoms, geomFact);
108 static std::unique_ptr<geom::Geometry>
111 UnaryUnionOp op(
geom);
117 : geomFact(&geomFactIn)
118 , unionFunction(&defaultUnionFunction)
124 UnaryUnionOp(
const T& geoms)
126 , unionFunction(&defaultUnionFunction)
132 : geomFact(
geom.getFactory())
133 , unionFunction(&defaultUnionFunction)
140 unionFunction = unionFun;
153 std::unique_ptr<geom::Geometry>
Union();
157 template <
typename T>
159 extractGeoms(
const T& geoms)
161 for(
typename T::const_iterator
174 util::ensureNoCurvedComponents(
geom);
179 geomFact =
geom.getFactory();
182 GeometryExtracter::extract<geom::Polygon>(
geom, polygons);
183 GeometryExtracter::extract<geom::LineString>(
geom, lines);
184 GeometryExtracter::extract<geom::Point>(
geom, points);
199 std::unique_ptr<geom::Geometry>
200 unionNoOpt(
const geom::Geometry& g0)
205 return unionFunction->Union(&g0, empty.get());
217 std::unique_ptr<geom::Geometry> unionWithNull(
218 std::unique_ptr<geom::Geometry> g0,
219 std::unique_ptr<geom::Geometry> g1
223 std::vector<const geom::Polygon*> polygons;
224 std::vector<const geom::LineString*> lines;
225 std::vector<const geom::Point*> points;
227 const geom::GeometryFactory* geomFact;
228 std::unique_ptr<geom::Geometry> empty;
230 UnionStrategy* unionFunction;
231 ClassicUnionStrategy defaultUnionFunction;