GEOS 3.14.0dev
CoverageSimplifier.h
1
2/**********************************************************************
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.osgeo.org
6 *
7 * Copyright (C) 2023 Paul Ramsey <pramsey@cleverelephant.ca>
8 * Copyright (c) 2023 Martin Davis.
9 *
10 * This is free software; you can redistribute and/or modify it under
11 * the terms of the GNU Lesser General Public Licence as published
12 * by the Free Software Foundation.
13 * See the COPYING file for more information.
14 *
15 **********************************************************************/
16
17#pragma once
18
19#include <vector>
20#include <memory>
21#include <geos/export.h>
22
23
24namespace geos {
25namespace geom {
26class Geometry;
27class GeometryFactory;
28class MultiLineString;
29}
30namespace coverage {
31class CoverageEdge;
32}
33}
34
35namespace geos {
36namespace coverage { // geos::coverage
37
69class GEOS_DLL CoverageSimplifier {
74
75public:
76
82 CoverageSimplifier(const std::vector<const Geometry*>& coverage);
83
92 static std::vector<std::unique_ptr<Geometry>> simplify(
93 std::vector<const Geometry*>& coverage,
94 double tolerance);
95
96 static std::vector<std::unique_ptr<Geometry>> simplify(
97 const std::vector<std::unique_ptr<Geometry>>& coverage,
98 double tolerance);
99
109 static std::vector<std::unique_ptr<Geometry>> simplifyInner(
110 std::vector<const Geometry*>& coverage,
111 double tolerance);
112
113 static std::vector<std::unique_ptr<Geometry>> simplifyInner(
114 const std::vector<std::unique_ptr<Geometry>>& coverage,
115 double tolerance);
116
123 std::vector<std::unique_ptr<Geometry>> simplify(
124 double tolerance);
125
134 std::vector<std::unique_ptr<Geometry>> simplifyInner(
135 double tolerance);
136
137
138private:
139
140 // Members
141 const std::vector<const Geometry*>& m_input;
142 const GeometryFactory* m_geomFactory;
143
144 // Methods
145 void simplifyEdges(
146 std::vector<CoverageEdge*> edges,
147 const MultiLineString* constraints,
148 double tolerance);
149
150 void setCoordinates(
151 std::vector<CoverageEdge*>& edges,
152 const MultiLineString* lines);
153
154 std::vector<bool> getFreeRings(
155 const std::vector<CoverageEdge*>& edges) const;
156
157
158}; // CoverageSimplifier
159
160
161} // geos::coverage
162} // geos
Definition CoverageEdge.h:46
Definition CoverageSimplifier.h:69
static std::vector< std::unique_ptr< Geometry > > simplifyInner(std::vector< const Geometry * > &coverage, double tolerance)
static std::vector< std::unique_ptr< Geometry > > simplify(std::vector< const Geometry * > &coverage, double tolerance)
CoverageSimplifier(const std::vector< const Geometry * > &coverage)
std::vector< std::unique_ptr< Geometry > > simplify(double tolerance)
std::vector< std::unique_ptr< Geometry > > simplifyInner(double tolerance)
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Models a collection of LineStrings.
Definition MultiLineString.h:49
Basic namespace for all GEOS functionalities.
Definition geos.h:39