Package org.geotools.data.crs
Class ForceCoordinateSystemFeatureResults
- Object
-
- AbstractFeatureCollection
-
- ForceCoordinateSystemFeatureResults
-
- All Implemented Interfaces:
SimpleFeatureCollection
,FeatureCollection<SimpleFeatureType,SimpleFeature>
public class ForceCoordinateSystemFeatureResults extends AbstractFeatureCollection
ForceCoordinateSystemFeatureResults provides a CoordinateReferenceSystem for FeatureTypes.ForceCoordinateSystemFeatureReader is a wrapper used to force GeometryAttributes to a user supplied CoordinateReferenceSystem rather then the default supplied by the DataStore.
Example Use:
ForceCoordinateSystemFeatureResults results = new ForceCoordinateSystemFeatureResults( originalResults, forceCS ); CoordinateReferenceSystem originalCS = originalResults.getFeatureType().getDefaultGeometry().getCoordinateSystem(); CoordinateReferenceSystem newCS = reader.getFeatureType().getDefaultGeometry().getCoordinateSystem(); assertEquals( forceCS, newCS );
- Author:
- aaime
-
-
Field Summary
-
Fields inherited from class AbstractFeatureCollection
id, schema
-
-
Constructor Summary
Constructors Constructor Description ForceCoordinateSystemFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results, CoordinateReferenceSystem forcedCS)
ForceCoordinateSystemFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results, CoordinateReferenceSystem forcedCS, boolean forceOnlyMissing)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accepts(FeatureVisitor visitor, ProgressListener progress)
Visit the contents of a feature collection.protected boolean
canDelegate(FeatureVisitor visitor)
void
closeIterator(Iterator close)
ReferencedEnvelope
getBounds()
Subclasses need to override this.FeatureCollection<SimpleFeatureType,SimpleFeature>
getOrigin()
Returns the feature results wrapped by this ForceCoordinateSystemFeatureResultsIterator<SimpleFeature>
openIterator()
Factory method used to open an iterator over collection contents for use byAbstractFeatureCollection.iterator()
andAbstractFeatureCollection.features()
.int
size()
Returns the number of elements in this collection.-
Methods inherited from class AbstractFeatureCollection
contains, containsAll, features, getID, getSchema, isEmpty, iterator, sort, subCollection, toArray, toArray
-
-
-
-
Constructor Detail
-
ForceCoordinateSystemFeatureResults
public ForceCoordinateSystemFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results, CoordinateReferenceSystem forcedCS) throws IOException, SchemaException
- Throws:
IOException
SchemaException
-
ForceCoordinateSystemFeatureResults
public ForceCoordinateSystemFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results, CoordinateReferenceSystem forcedCS, boolean forceOnlyMissing) throws IOException, SchemaException
- Throws:
IOException
SchemaException
-
-
Method Detail
-
openIterator
public Iterator<SimpleFeature> openIterator()
Description copied from class:AbstractFeatureCollection
Factory 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:
openIterator
in classAbstractFeatureCollection
- Returns:
- Iterator over collection contents
-
closeIterator
public void closeIterator(Iterator close)
-
size
public int size()
Description copied from class:AbstractFeatureCollection
Returns the number of elements in this collection.- Specified by:
size
in interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
size
in classAbstractFeatureCollection
- Returns:
- Number of items, or Interger.MAX_VALUE
- See Also:
Collection.size()
-
getBounds
public ReferencedEnvelope getBounds()
Description copied from class:AbstractFeatureCollection
Subclasses need to override this.- Specified by:
getBounds
in interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
getBounds
in classAbstractFeatureCollection
- Returns:
- An Envelope containing the total bounds of this collection.
- See Also:
org.geotools.data.FeatureResults#getBounds()
-
getOrigin
public FeatureCollection<SimpleFeatureType,SimpleFeature> getOrigin()
Returns the feature results wrapped by this ForceCoordinateSystemFeatureResults
-
accepts
public void accepts(FeatureVisitor visitor, ProgressListener progress) throws IOException
Description copied from interface:FeatureCollection
Visit 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:
accepts
in interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>
- Overrides:
accepts
in classAbstractFeatureCollection
- Parameters:
visitor
- Closure applied to each feature in turn.progress
- Used to report progress, may be used to interrupt the operation- Throws:
IOException
-
canDelegate
protected boolean canDelegate(FeatureVisitor visitor)
-
-