GEOS 3.11.1
union/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#pragma once
16
17#include <geos/geom/LineSegment.h>
18#include <geos/geom/Geometry.h>
19
20#include <memory>
21#include <unordered_set>
22
23namespace geos {
24 namespace geom {
25 class Polygon;
26 class LineString;
27 class GeometryFactory;
28 }
29}
30
31namespace geos {
32namespace operation {
33namespace geounion {
34
35 class GEOS_DLL CoverageUnion {
36 public:
37 static std::unique_ptr<geom::Geometry> Union(const geom::Geometry* geom);
38
39 private:
40 CoverageUnion() = default;
41
42 void extractSegments(const geom::Polygon* geom);
43 void extractSegments(const geom::Geometry* geom);
44 void extractSegments(const geom::LineString* geom);
45
46 std::unique_ptr<geom::Geometry> polygonize(const geom::GeometryFactory* gf);
47 std::unordered_set<geos::geom::LineSegment, geos::geom::LineSegment::HashCode> segments;
48 static constexpr double AREA_PCT_DIFF_TOL = 1e-6;
49 };
50
51}
52}
53}
Basic namespace for all GEOS functionalities.
Definition: geos.h:39