GEOS 3.9.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// Forward declarations
26namespace geos {
27namespace geom {
28class Geometry;
29class GeometryFactory;
30}
31}
32
33namespace geos {
34namespace geom { // geos.geom
35namespace util { // geos.geom.util
36
50public:
57 static std::unique_ptr<Geometry> combine(std::vector<const Geometry*> const& geoms);
58 static std::unique_ptr<Geometry> combine(std::vector<std::unique_ptr<Geometry>> const& geoms);
59
67 static std::unique_ptr<Geometry> combine(const Geometry* g0, const Geometry* g1);
68
77 static std::unique_ptr<Geometry> combine(const Geometry* g0, const Geometry* g1, const Geometry* g2);
78
79private:
80 GeometryFactory const* geomFactory;
81 bool skipEmpty;
82 std::vector<const Geometry*> const& inputGeoms;
83
84public:
90 GeometryCombiner(std::vector<const Geometry*> const& geoms);
91
98 static GeometryFactory const* extractFactory(std::vector<const Geometry*> const& geoms);
99
106 std::unique_ptr<Geometry> combine();
107
108private:
109 void extractElements(const Geometry* geom, std::vector<const Geometry*>& elems);
110
111 // Declare type as noncopyable
112 GeometryCombiner(const GeometryCombiner& other) = delete;
113 GeometryCombiner& operator=(const GeometryCombiner& rhs) = delete;
114};
115
116} // namespace geos.geom.util
117} // namespace geos.geom
118} // namespace geos
119
120#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:49
static std::unique_ptr< Geometry > combine(const Geometry *g0, const Geometry *g1)
Combines two geometries.
static GeometryFactory const * extractFactory(std::vector< const Geometry * > const &geoms)
Extracts the GeometryFactory used by the geometries in a collection.
static std::unique_ptr< Geometry > combine(std::vector< const Geometry * > const &geoms)
Combines a collection of geometries.
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)
Combines three geometries.
GeometryCombiner(std::vector< const Geometry * > const &geoms)
Creates a new combiner for a collection of geometries.
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26