org.geotools.data.crs
Class ReprojectFeatureIterator

java.lang.Object
  extended by org.geotools.data.crs.ReprojectFeatureIterator
All Implemented Interfaces:
java.util.Iterator

public class ReprojectFeatureIterator
extends java.lang.Object
implements java.util.Iterator

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

Version:
$Id: ReprojectFeatureIterator.java 31101 2008-07-29 14:23:19Z aaime $
Author:
jgarnett, Refractions Research, Inc., aaime, $Author: jive $ (last modification)

Constructor Summary
ReprojectFeatureIterator(FeatureIterator<org.opengis.feature.simple.SimpleFeature> reader, org.opengis.feature.simple.SimpleFeatureType schema, org.opengis.referencing.operation.MathTransform transform)
           
 
Method Summary
 void close()
          Implement close.
 org.opengis.feature.simple.SimpleFeatureType getFeatureType()
          Implement getFeatureType.
 boolean hasNext()
          Implement hasNext.
 java.lang.Object next()
          Implement next.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReprojectFeatureIterator

public ReprojectFeatureIterator(FeatureIterator<org.opengis.feature.simple.SimpleFeature> reader,
                                org.opengis.feature.simple.SimpleFeatureType schema,
                                org.opengis.referencing.operation.MathTransform transform)
Method Detail

getFeatureType

public org.opengis.feature.simple.SimpleFeatureType getFeatureType()
Implement getFeatureType.

Description ...

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

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Implement next.

Description ...

Specified by:
next in interface java.util.Iterator
Throws:
java.io.IOException
IllegalAttributeException
java.util.NoSuchElementException
java.lang.IllegalStateException - DOCUMENT ME!
DataSourceException - DOCUMENT ME!
See Also:
FeatureReader.next()

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

hasNext

public boolean hasNext()
Implement hasNext.

Description ...

Specified by:
hasNext in interface java.util.Iterator
Throws:
java.io.IOException
java.lang.IllegalStateException - DOCUMENT ME!
See Also:
FeatureReader.hasNext()

close

public void close()
Implement close.

Description ...

Throws:
java.io.IOException
java.lang.IllegalStateException - DOCUMENT ME!
See Also:
FeatureReader.close()


Copyright © 1996-2010 Geotools. All Rights Reserved.