GEOS 3.10.1
GeometryCombiner.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006-2011 Refractions Research Inc.
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: geom/util/GeometryCombiner.java r320 (JTS-1.12)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_GEOM_UTIL_GEOMETRYCOMBINER_H
20#define GEOS_GEOM_UTIL_GEOMETRYCOMBINER_H
21
22#include <memory>
23#include <vector>
24
25#include <geos/export.h>
26
27// Forward declarations
28namespace geos {
29namespace geom {
30class Geometry;
31class GeometryFactory;
32}
33}
34
35namespace geos {
36namespace geom { // geos.geom
37namespace util { // geos.geom.util
38
51class GEOS_DLL GeometryCombiner {
52public:
59 static std::unique_ptr<Geometry> combine(std::vector<const Geometry*> const& geoms);
60
67 static std::unique_ptr<Geometry> combine(std::vector<std::unique_ptr<Geometry>> && geoms);
68
76 static std::unique_ptr<Geometry> combine(const Geometry* g0, const Geometry* g1);
77
85 static std::unique_ptr<Geometry> combine(std::unique_ptr<Geometry> && g0,
86 std::unique_ptr<Geometry> && g1);
87
96 static std::unique_ptr<Geometry> combine(const Geometry* g0, const Geometry* g1, const Geometry* g2);
97
106 static std::unique_ptr<Geometry> combine(std::unique_ptr<Geometry> && g0,
107 std::unique_ptr<Geometry> && g1,
108 std::unique_ptr<Geometry> && g2);
109
110private:
111 std::vector<std::unique_ptr<Geometry>> inputGeoms;
112 bool skipEmpty;
113
114public:
120 explicit GeometryCombiner(std::vector<const Geometry*> const& geoms);
121
122 explicit GeometryCombiner(std::vector<std::unique_ptr<Geometry>> && geoms);
123
130
137 std::unique_ptr<Geometry> combine();
138
142 void setSkipEmpty(bool);
143
144 // Declare type as noncopyable
145 GeometryCombiner(const GeometryCombiner& other) = delete;
146 GeometryCombiner& operator=(const GeometryCombiner& rhs) = delete;
147};
148
149} // namespace geos.geom.util
150} // namespace geos.geom
151} // namespace geos
152
153#endif
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Combines Geometrys to produce a GeometryCollection of the most appropriate type.
Definition: GeometryCombiner.h:51
static std::unique_ptr< Geometry > combine(const Geometry *g0, const Geometry *g1)
Copies two geometries and combines the result.
static std::unique_ptr< Geometry > combine(std::unique_ptr< Geometry > &&g0, std::unique_ptr< Geometry > &&g1, std::unique_ptr< Geometry > &&g2)
Combines three geometries.
GeometryFactory const * extractFactory() const
Extracts the GeometryFactory used by the geometries in a collection.
static std::unique_ptr< Geometry > combine(std::unique_ptr< Geometry > &&g0, std::unique_ptr< Geometry > &&g1)
Combines two geometries.
static std::unique_ptr< Geometry > combine(std::vector< std::unique_ptr< Geometry > > &&geoms)
Combines a collection of geometries.
static std::unique_ptr< Geometry > combine(std::vector< const Geometry * > const &geoms)
Copies a collection of geometries and combines the result.
std::unique_ptr< Geometry > combine()
Computes the combination of the input geometries to produce the most appropriate Geometry or Geometry...
static std::unique_ptr< Geometry > combine(const Geometry *g0, const Geometry *g1, const Geometry *g2)
Copies three geometries and combines the result.
void setSkipEmpty(bool)
Set a flag indicating that empty geometries should be omitted from the result.
GeometryCombiner(std::vector< const Geometry * > const &geoms)
Creates a new combiner for a collection of geometries.
Basic namespace for all GEOS functionalities.
Definition: geos.h:40