GEOS  3.9.1dev
CoverageUnion.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2019 Daniel Baston <dbaston@gmail.com>
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 #ifndef GEOS_OP_UNION_COVERAGEUNION_H
16 #define GEOS_OP_UNION_COVERAGEUNION_H
17 
18 #include <geos/geom/LineSegment.h>
19 #include <geos/geom/Geometry.h>
20 
21 #include <memory>
22 #include <unordered_set>
23 
24 namespace geos {
25  namespace geom {
26  class Polygon;
27  class LineString;
28  class GeometryFactory;
29  }
30 }
31 
32 namespace geos {
33 namespace operation {
34 namespace geounion {
35 
37  public:
38  static std::unique_ptr<geom::Geometry> Union(const geom::Geometry* geom);
39 
40  private:
41  CoverageUnion() = default;
42 
43  void extractSegments(const geom::Polygon* geom);
44  void extractSegments(const geom::Geometry* geom);
45  void extractSegments(const geom::LineString* geom);
46 
47  std::unique_ptr<geom::Geometry> polygonize(const geom::GeometryFactory* gf);
48  std::unordered_set<geos::geom::LineSegment, geos::geom::LineSegment::HashCode> segments;
49  static constexpr double AREA_PCT_DIFF_TOL = 1e-6;
50  };
51 
52 }
53 }
54 }
55 
56 #endif
#define GEOS_DLL
Definition: export.h:28
std::unordered_set< geos::geom::LineSegment, geos::geom::LineSegment::HashCode > segments
Definition: CoverageUnion.h:48
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Represents a linear polygon, which may include holes.
Definition: Polygon.h:64
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Basic namespace for all GEOS functionalities.