public class ForceCoordinateSystemFeatureResults extends AbstractFeatureCollection
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 );
id, schema
Constructor and Description |
---|
ForceCoordinateSystemFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results,
CoordinateReferenceSystem forcedCS) |
ForceCoordinateSystemFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results,
CoordinateReferenceSystem forcedCS,
boolean forceOnlyMissing) |
Modifier and Type | Method and 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 ForceCoordinateSystemFeatureResults
|
Iterator<SimpleFeature> |
openIterator()
Factory method used to open an iterator over collection contents for use by
AbstractFeatureCollection.iterator() and AbstractFeatureCollection.features() . |
int |
size()
Returns the number of elements in this collection.
|
contains, containsAll, features, getID, getSchema, isEmpty, iterator, sort, subCollection, toArray, toArray
public ForceCoordinateSystemFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results, CoordinateReferenceSystem forcedCS) throws IOException, SchemaException
IOException
SchemaException
public ForceCoordinateSystemFeatureResults(FeatureCollection<SimpleFeatureType,SimpleFeature> results, CoordinateReferenceSystem forcedCS, boolean forceOnlyMissing) throws IOException, SchemaException
IOException
SchemaException
public Iterator<SimpleFeature> openIterator()
AbstractFeatureCollection
AbstractFeatureCollection.iterator()
and AbstractFeatureCollection.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
using AbstractFeatureCollection.iterator()
will perform the same check.
openIterator
in class AbstractFeatureCollection
public void closeIterator(Iterator close)
public int size()
AbstractFeatureCollection
size
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
size
in class AbstractFeatureCollection
Collection.size()
public ReferencedEnvelope getBounds()
AbstractFeatureCollection
getBounds
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
getBounds
in class AbstractFeatureCollection
org.geotools.data.FeatureResults#getBounds()
public FeatureCollection<SimpleFeatureType,SimpleFeature> getOrigin()
public void accepts(FeatureVisitor visitor, ProgressListener progress) throws IOException
FeatureCollection
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.
accepts
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
accepts
in class AbstractFeatureCollection
visitor
- Closure applied to each feature in turn.progress
- Used to report progress, may be used to interrupt the operationIOException
protected boolean canDelegate(FeatureVisitor visitor)
Copyright © 1996–2019 Geotools. All rights reserved.