Package org.gvsig.gpe.lib.api.parser
Interface ICoordinateIterator
public interface ICoordinateIterator
An iterator over the current geometry being parsed intended to be given to the consumer
IGPEContentHandler.
This provides an abstraction for specific format parsers to optimize as needed without imposing a coordinate structure to the consumer application which may be inefficient for its geometry model.
Basically, using this interface allows for the following optimizations:
- Avoid unneeded coordinate parsing where not necessary
- Allows to serve geometry sequences of arbitrary dimensions
- Avoids unnecessary copy of large coordinate buffers from different arrays of doubles, letting the consumer iterate over the coordinates and build its geometries more efficiently
- Version:
- $Id: ICoordinateIterator.java 19589 2008-03-12 14:14:54Z groldan $
- Author:
- Gabriel Roldan (TOPP)
-
Method Details
-
hasNext
Returns whether there are more coordinates in this sequence- Returns:
- Throws:
IOException
-
getDimension
int getDimension()Returns the dimension of the coordinate tuple being served. Consumer code should use it to pass a buffer with the correct lenght tonext(double[])- Returns:
-
next
- Parameters:
buffer- where to store the parsed coordinates. The buffer lenght shall be >=getDimension()- Throws:
IOException
-