Package org.geotools.data.crs
Class ReprojectFeatureIterator
- Object
-
- ReprojectFeatureIterator
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<SimpleFeature>
,SimpleFeatureIterator
,FeatureIterator<SimpleFeature>
public class ReprojectFeatureIterator extends Object implements Iterator<SimpleFeature>, SimpleFeatureIterator
ReprojectFeatureReader provides a reprojection for FeatureTypes.ReprojectFeatureReader is a wrapper used to reproject GeometryAttributes to a user supplied CoordinateReferenceSystem from the original CoordinateReferenceSystem supplied by the original FeatureReader.
Example Use:
TODO: handle the case where there is more than one geometry and the other geometries have a different CS than the default geometryReprojectFeatureReader reader = new ReprojectFeatureReader( originalReader, reprojectCS ); CoordinateReferenceSystem originalCS = originalReader.getFeatureType().getDefaultGeometry().getCoordinateSystem(); CoordinateReferenceSystem newCS = reader.getFeatureType().getDefaultGeometry().getCoordinateSystem(); assertEquals( reprojectCS, newCS );
- Author:
- jgarnett, Refractions Research, Inc., aaime, $Author: jive $ (last modification)
-
-
Constructor Summary
Constructors Constructor Description ReprojectFeatureIterator(FeatureIterator<SimpleFeature> reader, SimpleFeatureType schema, MathTransform transform)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Implement close.SimpleFeatureType
getFeatureType()
Implement getFeatureType.boolean
hasNext()
Implement hasNext.SimpleFeature
next()
Implement next.void
remove()
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
ReprojectFeatureIterator
public ReprojectFeatureIterator(FeatureIterator<SimpleFeature> reader, SimpleFeatureType schema, MathTransform transform)
-
-
Method Detail
-
getFeatureType
public SimpleFeatureType getFeatureType()
Implement getFeatureType.Description ...
- See Also:
FeatureReader.getFeatureType()
-
next
public SimpleFeature next() throws NoSuchElementException
Implement next.Description ...
- Specified by:
next
in interfaceFeatureIterator<SimpleFeature>
- Specified by:
next
in interfaceIterator<SimpleFeature>
- Returns:
- The next Feature
- Throws:
NoSuchElementException
- If no more Features exist.- See Also:
FeatureReader.next()
-
remove
public void remove()
- Specified by:
remove
in interfaceIterator<SimpleFeature>
-
hasNext
public boolean hasNext()
Implement hasNext.Description ...
- Specified by:
hasNext
in interfaceFeatureIterator<SimpleFeature>
- Specified by:
hasNext
in interfaceIterator<SimpleFeature>
- Returns:
- true if more Features exist, false otherwise.
- See Also:
FeatureReader.hasNext()
-
close
public void close()
Implement close.Description ...
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceFeatureIterator<SimpleFeature>
- See Also:
FeatureReader.close()
-
-