Class LinearIterator
An iterator over the components and coordinates of a linear geometry (LineStrings and MultiLineStrings.
Inherited Members
Namespace: NetTopologySuite.LinearReferencing
Assembly: NetTopologySuite.dll
Syntax
public class LinearIterator
Constructors
| Edit this page View SourceLinearIterator(Geometry)
Creates an iterator initialized to the start of a linear Geometry.
Declaration
public LinearIterator(Geometry linearGeom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | linearGeom | The linear geometry to iterate over. |
Exceptions
Type | Condition |
---|---|
ArgumentException | if |
LinearIterator(Geometry, LinearLocation)
Creates an iterator starting at a LinearLocation on a linear Geometry.
Declaration
public LinearIterator(Geometry linearGeom, LinearLocation start)
Parameters
Type | Name | Description |
---|---|---|
Geometry | linearGeom | The linear geometry to iterate over. |
LinearLocation | start | The location to start at. |
Exceptions
Type | Condition |
---|---|
ArgumentException | if |
LinearIterator(Geometry, int, int)
Creates an iterator starting at a component and vertex in a linear Geometry.
Declaration
public LinearIterator(Geometry linearGeom, int componentIndex, int vertexIndex)
Parameters
Type | Name | Description |
---|---|---|
Geometry | linearGeom | The linear geometry to iterate over. |
int | componentIndex | The component to start at. |
int | vertexIndex | The vertex to start at. |
Exceptions
Type | Condition |
---|---|
ArgumentException | if |
Properties
| Edit this page View SourceComponentIndex
The component index of the vertex the iterator is currently at.
Declaration
public int ComponentIndex { get; }
Property Value
Type | Description |
---|---|
int |
IsEndOfLine
Checks whether the iterator cursor is pointing to the endpoint of a component LineString.
Declaration
public bool IsEndOfLine { get; }
Property Value
Type | Description |
---|---|
bool |
Line
Gets the LineString component the iterator is current at.
Declaration
public LineString Line { get; }
Property Value
Type | Description |
---|---|
LineString |
SegmentEnd
Gets the second Coordinate of the current segment
(the coordinate of the next vertex).
If the iterator is at the end of a line, null
is returned.
Declaration
public Coordinate SegmentEnd { get; }
Property Value
Type | Description |
---|---|
Coordinate |
SegmentStart
Gets the first Coordinate of the current segment (the coordinate of the current vertex).
Declaration
public Coordinate SegmentStart { get; }
Property Value
Type | Description |
---|---|
Coordinate |
VertexIndex
The vertex index of the vertex the iterator is currently at.
Declaration
public int VertexIndex { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceHasNext()
Tests whether there are any vertices left to iterator over.
Specifically, HasNext()
returns true if the
current state of the iterator represents a valid location
on the linear geometry.
Declaration
public bool HasNext()
Returns
Type | Description |
---|---|
bool |
|
Next()
Jump to the next element of the iteration.
Declaration
public void Next()
SegmentEndVertexIndex(LinearLocation)
Declaration
public static int SegmentEndVertexIndex(LinearLocation loc)
Parameters
Type | Name | Description |
---|---|---|
LinearLocation | loc |
Returns
Type | Description |
---|---|
int |