GEOS  3.9.0dev
CoverageUnion.h
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 
36  class GEOS_DLL CoverageUnion {
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
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26