public class ForceCoordinateSystemIterator extends Object implements SimpleFeatureIterator, Iterator<SimpleFeature>
ForceCoordinateSystemFeatureReader is a wrapper used to force GeometryAttributes to a user supplied CoordinateReferenceSystem rather then the default supplied by the DataStore.
Example Use:
ForceCoordinateSystemFeatureReader reader =
new ForceCoordinateSystemFeatureReader( originalReader, forceCS );
CoordinateReferenceSystem originalCS =
originalReader.getFeatureType().getDefaultGeometry().getCoordianteSystem();
CoordinateReferenceSystem newCS =
reader.getFeatureType().getDefaultGeometry().getCoordinateSystem();
assertEquals( forceCS, newCS );
| Modifier and Type | Field and Description |
|---|---|
protected SimpleFeatureBuilder |
builder |
protected FeatureIterator<SimpleFeature> |
reader |
| Constructor and Description |
|---|
ForceCoordinateSystemIterator(FeatureIterator<SimpleFeature> reader,
SimpleFeatureType type,
CoordinateReferenceSystem cs)
Builds a new ForceCoordinateSystemFeatureReader
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this iterator and releases any system resources associated with it.
|
SimpleFeatureType |
getFeatureType() |
boolean |
hasNext()
Does another Feature exist in this Iteration.
|
SimpleFeature |
next()
Get the next Feature in this iteration.
|
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingprotected FeatureIterator<SimpleFeature> reader
protected SimpleFeatureBuilder builder
public ForceCoordinateSystemIterator(FeatureIterator<SimpleFeature> reader, SimpleFeatureType type, CoordinateReferenceSystem cs) throws SchemaException
reader - cs - SchemaExceptionNullPointerException - DOCUMENT ME!IllegalArgumentException - DOCUMENT ME!public SimpleFeatureType getFeatureType()
FeatureReader.getFeatureType()public SimpleFeature next() throws NoSuchElementException
FeatureIteratornext in interface Iterator<SimpleFeature>next in interface FeatureIterator<SimpleFeature>NoSuchElementException - If no more Features exist.FeatureReader.next()public boolean hasNext()
FeatureIteratorIterator defin: Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)
hasNext in interface Iterator<SimpleFeature>hasNext in interface FeatureIterator<SimpleFeature>FeatureReader.hasNext()public void remove()
remove in interface Iterator<SimpleFeature>public void close()
FeatureIteratorclose in interface Closeableclose in interface AutoCloseableclose in interface FeatureIterator<SimpleFeature>FeatureReader.close()Copyright © 1996–2019 Geotools. All rights reserved.