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 voidaccepts(FeatureVisitor visitor, ProgressListener progress)Visit the contents of a feature collection.protected booleancanDelegate(FeatureVisitor visitor)voidcloseIterator(Iterator close)ReferencedEnvelopegetBounds()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().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 Detail
-
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 Detail
-
openIterator
public 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 classAbstractFeatureCollection- Returns:
- Iterator over collection contents
-
closeIterator
public void closeIterator(Iterator close)
-
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:
Collection.size()
-
getBounds
public ReferencedEnvelope 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
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: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
protected boolean canDelegate(FeatureVisitor visitor)
-
-