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
28 namespace geos {
29 namespace geom {
30 class Geometry;
31 class GeometryFactory;
32 }
33 }
34 
35 namespace geos {
36 namespace geom { // geos.geom
37 namespace util { // geos.geom.util
38 
51 class GEOS_DLL GeometryCombiner {
52 public:
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 
110 private:
111  std::vector<std::unique_ptr<Geometry>> inputGeoms;
112  bool skipEmpty;
113 
114 public:
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(std::vector< const Geometry * > const &geoms)
Copies a collection of geometries and combines the result.
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(const Geometry *g0, const Geometry *g1)
Copies two geometries and combines the result.
static std::unique_ptr< Geometry > combine(const Geometry *g0, const Geometry *g1, const Geometry *g2)
Copies three 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.
std::unique_ptr< Geometry > combine()
Computes the combination of the input geometries to produce the most appropriate Geometry or Geometry...
void setSkipEmpty(bool)
Set a flag indicating that empty geometries should be omitted from the result.
static std::unique_ptr< Geometry > combine(std::vector< std::unique_ptr< Geometry >> &&geoms)
Combines a collection of geometries.
GeometryCombiner(std::vector< const Geometry * > const &geoms)
Creates a new combiner for a collection of geometries.
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26