25 #include <geos/export.h>
26 #include <geos/algorithm/LineIntersector.h>
27 #include <geos/geom/Coordinate.h>
28 #include <geos/geom/CoordinateSequence.h>
29 #include <geos/noding/NodedSegmentString.h>
30 #include <geos/noding/NodableSegmentString.h>
31 #include <geos/noding/SegmentNode.h>
32 #include <geos/noding/SegmentNodeList.h>
33 #include <geos/noding/SegmentString.h>
34 #include <geos/util/IllegalArgumentException.h>
40 #pragma warning(disable: 4251 4355)
64 getNodedSubstrings(II from, II too_far,
65 SegmentString::NonConstVect* resultEdgelist)
67 for(II i = from; i != too_far; ++i) {
76 getNodedSubstrings(C* segStrings,
77 SegmentString::NonConstVect* resultEdgelist)
79 getNodedSubstrings(segStrings->begin(), segStrings->end(), resultEdgelist);
82 static void getNodedSubstrings(
const SegmentString::NonConstVect& segStrings,
83 SegmentString::NonConstVect* resultEdgeList);
87 const SegmentString::NonConstVect& segStrings);
89 std::unique_ptr<geom::CoordinateSequence> getNodedCoordinates();
93 return nodeList.size() > 0;
108 , nodeList(*this, constructZ, constructM)
113 , nodeList(*this, constructZ, constructM)
116 ~NodedSegmentString()
override {
120 SegmentNodeList& getNodeList();
122 const SegmentNodeList& getNodeList()
const;
124 std::unique_ptr<geom::CoordinateSequence> releaseCoordinates();
126 std::ostream& print(std::ostream& os)
const override;
135 std::size_t segmentIndex, std::size_t geomIndex)
138 addIntersection(li, segmentIndex, geomIndex, i);
150 std::size_t segmentIndex,
151 std::size_t geomIndex, std::size_t intIndex)
153 ::geos::ignore_unused_variable_warning(geomIndex);
156 addIntersection(intPt, segmentIndex);
166 template<
typename CoordType>
168 std::size_t segmentIndex)
170 std::size_t normalizedSegmentIndex = segmentIndex;
172 if (segmentIndex > size() - 2) {
177 auto nextSegIndex = normalizedSegmentIndex + 1;
178 if (nextSegIndex < size()) {
179 const auto& nextPt = getCoordinate<geom::CoordinateXY>(nextSegIndex);
184 if(intPt.equals2D(nextPt)) {
185 normalizedSegmentIndex = nextSegIndex;
193 nodeList.add(intPt, normalizedSegmentIndex);
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:53
const geom::CoordinateXYZM & getIntersection(std::size_t intIndex) const
Definition: LineIntersector.h:209
size_t getIntersectionNum() const
Definition: LineIntersector.h:196
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
An interface for classes which support adding nodes to a segment string.
Definition: NodableSegmentString.h:36
Represents a list of contiguous line segments, and supports noding the segments.
Definition: NodedSegmentString.h:58
void addIntersection(algorithm::LineIntersector *li, std::size_t segmentIndex, std::size_t geomIndex, std::size_t intIndex)
Add an SegmentNode for intersection intIndex.
Definition: NodedSegmentString.h:149
static SegmentString::NonConstVect * getNodedSubstrings(const SegmentString::NonConstVect &segStrings)
Returns allocated object.
NodedSegmentString(geom::CoordinateSequence *newPts, bool constructZ, bool constructM, const void *newContext)
Creates a new segment string from a list of vertices.
Definition: NodedSegmentString.h:106
void addIntersection(const CoordType &intPt, std::size_t segmentIndex)
Add an SegmentNode for intersection intIndex.
Definition: NodedSegmentString.h:167
void addIntersections(algorithm::LineIntersector *li, std::size_t segmentIndex, std::size_t geomIndex)
Add SegmentNodes for one or both intersections found for a segment of an edge to the edge intersectio...
Definition: NodedSegmentString.h:134
A list of the SegmentNode present along a NodedSegmentString.
Definition: SegmentNodeList.h:54
void addSplitEdges(std::vector< SegmentString * > &edgeList)
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:47
Indicates one or more illegal arguments.
Definition: IllegalArgumentException.h:33
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25