public class NodedSegmentString extends Objectimplements NodableSegmentString
Coordinates. Intended to optimize the noding of contiguous segments by reducing the number of allocated objects. SegmentStrings can carry a context object, which is useful for preserving topological or parentage information. All noded substrings are initialized with the same context object.
| Constructor and Description |
|---|
NodedSegmentString(Coordinate
Creates a new segment string from a list of vertices.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIntersection(Coordinate
Adds an intersection node for a given point and segment to this segment string.
|
void |
addIntersection(LineIntersector
Add an SegmentNode for intersection intIndex.
|
SegmentNode |
addIntersectionNode(Coordinate
Adds an intersection node for a given point and segment to this segment string.
|
void |
addIntersections(LineIntersector
Adds EdgeIntersections for one or both intersections found for a segment of an edge to the edge intersection list.
|
Coordinate |
getCoordinate(int i)
|
Coordinate |
getCoordinates()
|
Object |
getData()
Gets the user-defined data for this segment string.
|
static List |
getNodedSubstrings(Collection
|
static void |
getNodedSubstrings(Collection
|
SegmentNodeList |
getNodeList()
|
int |
getSegmentOctant(int index)
Gets the octant of the segment starting at vertex
index.
|
boolean |
isClosed()
|
void |
setData(Object
Sets the user-defined data for this segment string.
|
int |
size()
|
String |
toString()
|
public NodedSegmentString(Coordinate[] pts, Object data)
pts - the vertices of the segment string
data - the user-defined data of this segment string (may be null)
public static ListgetNodedSubstrings(Collection segStrings)
segStrings - a Collection of NodedSegmentStrings
public static void getNodedSubstrings(CollectionsegStrings, Collection resultEdgelist)
segStrings - a Collection of NodedSegmentStrings
resultEdgelist - a List which will collect the NodedSegmentStrings representing the substrings
public ObjectgetData()
getData in interface
SegmentString
public void setData(Objectdata)
setData in interface
SegmentString
data - an Object containing user-defined data
public SegmentNodeListgetNodeList()
public int size()
public CoordinategetCoordinate(int i)
public Coordinate[] getCoordinates()
public boolean isClosed()
public int getSegmentOctant(int index)
index.
index - the index of the vertex starting the segment. Must not be the last index in the vertex list
public void addIntersections(LineIntersectorli, int segmentIndex, int geomIndex)
public void addIntersection(LineIntersectorli, int segmentIndex, int geomIndex, int intIndex)
public void addIntersection(CoordinateintPt, int segmentIndex)
addIntersection in interface
NodableSegmentString
intPt - the location of the intersection
segmentIndex - the index of the segment containing the intersection
public SegmentNodeaddIntersectionNode(Coordinate intPt, int segmentIndex)
intPt - the location of the intersection
segmentIndex - the index of the segment containing the intersection
public StringtoString()