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 TypeMethodDescriptionvoidaccepts(FeatureVisitor visitor, ProgressListener progress) Visit the contents of a feature collection.protected booleancanDelegate(FeatureVisitor visitor) voidcloseIterator(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().intsize()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:
IOExceptionSchemaException
-
ForceCoordinateSystemFeatureResults
public ForceCoordinateSystemFeatureResults(FeatureCollection<SimpleFeatureType, SimpleFeature> results, CoordinateReferenceSystem forcedCS, boolean forceOnlyMissing) throws IOException, SchemaException- Throws:
IOExceptionSchemaException
-
-
Method Details
-
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 classAbstractFeatureCollection- Returns:
- Iterator over collection contents
-
closeIterator
-
size
public int size()Description copied from class:AbstractFeatureCollectionReturns the number of elements in this collection.- Specified by:
sizein interfaceFeatureCollection<SimpleFeatureType,SimpleFeature> - Specified by:
sizein classAbstractFeatureCollection- Returns:
- Number of items, or Interger.MAX_VALUE
- See Also:
-
getBounds
Description copied from class:AbstractFeatureCollectionSubclasses need to override this.- Specified by:
getBoundsin interfaceFeatureCollection<SimpleFeatureType,SimpleFeature> - Specified by:
getBoundsin 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: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 interfaceFeatureCollection<SimpleFeatureType,SimpleFeature> - Overrides:
acceptsin 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
-