public class LinearIterator extends Object implements Iterable<com.vividsolutions.jts.linearref.LinearLocation>
Constructor and Description |
---|
LinearIterator(com.vividsolutions.jts.geom.Geometry linear)
Creates an iterator initialized to the start of a linear
Geometry |
LinearIterator(com.vividsolutions.jts.geom.Geometry linearGeom,
int componentIndex,
int vertexIndex)
Creates an iterator starting at a specified component and vertex in a linear
Geometry |
LinearIterator(com.vividsolutions.jts.geom.Geometry linear,
com.vividsolutions.jts.linearref.LinearLocation start)
Creates an iterator starting at a
LinearLocation on a linear Geometry |
Modifier and Type | Method and Description |
---|---|
int |
getComponentIndex()
The component index of the vertex the iterator is currently at.
|
static com.vividsolutions.jts.linearref.LinearLocation |
getEndLocation(com.vividsolutions.jts.geom.Geometry linear) |
com.vividsolutions.jts.geom.LineString |
getLine()
Gets the
LineString component the iterator is current at. |
com.vividsolutions.jts.linearref.LinearLocation |
getLocation() |
com.vividsolutions.jts.geom.Coordinate |
getSegmentEnd()
Gets the second
Coordinate of the current segment. |
com.vividsolutions.jts.geom.Coordinate |
getSegmentStart()
Gets the first
Coordinate of the current segment. |
int |
getVertexIndex()
The vertex index of the vertex the iterator is currently at.
|
boolean |
hasNext()
Tests whether there are any vertices left to iterator over.
|
boolean |
isEndOfLine()
Checks whether the iterator cursor is pointing to the endpoint of a linestring.
|
boolean |
isValidIndex() |
Iterator<com.vividsolutions.jts.linearref.LinearLocation> |
iterator() |
void |
next()
Moves the iterator ahead to the next vertex and (possibly) linear component.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public LinearIterator(com.vividsolutions.jts.geom.Geometry linear)
Geometry
linear
- the linear geometry to iterate overIllegalArgumentException
- if linearGeom is not linealpublic LinearIterator(com.vividsolutions.jts.geom.Geometry linear, com.vividsolutions.jts.linearref.LinearLocation start)
LinearLocation
on a linear Geometry
linear
- the linear geometry to iterate overstart
- the location to start atIllegalArgumentException
- if linearGeom is not linealpublic LinearIterator(com.vividsolutions.jts.geom.Geometry linearGeom, int componentIndex, int vertexIndex)
Geometry
linearGeom
- the linear geometry to iterate overcomponentIndex
- the component to start atvertexIndex
- the vertex to start atIllegalArgumentException
- if linearGeom is not linealpublic boolean hasNext()
true
if there are more vertices to scanpublic boolean isValidIndex()
public void next()
public boolean isEndOfLine()
true if the iterator is at an endpoint
public int getComponentIndex()
public int getVertexIndex()
public com.vividsolutions.jts.geom.LineString getLine()
LineString
component the iterator is current at.public com.vividsolutions.jts.geom.Coordinate getSegmentStart()
Coordinate
of the current segment. (the coordinate of the current
vertex).Coordinate
public com.vividsolutions.jts.geom.Coordinate getSegmentEnd()
Coordinate
of the current segment. (the coordinate of the next
vertex). If the iterator is at the end of a line, null
is returned.Coordinate
or null
public com.vividsolutions.jts.linearref.LinearLocation getLocation()
public Iterator<com.vividsolutions.jts.linearref.LinearLocation> iterator()
public static com.vividsolutions.jts.linearref.LinearLocation getEndLocation(com.vividsolutions.jts.geom.Geometry linear)
Copyright © 2018. All rights reserved.