public class NodedSegmentString extends Object implements NodableSegmentString
Coordinatess.
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(LineString points,
Object data)
Creates a new segment string from a list of vertices.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIntersection(LineIntersector li,
int segmentIndex,
int geomIndex,
int intIndex)
Add an SegmentNode for intersection intIndex.
|
void |
addIntersection(Point point,
int segmentIndex)
Adds an intersection node for a given point and segment to this segment string.
|
SegmentNode |
addIntersectionNode(Point point,
int segmentIndex)
Adds an intersection node for a given point and segment to this segment string.
|
void |
addIntersections(LineIntersector li,
int segmentIndex,
int geomIndex)
Adds EdgeIntersections for one or both
intersections found for a segment of an edge to the edge intersection list.
|
Point |
getCoordinate(int i) |
Object |
getData()
Gets the user-defined data for this segment string.
|
static List<NodedSegmentString> |
getNodedSubstrings(Collection<NodedSegmentString> segments)
Gets the
SegmentStrings which result from splitting this string at node points. |
SegmentNodeList |
getNodeList() |
LineString |
getPoints() |
int |
getSegmentOctant(int index)
Gets the octant of the segment starting at vertex
index. |
boolean |
isClosed() |
void |
setData(Object data)
Sets the user-defined data for this segment string.
|
int |
size() |
String |
toString() |
public NodedSegmentString(LineString points, Object data)
points - the vertices of the segment stringdata - the user-defined data of this segment string (may be null)public static List<NodedSegmentString> getNodedSubstrings(Collection<NodedSegmentString> segments)
SegmentStrings which result from splitting this string at node points.segments - a Collection of NodedSegmentStringspublic void addIntersection(LineIntersector li, int segmentIndex, int geomIndex, int intIndex)
public void addIntersection(Point point, int segmentIndex)
addIntersection in interface NodableSegmentStringpoint - the location of the intersectionsegmentIndex - the index of the segment containing the intersectionpublic SegmentNode addIntersectionNode(Point point, int segmentIndex)
point - the location of the intersectionsegmentIndex - the index of the segment containing the intersectionpublic void addIntersections(LineIntersector li, int segmentIndex, int geomIndex)
public Point getCoordinate(int i)
getCoordinate in interface SegmentStringpublic Object getData()
getData in interface SegmentStringpublic SegmentNodeList getNodeList()
public LineString getPoints()
getPoints in interface SegmentStringpublic int getSegmentOctant(int index)
index.index - the index of the vertex starting the segment. Must not be
the last index in the vertex listpublic boolean isClosed()
isClosed in interface SegmentStringpublic void setData(Object data)
setData in interface SegmentStringdata - an Object containing user-defined datapublic int size()
size in interface SegmentStringCopyright © 2015 Revolution Systems Inc.. All rights reserved.