Class PathIteratorAdapter
java.lang.Object
org.apache.sis.internal.feature.jts.PathIteratorAdapter
- All Implemented Interfaces:
PathIterator
Java2D path iterator for JTS geometry.
This iterator gets coordinates from the
CoordinateSequence associated to each geometry.- Since:
- 1.2
- Version:
- 1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classAn iterator over the coordinate sequences of a geometry collection.private static final classAn iterator over the coordinate sequences of a polygon. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AffineTransformThe transform to apply on returned coordinate values.private intIndex of the coordinates tuple which closes the current polygon, or -1 if none.private org.locationtech.jts.geom.CoordinateSequenceThe sequence of coordinate tuples to return, ornullif the iteration is finished.private intIndex of current position in the sequence of coordinate tuples.private intNumber of points to return in the sequence.private final Iterator<org.locationtech.jts.geom.CoordinateSequence>Provider of coordinate sequences.Fields inherited from interface java.awt.geom.PathIterator
SEG_CLOSE, SEG_CUBICTO, SEG_LINETO, SEG_MOVETO, SEG_QUADTO, WIND_EVEN_ODD, WIND_NON_ZERO -
Constructor Summary
ConstructorsConstructorDescriptionPathIteratorAdapter(org.locationtech.jts.geom.Geometry geometry, AffineTransform at) Creates a new iterator which will transform coordinates using the given transform. -
Method Summary
Modifier and TypeMethodDescriptionintcurrentSegment(double[] coords) Returns the coordinates and type of the current path segment in the iteration.intcurrentSegment(float[] coords) Returns the coordinates and type of the current path segment in the iteration.intReturns the winding rule for determining the interior of the path.booleanisDone()Returnstrueif iteration is finished.private static Iterator<org.locationtech.jts.geom.CoordinateSequence>iterator(org.locationtech.jts.geom.Geometry geometry) Returns an iterator over the coordinate sequences of the given geometry.voidnext()Moves the iterator to the next segment.private voidMoves to the next sequence of coordinate tuples.
-
Field Details
-
at
The transform to apply on returned coordinate values. Never null (may be the identity transform instead). -
sequences
Provider of coordinate sequences. -
coordinates
private org.locationtech.jts.geom.CoordinateSequence coordinatesThe sequence of coordinate tuples to return, ornullif the iteration is finished. -
pointCount
private int pointCountNumber of points to return in the sequence. -
closingPoint
private int closingPointIndex of the coordinates tuple which closes the current polygon, or -1 if none. -
currentIndex
private int currentIndexIndex of current position in the sequence of coordinate tuples.
-
-
Constructor Details
-
PathIteratorAdapter
PathIteratorAdapter(org.locationtech.jts.geom.Geometry geometry, AffineTransform at) Creates a new iterator which will transform coordinates using the given transform.- Parameters:
geometry- the geometry on which to iterator.at- the transform to apply, ornullfor the identity transform.
-
-
Method Details
-
nextSequence
private void nextSequence()Moves to the next sequence of coordinate tuples. Thecoordinatessequence should be null when this method is invoked. If there are no more sequences, then thecoordinateswill be left unchanged (i.e. null). -
next
public void next()Moves the iterator to the next segment.- Specified by:
nextin interfacePathIterator
-
isDone
public boolean isDone()Returnstrueif iteration is finished.- Specified by:
isDonein interfacePathIterator
-
getWindingRule
public int getWindingRule()Returns the winding rule for determining the interior of the path. Current implementation returns the same rule than the one returned byShapeCollectionPathIterator.- Specified by:
getWindingRulein interfacePathIterator
-
currentSegment
public int currentSegment(double[] coords) Returns the coordinates and type of the current path segment in the iteration.- Specified by:
currentSegmentin interfacePathIterator- Parameters:
coords- an array where to store the data returned from this method.- Returns:
- the path-segment type of the current path segment.
-
currentSegment
public int currentSegment(float[] coords) Returns the coordinates and type of the current path segment in the iteration.- Specified by:
currentSegmentin interfacePathIterator- Parameters:
coords- an array where to store the data returned from this method.- Returns:
- the path-segment type of the current path segment.
-
iterator
private static Iterator<org.locationtech.jts.geom.CoordinateSequence> iterator(org.locationtech.jts.geom.Geometry geometry) Returns an iterator over the coordinate sequences of the given geometry.- Parameters:
geometry- the geometry for which to get coordinate sequences.- Returns:
- coordinate sequences over the given geometry.
-