Package org.geotools.data.crs
Class ReprojectFeatureResults
- Object
- 
- AbstractFeatureCollection
- 
- ReprojectFeatureResults
 
 
- 
- All Implemented Interfaces:
- SimpleFeatureCollection,- FeatureCollection<SimpleFeatureType,SimpleFeature>
 
 public class ReprojectFeatureResults extends AbstractFeatureCollection ReprojectFeatureReader provides a reprojection for FeatureTypes.ReprojectFeatureResults is a wrapper used to reproject GeometryAttributes to a user supplied CoordinateReferenceSystem from the original CoordinateReferenceSystem supplied by the original FeatureResults. Example Use: ReprojectFeatureResults results = new ReprojectFeatureResults( originalResults, reprojectCS ); CoordinateReferenceSystem originalCS = originalResults.getFeatureType().getDefaultGeometry().getCoordinateSystem(); CoordinateReferenceSystem newCS = results.getFeatureType().getDefaultGeometry().getCoordinateSystem(); assertEquals( reprojectCS, newCS );- Author:
- aaime, $Author: jive $ (last modification)
 
- 
- 
Field Summary- 
Fields inherited from class AbstractFeatureCollectionid, schema
 
- 
 - 
Constructor SummaryConstructors Constructor Description ReprojectFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results, CoordinateReferenceSystem destinationCS)Creates a new reprojecting feature results
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccepts(FeatureVisitor visitor, ProgressListener progress)Visit the contents of a feature collection.protected booleancanDelegate(FeatureVisitor visitor)voidcloseIterator(Iterator close)ReferencedEnvelopegetBounds()This method computes reprojected bounds the hard way, but computing them feature by feature.FeatureCollection<SimpleFeatureType,SimpleFeature>getOrigin()Returns the feature results wrapped by this reprojecting feature resultsIterator<SimpleFeature>openIterator()Factory method used to open an iterator over collection contents for use byAbstractFeatureCollection.iterator()andAbstractFeatureCollection.features().intsize()Returns the number of elements in this collection.- 
Methods inherited from class AbstractFeatureCollectioncontains, containsAll, features, getID, getSchema, isEmpty, iterator, sort, subCollection, toArray, toArray
 
- 
 
- 
- 
- 
Constructor Detail- 
ReprojectFeatureResultspublic ReprojectFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results, CoordinateReferenceSystem destinationCS) throws IOException, SchemaException, TransformException, OperationNotFoundException, NoSuchElementException, FactoryException Creates a new reprojecting feature results
 
- 
 - 
Method Detail- 
openIteratorpublic Iterator<SimpleFeature> openIterator() Description copied from class:AbstractFeatureCollectionFactory method used to open an iterator over collection contents for use byAbstractFeatureCollection.iterator()andAbstractFeatureCollection.features().If you return an instance of FeatureIterator some effort is taken to call the FeatureIterator.close()internally, however we cannot offer any assurance that client code usingAbstractFeatureCollection.iterator()will perform the same check.- Specified by:
- openIteratorin class- AbstractFeatureCollection
- Returns:
- Iterator over collection contents
 
 - 
closeIteratorpublic void closeIterator(Iterator close) 
 - 
sizepublic int size() Description copied from class:AbstractFeatureCollectionReturns the number of elements in this collection.- Specified by:
- sizein interface- FeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
- sizein class- AbstractFeatureCollection
- Returns:
- Number of items, or Interger.MAX_VALUE
- See Also:
- Collection.size()
 
 - 
getBoundspublic ReferencedEnvelope getBounds() This method computes reprojected bounds the hard way, but computing them feature by feature. This method could be faster if computed the reprojected bounds by reprojecting the original feature bounds a Shape object, thus getting the true shape of the reprojected envelope, and then computing the minumum and maximum coordinates of that new shape. The result would not a true representation of the new bounds, but it would be guaranteed to be larger that the true representation.- Specified by:
- getBoundsin interface- FeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
- getBoundsin class- AbstractFeatureCollection
- Returns:
- An Envelope containing the total bounds of this collection.
- See Also:
- org.geotools.data.FeatureResults#getBounds()
 
 - 
getOriginpublic FeatureCollection<SimpleFeatureType,SimpleFeature> getOrigin() Returns the feature results wrapped by this reprojecting feature results
 - 
acceptspublic void accepts(FeatureVisitor visitor, ProgressListener progress) throws IOException Description copied from interface:FeatureCollectionVisit the contents of a feature collection.The order of traversal is dependent on the FeatureCollection implementation; some collections are able to make efficient use of an internal index in order to quickly visit features located in the same region. - Specified by:
- acceptsin interface- FeatureCollection<SimpleFeatureType,SimpleFeature>
- Overrides:
- acceptsin class- AbstractFeatureCollection
- Parameters:
- visitor- Closure applied to each feature in turn.
- progress- Used to report progress, may be used to interrupt the operation
- Throws:
- IOException
 
 - 
canDelegateprotected boolean canDelegate(FeatureVisitor visitor) 
 
- 
 
-