17#include <geos/geom/Coordinate.h>
18#include <geos/geom/CoordinateSequence.h>
19#include <geos/algorithm/LineIntersector.h>
20#include <geos/noding/SegmentIntersector.h>
21#include <geos/noding/BasicSegmentString.h>
22#include <geos/noding/SegmentSetMutualIntersector.h>
23#include <geos/constants.h>
69class GEOS_DLL PolygonHoleJoiner {
78 std::unique_ptr<CoordinateSequence> shellRing;
79 std::vector<std::unique_ptr<CoordinateSequence>> holeRings;
82 std::vector<bool> isHoleTouchingHint;
87 std::set<Coordinate> joinedPts;
89 std::unique_ptr<SegmentSetMutualIntersector> boundaryIntersector;
92 std::vector<std::unique_ptr<BasicSegmentString>> polySegStringStore;
96 class InteriorIntersectionDetector;
97 friend class PolygonHoleJoiner::InteriorIntersectionDetector;
100 void extractOrientedRings(
const Polygon* polygon);
101 static std::unique_ptr<CoordinateSequence> extractOrientedRing(
const LinearRing* ring,
bool isCW);
132 void joinNonTouchingHole(
148 std::size_t findJoinIndex(
161 static bool isLineInterior(
163 std::size_t ringIndex,
166 static std::size_t prev(std::size_t i, std::size_t size);
167 static std::size_t next(std::size_t i, std::size_t size);
182 std::size_t joinIndex,
184 std::size_t holeJoinIndex);
196 std::vector<Coordinate> createHoleSection(
198 std::size_t holeJoinIndex,
207 static std::vector<const LinearRing*> sortHoles(
210 static std::size_t findLowestLeftVertexIndex(
221 bool intersectsBoundary(
225 std::unique_ptr<SegmentSetMutualIntersector> createBoundaryIntersector();
230 PolygonHoleJoiner(
const Polygon* p_inputPolygon)
231 : inputPolygon(p_inputPolygon)
232 , boundaryIntersector(
nullptr)
243 const Polygon* p_inputPolygon);
252 static std::unique_ptr<CoordinateSequence>
join(
253 const Polygon* p_inputPolygon);
260 std::unique_ptr<CoordinateSequence>
compute();
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
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
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
Represents a list of contiguous line segments, and supports noding the segments.
Definition BasicSegmentString.h:44
An intersector for the red-blue intersection problem.
Definition SegmentSetMutualIntersector.h:36
static std::unique_ptr< CoordinateSequence > join(const Polygon *p_inputPolygon)
static std::unique_ptr< Polygon > joinAsPolygon(const Polygon *p_inputPolygon)
std::unique_ptr< CoordinateSequence > compute()
Provides classes for various kinds of spatial indexes.
Definition DiscreteFrechetDistance.h:50
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition InvalidSegmentDetector.h:25
Classes to compute Delaunay triangulations.
Definition ConcaveHull.h:32
Basic namespace for all GEOS functionalities.
Definition geos.h:39