/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2019 Daniel Baston * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * **********************************************************************/ #ifndef GEOS_OP_UNION_COVERAGEUNION_H #define GEOS_OP_UNION_COVERAGEUNION_H #include #include #include #include namespace geos { namespace geom { class Polygon; class LineString; class GeometryFactory; } } namespace geos { namespace operation { namespace geounion { class GEOS_DLL CoverageUnion { public: static std::unique_ptr Union(const geom::Geometry* geom); private: CoverageUnion() = default; void extractSegments(const geom::Polygon* geom); void extractSegments(const geom::Geometry* geom); void extractSegments(const geom::LineString* geom); std::unique_ptr polygonize(const geom::GeometryFactory* gf); std::unordered_set segments; static constexpr double AREA_PCT_DIFF_TOL = 1e-6; }; } } } #endif