Package org.geotools.data.crs
Class ForceCoordinateSystemFeatureResults
Object
AbstractFeatureCollection
ForceCoordinateSystemFeatureResults
- All Implemented Interfaces:
SimpleFeatureCollection
,FeatureCollection<SimpleFeatureType,
SimpleFeature>
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
ConstructorsConstructorDescriptionForceCoordinateSystemFeatureResults
(FeatureCollection<SimpleFeatureType, SimpleFeature> results, CoordinateReferenceSystem forcedCS) ForceCoordinateSystemFeatureResults
(FeatureCollection<SimpleFeatureType, SimpleFeature> results, CoordinateReferenceSystem forcedCS, boolean forceOnlyMissing) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accepts
(FeatureVisitor visitor, ProgressListener progress) Visit the contents of a feature collection.protected boolean
canDelegate
(FeatureVisitor visitor) void
closeIterator
(Iterator close) Subclasses need to override this.Returns the feature results wrapped by this ForceCoordinateSystemFeatureResultsFactory 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 Details
-
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 Details
-
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
-
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:
-
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
Returns the feature results wrapped by this ForceCoordinateSystemFeatureResults -
accepts
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
-