org.geotools.data.crs
Class ReprojectFeatureIterator

Object
  extended by ReprojectFeatureIterator
All Implemented Interfaces:
Closeable, 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:


 ReprojectFeatureReader reader =
     new ReprojectFeatureReader( originalReader, reprojectCS );
 
 CoordinateReferenceSystem originalCS =
     originalReader.getFeatureType().getDefaultGeometry().getCoordinateSystem();
 
 CoordinateReferenceSystem newCS =
     reader.getFeatureType().getDefaultGeometry().getCoordinateSystem();
 
 assertEquals( reprojectCS, newCS );
 

TODO: handle the case where there is more than one geometry and the other geometries have a different CS than the default geometry

Author:
jgarnett, Refractions Research, Inc., aaime, $Author: jive $ (last modification)

Constructor Summary
ReprojectFeatureIterator(FeatureIterator<SimpleFeature> reader, SimpleFeatureType schema, MathTransform transform)
           
 
Method Summary
 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
 

Constructor Detail

ReprojectFeatureIterator

public ReprojectFeatureIterator(FeatureIterator<SimpleFeature> reader,
                                SimpleFeatureType schema,
                                MathTransform transform)
Method Detail

getFeatureType

public SimpleFeatureType getFeatureType()
Implement getFeatureType.

Description ...

Throws:
IllegalStateException - DOCUMENT ME!
See Also:
FeatureReader.getFeatureType()

next

public SimpleFeature next()
                   throws NoSuchElementException
Implement next.

Description ...

Specified by:
next in interface Iterator<SimpleFeature>
Specified by:
next in interface FeatureIterator<SimpleFeature>
Returns:
The next Feature
Throws:
IOException
IllegalAttributeException
NoSuchElementException
IllegalStateException - DOCUMENT ME!
DataSourceException - DOCUMENT ME!
See Also:
FeatureReader.next()

remove

public void remove()
Specified by:
remove in interface Iterator<SimpleFeature>

hasNext

public boolean hasNext()
Implement hasNext.

Description ...

Specified by:
hasNext in interface Iterator<SimpleFeature>
Specified by:
hasNext in interface FeatureIterator<SimpleFeature>
Returns:
true if more Features exist, false otherwise.
Throws:
IOException
IllegalStateException - DOCUMENT ME!
See Also:
FeatureReader.hasNext()

close

public void close()
Implement close.

Description ...

Specified by:
close in interface Closeable
Specified by:
close in interface FeatureIterator<SimpleFeature>
Throws:
IOException
IllegalStateException - DOCUMENT ME!
See Also:
FeatureReader.close()


Copyright © 1996-2014 Geotools. All Rights Reserved.