Class NodedSegmentString
Represents a list of contiguous line segments, and supports noding the segments. The line segments are represented by an array of Coordinates. Intended to optimize the noding of contiguous segments by reducing the number of allocated objects. ISegmentStrings can carry a context object, which is useful for preserving topological or parentage information. All noded substrings are initialized with the same context object.
For read-only applications use BasicSegmentString, which is (slightly)more lightweight.
Inherited Members
Namespace: NetTopologySuite.Noding
Assembly: NetTopologySuite.dll
Syntax
public class NodedSegmentString : INodableSegmentString, ISegmentString
Constructors
| Improve this Doc View SourceNodedSegmentString(Coordinate[], Object)
Creates an instance from a list of vertices and optional data object.
Declaration
public NodedSegmentString(Coordinate[] pts, object context)
Parameters
Type | Name | Description |
---|---|---|
Coordinate[] | pts | The vertices of the segment string. |
Object | context | The user-defined data of this segment string (may be null). |
NodedSegmentString(ISegmentString)
Creates a new instance from a ISegmentString.
Declaration
public NodedSegmentString(ISegmentString ss)
Parameters
Type | Name | Description |
---|---|---|
ISegmentString | ss | The segment string to use. |
Properties
| Improve this Doc View SourceContext
Gets/Sets the user-defined data for this segment string.
Declaration
public object Context { get; set; }
Property Value
Type | Description |
---|---|
Object |
Remarks
In JTS this property is called Data
Coordinates
Declaration
public Coordinate[] Coordinates { get; }
Property Value
Type | Description |
---|---|
Coordinate[] |
Count
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
IsClosed
Declaration
public bool IsClosed { get; }
Property Value
Type | Description |
---|---|
Boolean |
Item[Int32]
Declaration
public LineSegment this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Property Value
Type | Description |
---|---|
LineSegment |
NodedCoordinates
Gets a list of coordinates with all nodes included.
Declaration
public Coordinate[] NodedCoordinates { get; }
Property Value
Type | Description |
---|---|
Coordinate[] | An array of coordinates including nodes |
NodeList
Declaration
public SegmentNodeList NodeList { get; }
Property Value
Type | Description |
---|---|
SegmentNodeList |
Methods
| Improve this Doc View SourceAddIntersection(LineIntersector, Int32, Int32, Int32)
Add an SegmentNode for intersection intIndex. An intersection that falls exactly on a vertex of the NodedSegmentString is normalized to use the higher of the two possible segmentIndexes.
Declaration
public void AddIntersection(LineIntersector li, int segmentIndex, int geomIndex, int intIndex)
Parameters
Type | Name | Description |
---|---|---|
LineIntersector | li | |
Int32 | segmentIndex | |
Int32 | geomIndex | |
Int32 | intIndex |
AddIntersection(Coordinate, Int32)
Declaration
public void AddIntersection(Coordinate intPt, int segmentIndex)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | intPt | |
Int32 | segmentIndex |
AddIntersections(LineIntersector, Int32, Int32)
Adds EdgeIntersections for one or both intersections found for a segment of an edge to the edge intersection list.
Declaration
public void AddIntersections(LineIntersector li, int segmentIndex, int geomIndex)
Parameters
Type | Name | Description |
---|---|---|
LineIntersector | li | |
Int32 | segmentIndex | |
Int32 | geomIndex |
GetCoordinate(Int32)
Declaration
public Coordinate GetCoordinate(int i)
Parameters
Type | Name | Description |
---|---|---|
Int32 | i |
Returns
Type | Description |
---|---|
Coordinate |
GetNodedSubstrings(IEnumerable<ISegmentString>)
Gets the ISegmentStrings which result from splitting this string at node points.
Declaration
public static ReadOnlyCollection<ISegmentString> GetNodedSubstrings(IEnumerable<ISegmentString> segStrings)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ISegmentString> | segStrings | A collection of NodedSegmentStrings |
Returns
Type | Description |
---|---|
ReadOnlyCollection<ISegmentString> | A collection of NodedSegmentStrings representing the substrings |
GetNodedSubstrings(IEnumerable<ISegmentString>, ICollection<ISegmentString>)
Adds the noded ISegmentStrings which result from splitting this string at node points.
Declaration
public static void GetNodedSubstrings(IEnumerable<ISegmentString> segStrings, ICollection<ISegmentString> resultEdgelist)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ISegmentString> | segStrings | A collection of NodedSegmentStrings |
ICollection<ISegmentString> | resultEdgelist | A list which will collect the NodedSegmentStrings representing the substrings |
GetSegmentOctant(Int32)
Gets the octant of the segment starting at vertex index
.
Declaration
public Octants GetSegmentOctant(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the vertex starting the segment. Must not be the last index in the vertex list |
Returns
Type | Description |
---|---|
Octants | The octant of the segment at the vertex |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |