18#include <geos/index/strtree/TemplateSTRtree.h>
19#include <geos/coverage/CleanCoverage.h>
20#include <geos/geom/Envelope.h>
21#include <geos/constants.h>
22#include <geos/export.h>
154 std::vector<const Geometry*> coverage;
155 const GeometryFactory* geomFactory;
156 double snappingDistance;
158 double gapMaximumWidth = 0.0;
160 std::unique_ptr<index::strtree::TemplateSTRtree<std::size_t>> covIndex;
161 std::vector<std::unique_ptr<Polygon>> resultants;
162 std::unique_ptr<CleanCoverage> cleanCov;
163 std::map<std::size_t, std::vector<std::size_t>> overlapParentMap;
164 std::vector<const Polygon*> overlaps;
165 std::vector<const Polygon*> gaps;
166 std::vector<const Polygon*> mergableGaps;
168 static constexpr double DEFAULT_SNAPPING_FACTOR = 1.0e8;
171 static double computeDefaultSnappingDistance(
172 std::vector<const Geometry*>& geoms);
174 static Envelope extent(std::vector<const Geometry*>& geoms);
177 std::map<std::size_t, std::vector<std::size_t>>& overlapMap);
179 std::unique_ptr<CleanCoverage::MergeStrategy> mergeStrategy(
180 int mergeStrategyId);
182 void computeResultants(
double tolerance);
184 void createCoverageIndex();
186 void classifyResult(std::vector<std::unique_ptr<Polygon>>& rs);
188 void classifyResultant(std::size_t resultIndex,
const Polygon* resPoly);
190 static bool covers(
const Geometry* poly,
const Point* intPt);
192 std::vector<const Polygon*> findMergableGaps(
193 std::vector<const Polygon*> gaps);
195 bool isMergableGap(
const Polygon* gap);
197 static std::vector<std::unique_ptr<geom::Polygon>> polygonize(
198 const Geometry* cleanEdges);
200 static bool isPolygonal(
const Geometry*
geom);
202 static std::vector<const Polygon*> toPolygonArray(
203 const Geometry*
geom);
225 static std::vector<std::unique_ptr<Geometry>>
clean(
226 std::vector<const Geometry*>& coverage,
240 static std::vector<std::unique_ptr<Geometry>>
clean(
241 std::vector<const Geometry*>& coverage,
255 std::vector<const Geometry*>& coverage,
269 std::vector<const Geometry*>& coverage,
326 std::unique_ptr<Geometry> toGeometry(
327 std::vector<SegmentString*>& segStrings,
328 const GeometryFactory* geomFact);
330 std::unique_ptr<Geometry> node(
331 std::vector<const Geometry*>& coverage,
332 double snapDistance);
static constexpr int MERGE_MAX_AREA
Definition CoverageCleaner.h:146
void setGapMaximumWidth(double maxWidth)
static constexpr int MERGE_MIN_AREA
Definition CoverageCleaner.h:148
static std::vector< std::unique_ptr< Geometry > > clean(std::vector< const Geometry * > &coverage, double snapDistance, double maxWidth)
std::vector< const Polygon * > getMergedGaps()
static constexpr int MERGE_LONGEST_BORDER
Definition CoverageCleaner.h:144
static std::vector< std::unique_ptr< Geometry > > clean(std::vector< const Geometry * > &coverage, double snapDistance, int mergeStrategy, double maxWidth)
CoverageCleaner(std::vector< const Geometry * > &coverage)
static constexpr int MERGE_MIN_INDEX
Definition CoverageCleaner.h:150
CoverageCleaner(const CoverageCleaner &)=delete
void setOverlapMergeStrategy(int mergeStrategy)
std::vector< const Polygon * > getOverlaps()
static std::vector< std::unique_ptr< Geometry > > cleanGapWidth(std::vector< const Geometry * > &coverage, double maxWidth)
static std::vector< std::unique_ptr< Geometry > > cleanOverlapGap(std::vector< const Geometry * > &coverage, int mergeStrategy, double maxWidth)
std::vector< std::unique_ptr< Geometry > > getResult()
void setSnappingDistance(double snapDistance)
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
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:196
Definition LineString.h:66
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:47
Provides classes for various kinds of spatial indexes.
Definition CleanCoverage.h:39
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition CoverageCleaner.h:42
Basic namespace for all GEOS functionalities.
Definition geos.h:38