20 #ifndef GEOS_OP_UNION_UNARYUNION_H
21 #define GEOS_OP_UNION_UNARYUNION_H
26 #include <geos/export.h>
27 #include <geos/geom/GeometryFactory.h>
28 #include <geos/geom/Point.h>
29 #include <geos/geom/LineString.h>
30 #include <geos/geom/Polygon.h>
31 #include <geos/geom/util/GeometryExtracter.h>
32 #include <geos/operation/overlay/snap/SnapIfNeededOverlayOp.h>
36 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
42 class GeometryFactory;
89 static std::auto_ptr<geom::Geometry> Union(
const T& geoms)
96 static std::auto_ptr<geom::Geometry> Union(
const T& geoms,
103 static std::auto_ptr<geom::Geometry> Union(
const geom::Geometry& geom)
112 geomFact(&geomFactIn)
142 std::auto_ptr<geom::Geometry> Union();
146 template <
typename T>
147 void extractGeoms(
const T& geoms)
149 for (
typename T::const_iterator
162 using namespace geom::util;
164 if ( ! geomFact ) geomFact = geom.
getFactory();
166 GeometryExtracter::extract<geom::Polygon>(geom, polygons);
167 GeometryExtracter::extract<geom::LineString>(geom, lines);
168 GeometryExtracter::extract<geom::Point>(geom, points);
183 std::auto_ptr<geom::Geometry> unionNoOpt(
const geom::Geometry& g0)
188 if ( ! empty.get() ) {
191 return SnapIfNeededOverlayOp::overlayOp(g0, *empty, OverlayOp::opUNION);
203 std::auto_ptr<geom::Geometry> unionWithNull(std::auto_ptr<geom::Geometry> g0,
204 std::auto_ptr<geom::Geometry> g1);
206 std::vector<const geom::Polygon*> polygons;
207 std::vector<const geom::LineString*> lines;
208 std::vector<const geom::Point*> points;
212 std::auto_ptr<geom::Geometry> empty;