An iterator over the components and coordinates of a linear geometry (LineString or MultiLineString).
More...
#include <LinearIterator.h>
An iterator over the components and coordinates of a linear geometry (LineString or MultiLineString).
The standard usage pattern for a LinearIterator is:
...
int ci = it.getComponentIndex();
int vi = it.getVertexIndex();
...
}
- Version
- 1.7
Definition at line 50 of file LinearIterator.h.
geos::linearref::LinearIterator::LinearIterator |
( |
const geom::Geometry * |
linear | ) |
|
Creates an iterator initialized to the start of a linear Geometry.
- Parameters
-
linear | the linear geometry to iterate over |
Creates an iterator starting at a LinearLocation on a linear geom::Geometry.
- Parameters
-
linear | the linear geometry to iterate over |
start | the location to start at |
geos::linearref::LinearIterator::LinearIterator |
( |
const geom::Geometry * |
linear, |
|
|
size_t |
componentIndex, |
|
|
size_t |
vertexIndex |
|
) |
| |
Creates an iterator starting at a component and vertex in a linear geom::Geometry.
- Parameters
-
linear | the linear geometry to iterate over |
componentIndex | the component to start at |
vertexIndex | the vertex to start at |
geos::linearref::LinearIterator::LinearIterator |
( |
const LinearIterator & |
other | ) |
|
|
privatedelete |
size_t geos::linearref::LinearIterator::getComponentIndex |
( |
| ) |
const |
The component index of the vertex the iterator is currently at.
- Returns
- the current component index
Gets the geom::LineString component the iterator is current at.
- Returns
- a linestring
Gets the second geom::Coordinate of the current segment. (the coordinate of the next vertex). If the iterator is at the end of a line, null
is returned.
- Returns
- a Coordinate or
null
Gets the first geom::Coordinate of the current segment. (the coordinate of the current vertex).
- Returns
- a Coordinate
size_t geos::linearref::LinearIterator::getVertexIndex |
( |
| ) |
const |
The vertex index of the vertex the iterator is currently at.
- Returns
- the current vertex index
bool geos::linearref::LinearIterator::hasNext |
( |
| ) |
const |
Tests whether there are any vertices left to iterator over.
- Returns
true
if there are more vertices to scan
bool geos::linearref::LinearIterator::isEndOfLine |
( |
| ) |
const |
Checks whether the iterator cursor is pointing to the endpoint of a component geom::LineString.
- Returns
true
if the iterator is at an endpoint
void geos::linearref::LinearIterator::loadCurrentLine |
( |
| ) |
|
|
private |
Invariant: currentLine <> null if the iterator is pointing at a valid coordinate
- Exceptions
-
IllegalArgumentException | if linearGeom is not Lineal |
void geos::linearref::LinearIterator::next |
( |
| ) |
|
Moves the iterator ahead to the next vertex and (possibly) linear component.
static size_t geos::linearref::LinearIterator::segmentEndVertexIndex |
( |
const LinearLocation & |
loc | ) |
|
|
staticprivate |
size_t geos::linearref::LinearIterator::componentIndex |
|
private |
const size_t geos::linearref::LinearIterator::numLines |
|
private |
size_t geos::linearref::LinearIterator::vertexIndex |
|
private |
The documentation for this class was generated from the following file: