19 #ifndef GEOS_OP_UNION_UNARYUNION_H 20 #define GEOS_OP_UNION_UNARYUNION_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>
109 static std::unique_ptr<geom::Geometry>
118 : geomFact(&geomFactIn)
119 , unionFunction(&defaultUnionFunction)
127 , unionFunction(&defaultUnionFunction)
133 : geomFact(geom.getFactory())
134 , unionFunction(&defaultUnionFunction)
141 unionFunction = unionFun;
154 std::unique_ptr<geom::Geometry> Union();
158 template <
typename T>
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>
205 empty = geomFact->createEmptyGeometry();
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
227 std::vector<const geom::LineString*>
lines;
231 std::unique_ptr<geom::Geometry>
empty;
void setUnionFunction(UnionStrategy *unionFun)
UnaryUnionOp(const T &geoms, geom::GeometryFactory &geomFactIn)
UnaryUnionOp(const geom::Geometry &geom)
static std::unique_ptr< geom::Geometry > Union(const geom::Geometry &geom)
static std::unique_ptr< geom::Geometry > Union(const T &geoms)
std::unique_ptr< geom::Geometry > empty
UnaryUnionOp(const T &geoms)
Unions a collection of Geometry or a single Geometry (which may be a collection) together.
const geom::GeometryFactory * geomFact
Implementation of UnionStrategy that provides overlay using the first generation overlay routines...
Computes the geometric overlay of two Geometry.
UnionStrategy * unionFunction
std::unique_ptr< geom::Geometry > unionNoOpt(const geom::Geometry &g0)
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
std::vector< const geom::Polygon * > polygons
ClassicUnionStrategy defaultUnionFunction
std::vector< const geom::LineString * > lines
void extract(const geom::Geometry &geom)
const GeometryFactory * getFactory() const
Gets the factory which contains the context in which this geometry was created.
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
static std::unique_ptr< geom::Geometry > Union(const T &geoms, geom::GeometryFactory &geomFact)
Basic namespace for all GEOS functionalities.
void extractGeoms(const T &geoms)
std::vector< const geom::Point * > points