Table of Contents

Class NodedSegmentString

Namespace
NetTopologySuite.Noding
Assembly
NetTopologySuite.dll

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.
public class NodedSegmentString : INodableSegmentString, ISegmentString
Inheritance
NodedSegmentString
Implements
Inherited Members

Constructors

NodedSegmentString(Coordinate[], object)

Creates an instance from a list of vertices and optional data object.

public NodedSegmentString(Coordinate[] pts, object context)

Parameters

pts Coordinate[]

The vertices of the segment string.

context object

The user-defined data of this segment string (may be null).

See Also

NodedSegmentString(ISegmentString)

Creates a new instance from a ISegmentString.

public NodedSegmentString(ISegmentString ss)

Parameters

ss ISegmentString

The segment string to use.

See Also

Properties

Context

Gets/Sets the user-defined data for this segment string.

public object Context { get; set; }

Property Value

object

Remarks

In JTS this property is called Data

See Also

Coordinates

public Coordinate[] Coordinates { get; }

Property Value

Coordinate[]
See Also

Count

public int Count { get; }

Property Value

int
See Also

IsClosed

public bool IsClosed { get; }

Property Value

bool
See Also

this[int]

public LineSegment this[int index] { get; set; }

Parameters

index int

Property Value

LineSegment
See Also

NodeList

public SegmentNodeList NodeList { get; }

Property Value

SegmentNodeList
See Also

NodedCoordinates

Gets a list of coordinates with all nodes included.

public Coordinate[] NodedCoordinates { get; }

Property Value

Coordinate[]

An array of coordinates including nodes

See Also

Methods

AddIntersection(LineIntersector, int, int, int)

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.

public void AddIntersection(LineIntersector li, int segmentIndex, int geomIndex, int intIndex)

Parameters

li LineIntersector
segmentIndex int
geomIndex int
intIndex int
See Also

AddIntersection(Coordinate, int)

public void AddIntersection(Coordinate intPt, int segmentIndex)

Parameters

intPt Coordinate
segmentIndex int
See Also

AddIntersections(LineIntersector, int, int)

Adds EdgeIntersections for one or both intersections found for a segment of an edge to the edge intersection list.

public void AddIntersections(LineIntersector li, int segmentIndex, int geomIndex)

Parameters

li LineIntersector
segmentIndex int
geomIndex int
See Also

GetCoordinate(int)

public Coordinate GetCoordinate(int i)

Parameters

i int

Returns

Coordinate
See Also

GetNodedSubstrings(IEnumerable<ISegmentString>)

Gets the ISegmentStrings which result from splitting this string at node points.

public static ReadOnlyCollection<ISegmentString> GetNodedSubstrings(IEnumerable<ISegmentString> segStrings)

Parameters

segStrings IEnumerable<ISegmentString>

A collection of NodedSegmentStrings

Returns

ReadOnlyCollection<ISegmentString>

A collection of NodedSegmentStrings representing the substrings

See Also

GetNodedSubstrings(IEnumerable<ISegmentString>, ICollection<ISegmentString>)

Adds the noded ISegmentStrings which result from splitting this string at node points.

public static void GetNodedSubstrings(IEnumerable<ISegmentString> segStrings, ICollection<ISegmentString> resultEdgelist)

Parameters

segStrings IEnumerable<ISegmentString>

A collection of NodedSegmentStrings

resultEdgelist ICollection<ISegmentString>

A list which will collect the NodedSegmentStrings representing the substrings

See Also

GetSegmentOctant(int)

Gets the octant of the segment starting at vertex index.

public Octants GetSegmentOctant(int index)

Parameters

index int

The index of the vertex starting the segment. Must not be the last index in the vertex list

Returns

Octants

The octant of the segment at the vertex

See Also

ToString()

public override string ToString()

Returns

string
See Also

See Also