21#include <geos/algorithm/CircularArcIntersector.h>
22#include <geos/algorithm/LineIntersector.h>
23#include <geos/geom/CoordinateSequence.h>
24#include <geos/geom/CircularArc.h>
25#include <geos/geom/Envelope.h>
26#include <geos/geom/Geometry.h>
27#include <geos/geom/GeometryCollection.h>
28#include <geos/geom/LinearRing.h>
29#include <geos/geom/LineString.h>
30#include <geos/geom/Polygon.h>
31#include <geos/geom/SimpleCurve.h>
32#include <geos/noding/ArcIntersectionAdder.h>
33#include <geos/noding/IntersectionAdder.h>
34#include <geos/noding/Noder.h>
35#include <geos/noding/SegmentString.h>
36#include <geos/operation/overlayng/Edge.h>
37#include <geos/operation/overlayng/EdgeSourceInfo.h>
38#include <geos/operation/overlayng/LineLimiter.h>
39#include <geos/operation/overlayng/RingClipper.h>
42#include <geos/export.h>
75 using CompoundCurve = geos::geom::CompoundCurve;
76 using CircularString = geos::geom::CircularString;
80 using SimpleCurve = geos::geom::SimpleCurve;
81 using Curve = geos::geom::Curve;
86 static constexpr int MIN_LIMIT_PTS = 20;
87 static constexpr bool IS_NODING_VALIDATED =
true;
91 std::vector<noding::PathString*> inputEdges;
93 std::array<bool, 2> hasEdges;
95 std::unique_ptr<RingClipper> clipper;
96 std::unique_ptr<LineLimiter> limiter;
100 algorithm::CircularArcIntersector arcInt;
102 noding::ArcIntersectionAdder arcIntAdder;
103 std::unique_ptr<noding::Noder> internalNoder;
104 std::unique_ptr<noding::Noder> spareInternalNoder;
106 std::deque<EdgeSourceInfo> edgeSourceInfoQue;
107 std::deque<Edge> edgeQue;
121 static std::unique_ptr<noding::Noder> createFixedPrecisionNoder(
const PrecisionModel* pm);
122 std::unique_ptr<noding::Noder> createFloatingPrecisionNoder(
bool doValidation);
126 void addGeometryCollection(
const GeometryCollection* gc, uint8_t geomIndex,
int expectedDim);
127 void addPolygon(
const Surface* poly, uint8_t geomIndex);
128 void addPolygonRing(
const Curve* ring,
bool isHole, uint8_t geomIndex);
129 void addSimpleCurve(
const SimpleCurve* line, uint8_t geomIndex);
130 void addCompoundCurve(
const CompoundCurve* line, uint8_t geomIndex);
132 void addCurve(
const std::shared_ptr<const CoordinateSequence>& pts,
const std::vector<geom::CircularArc>& arcs, uint8_t geomIndex);
133 void addLine(
const std::shared_ptr<const CoordinateSequence>& pts, uint8_t geomIndex);
135 void addEdge(
const std::shared_ptr<const CoordinateSequence>& cas,
const EdgeSourceInfo* info);
136 void addCurvedEdge(
const std::shared_ptr<const CoordinateSequence>& cas,
const std::vector<geom::CircularArc>& arcs,
const EdgeSourceInfo* info);
140 const EdgeSourceInfo* createEdgeSourceInfo(uint8_t index,
int depthDelta,
bool isHole);
147 bool isClippedCompletely(
const Envelope* env)
const;
154 bool isToBeLimited(
const LineString* line)
const;
161 std::vector<std::unique_ptr<CoordinateSequence>>& limit(
const LineString* line)
const;
177 std::shared_ptr<const CoordinateSequence> clip(
const LineString* ring)
const;
186 static std::shared_ptr<const CoordinateSequence> removeRepeatedPoints(
const LineString* line);
190 void add(
const Geometry* g, uint8_t geomIndex);
198 std::vector<Edge*> node(
const std::vector<noding::PathString*>& segStrings);
199 std::vector<Edge*> createEdges(std::vector<std::unique_ptr<noding::PathString>> &segStrings);
211 , customNoder(p_customNoder)
212 , hasEdges{{
false,
false}}
215 , arcIntAdder(arcInt)
218 , inputHasCurves(
false)
221 ~EdgeNodingBuilder();
223 void setClipEnvelope(
const Envelope* clipEnv);
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:53
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:59
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:51
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:201
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
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:87
Computes the intersections between two line segments in SegmentString and adds them to each string.
Definition: IntersectionAdder.h:54
Computes all intersections between segments in a set of SegmentString.
Definition: Noder.h:45
Definition: EdgeNodingBuilder.h:68
bool hasEdgesFor(uint8_t geomIndex) const
std::vector< Edge * > build(const Geometry *geom0, const Geometry *geom1)
EdgeNodingBuilder(const PrecisionModel *p_pm, noding::Noder *p_customNoder)
Definition: EdgeNodingBuilder.h:209
Definition: EdgeSourceInfo.h:38
Basic namespace for all GEOS functionalities.
Definition: geos.h:38