org.geotools.data.crs
Class ReprojectFeatureReader

java.lang.Object
  extended byorg.geotools.data.crs.ReprojectFeatureReader
All Implemented Interfaces:
FeatureReader

public class ReprojectFeatureReader
extends java.lang.Object
implements FeatureReader

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: ReprojectFeatureReader.java 17701 2006-01-23 00:00:51Z desruisseaux $
Author:
jgarnett, Refractions Research, Inc., aaime, $Author: jive $ (last modification)

Constructor Summary
ReprojectFeatureReader(FeatureReader reader, org.opengis.referencing.crs.CoordinateReferenceSystem cs)
           
ReprojectFeatureReader(FeatureReader reader, FeatureType schema, org.opengis.referencing.operation.MathTransform transform)
           
 
Method Summary
 void close()
          Implement close.
 FeatureType getFeatureType()
          Implement getFeatureType.
 boolean hasNext()
          Implement hasNext.
 Feature next()
          Implement next.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReprojectFeatureReader

public ReprojectFeatureReader(FeatureReader reader,
                              FeatureType schema,
                              org.opengis.referencing.operation.MathTransform transform)

ReprojectFeatureReader

public ReprojectFeatureReader(FeatureReader reader,
                              org.opengis.referencing.crs.CoordinateReferenceSystem cs)
                       throws SchemaException,
                              org.opengis.referencing.operation.OperationNotFoundException,
                              java.util.NoSuchElementException,
                              org.opengis.referencing.FactoryException
Method Detail

getFeatureType

public FeatureType getFeatureType()
Implement getFeatureType.

Description ...

Specified by:
getFeatureType in interface FeatureReader
Returns:
Throws:
java.lang.IllegalStateException - DOCUMENT ME!
See Also:
FeatureReader.getFeatureType()

next

public Feature next()
             throws java.io.IOException,
                    IllegalAttributeException,
                    java.util.NoSuchElementException
Implement next.

Description ...

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

hasNext

public boolean hasNext()
                throws java.io.IOException
Implement hasNext.

Description ...

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

close

public void close()
           throws java.io.IOException
Implement close.

Description ...

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


Copyright © GeoTools. All Rights Reserved.