Package org.locationtech.jts.noding
Class SegmentNodeList
- java.lang.Object
-
- org.locationtech.jts.noding.SegmentNodeList
-
public class SegmentNodeList extends java.lang.ObjectA list of theSegmentNodes present along a nodedSegmentString.- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private NodedSegmentStringedgeprivate java.util.MapnodeMap
-
Constructor Summary
Constructors Constructor Description SegmentNodeList(NodedSegmentString edge)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SegmentNodeadd(Coordinate intPt, int segmentIndex)Adds an intersection into the list, if it isn't already there.private voidaddCollapsedNodes()Adds nodes for any collapsed edge pairs.private voidaddEdgeCoordinates(SegmentNode ei0, SegmentNode ei1, CoordinateList coordList)private voidaddEndpoints()Adds nodes for the first and last points of the edgevoidaddSplitEdges(java.util.Collection edgeList)Creates new edges for all the edges that the intersections in this list split the parent edge into.private voidcheckSplitEdgesCorrectness(java.util.List splitEdges)Checks the correctness of the set of split edges corresponding to this edge.(package private) SegmentStringcreateSplitEdge(SegmentNode ei0, SegmentNode ei1)Create a new "split edge" with the section of points between (and including) the two intersections.private booleanfindCollapseIndex(SegmentNode ei0, SegmentNode ei1, int[] collapsedVertexIndex)private voidfindCollapsesFromExistingVertices(java.util.List collapsedVertexIndexes)Adds nodes for any collapsed edge pairs which are pre-existing in the vertex list.private voidfindCollapsesFromInsertedNodes(java.util.List collapsedVertexIndexes)Adds nodes for any collapsed edge pairs caused by inserted nodes Collapsed edge pairs occur when the same coordinate is inserted as a node both before and after an existing edge vertex.NodedSegmentStringgetEdge()Coordinate[]getSplitCoordinates()Gets the list of coordinates for the fully noded segment string, including all original segment string vertices and vertices introduced by nodes in this list.java.util.Iteratoriterator()returns an iterator of SegmentNodesvoidprint(java.io.PrintStream out)
-
-
-
Field Detail
-
nodeMap
private java.util.Map nodeMap
-
edge
private NodedSegmentString edge
-
-
Constructor Detail
-
SegmentNodeList
public SegmentNodeList(NodedSegmentString edge)
-
-
Method Detail
-
getEdge
public NodedSegmentString getEdge()
-
add
public SegmentNode add(Coordinate intPt, int segmentIndex)
Adds an intersection into the list, if it isn't already there. The input segmentIndex and dist are expected to be normalized.- Returns:
- the SegmentIntersection found or added
-
iterator
public java.util.Iterator iterator()
returns an iterator of SegmentNodes
-
addEndpoints
private void addEndpoints()
Adds nodes for the first and last points of the edge
-
addCollapsedNodes
private void addCollapsedNodes()
Adds nodes for any collapsed edge pairs. Collapsed edge pairs can be caused by inserted nodes, or they can be pre-existing in the edge vertex list. In order to provide the correct fully noded semantics, the vertex at the base of a collapsed pair must also be added as a node.
-
findCollapsesFromExistingVertices
private void findCollapsesFromExistingVertices(java.util.List collapsedVertexIndexes)
Adds nodes for any collapsed edge pairs which are pre-existing in the vertex list.
-
findCollapsesFromInsertedNodes
private void findCollapsesFromInsertedNodes(java.util.List collapsedVertexIndexes)
Adds nodes for any collapsed edge pairs caused by inserted nodes Collapsed edge pairs occur when the same coordinate is inserted as a node both before and after an existing edge vertex. To provide the correct fully noded semantics, the vertex must be added as a node as well.
-
findCollapseIndex
private boolean findCollapseIndex(SegmentNode ei0, SegmentNode ei1, int[] collapsedVertexIndex)
-
addSplitEdges
public void addSplitEdges(java.util.Collection edgeList)
Creates new edges for all the edges that the intersections in this list split the parent edge into. Adds the edges to the provided argument list (this is so a single list can be used to accumulate all split edges for a set ofSegmentStrings).
-
checkSplitEdgesCorrectness
private void checkSplitEdgesCorrectness(java.util.List splitEdges)
Checks the correctness of the set of split edges corresponding to this edge.- Parameters:
splitEdges- the split edges for this edge (in order)
-
createSplitEdge
SegmentString createSplitEdge(SegmentNode ei0, SegmentNode ei1)
Create a new "split edge" with the section of points between (and including) the two intersections. The label for the new edge is the same as the label for the parent edge.
-
getSplitCoordinates
public Coordinate[] getSplitCoordinates()
Gets the list of coordinates for the fully noded segment string, including all original segment string vertices and vertices introduced by nodes in this list. Repeated coordinates are collapsed.- Returns:
- an array of Coordinates
-
addEdgeCoordinates
private void addEdgeCoordinates(SegmentNode ei0, SegmentNode ei1, CoordinateList coordList)
-
print
public void print(java.io.PrintStream out)
-
-