89class GEOS_DLL UnaryUnionOp {
93 static std::unique_ptr<geom::Geometry>
96 UnaryUnionOp op(geoms);
98 return op.Union(progressFunction);
102 static std::unique_ptr<geom::Geometry>
103 Union(
const T& geoms,
106 UnaryUnionOp op(geoms, geomFact);
108 return op.Union(progressFunction);
111 static std::unique_ptr<geom::Geometry>
114 UnaryUnionOp op(
geom);
115 return op.Union(progressFunction);
120 : geomFact(&geomFactIn)
121 , unionFunction(&defaultUnionFunction)
127 UnaryUnionOp(
const T& geoms)
129 , unionFunction(&defaultUnionFunction)
135 : geomFact(
geom.getFactory())
136 , unionFunction(&defaultUnionFunction)
143 unionFunction = unionFun;
160 template <
typename T>
162 extractGeoms(
const T& geoms)
164 for(
typename T::const_iterator
177 util::ensureNoCurvedComponents(
geom);
182 geomFact =
geom.getFactory();
185 GeometryExtracter::extract<geom::Polygon>(
geom, polygons);
186 GeometryExtracter::extract<geom::LineString>(
geom, lines);
187 GeometryExtracter::extract<geom::Point>(
geom, points);
202 std::unique_ptr<geom::Geometry>
203 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;