24 #include <geos/export.h>
25 #include <geos/geom/GeometryFactory.h>
26 #include <geos/geom/Point.h>
27 #include <geos/geom/LineString.h>
28 #include <geos/geom/Polygon.h>
29 #include <geos/geom/util/GeometryExtracter.h>
30 #include <geos/operation/union/CascadedPolygonUnion.h>
32 #include <geos/util.h>
36 #pragma warning(disable: 4251)
42 class GeometryFactory;
92 static std::unique_ptr<geom::Geometry>
100 static std::unique_ptr<geom::Geometry>
101 Union(
const T& geoms,
108 static std::unique_ptr<geom::Geometry>
117 : geomFact(&geomFactIn)
118 , unionFunction(&defaultUnionFunction)
126 , unionFunction(&defaultUnionFunction)
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);
176 using namespace geom::util;
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;
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:70
std::unique_ptr< Geometry > createEmptyGeometry(GeometryTypeId type=GEOS_GEOMETRYCOLLECTION, bool hasZ=false, bool hasM=false) const
Construct the EMPTY Geometry.
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
const GeometryFactory * getFactory() const
Gets the factory which contains the context in which this geometry was created.
Definition: Geometry.h:227
Unions a collection of Geometry or a single Geometry (which may be a collection) together.
Definition: UnaryUnionOp.h:88
std::unique_ptr< geom::Geometry > Union()
Gets the union of the input geometries.
Definition: UnionStrategy.h:40
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25