Class DefaultFeatureResults
- All Implemented Interfaces:
SimpleFeatureCollection
,FeatureCollection<SimpleFeatureType,
SimpleFeature>
Please optimize this class when use with your own content. For example a "ResultSet" make a great cache for a JDBCDataStore, a temporary copy of an original file may work for shapefile etc.
- Author:
- Jody Garnett, Refractions Research
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SimpleFeatureSource
Feature source used to aquire features, note we are only a "view" of this FeatureSource, its contents, transaction and events need to be forwarded through this collection api to simplier code such as renderers.protected Query
Query used to define this subset of features from the feature sourceprotected MathTransform
Fields inherited from class DataFeatureCollection
id, listeners, schema
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFeatureResults
(SimpleFeatureSource source, Query query) FeatureResults query against featureSource. -
Method Summary
Modifier and TypeMethodDescriptionprotected FeatureReader<SimpleFeatureType,
SimpleFeature> Retrieve a FeatureReader<SimpleFeatureType, SimpleFeature> for the geometry attributes only, designed for bounds computationReturns the bounding box of this FeatureResultsint
getCount()
Number of Features in this query.FeatureSchema for provided query.protected Transaction
Returns transaction from SimpleFeatureSource (if it is a FeatureStore), or Transaction.AUTO_COMMIT if it is not.reader()
Retrieve a FeatureReader<SimpleFeatureType, SimpleFeature> for this QueryMethods inherited from class DataFeatureCollection
accepts, add, addAll, addAll, addListener, clear, close, close, closeIterator, contains, containsAll, features, fireChange, fireChange, fireChange, getID, isEmpty, iterator, openIterator, purge, remove, removeAll, removeListener, retainAll, size, sort, subCollection, toArray, toArray, writer
-
Field Details
-
query
Query used to define this subset of features from the feature source -
featureSource
Feature source used to aquire features, note we are only a "view" of this FeatureSource, its contents, transaction and events need to be forwarded through this collection api to simplier code such as renderers. -
transform
-
-
Constructor Details
-
DefaultFeatureResults
FeatureResults query against featureSource.Please note that is object will not be valid after the transaction has closed.
Really? I think it would be, it would just reflect the same query against the SimpleFeatureSource using AUTO_COMMIT.
- Throws:
IOException
-
-
Method Details
-
getSchema
FeatureSchema for provided query.If query.retrieveAllProperties() is
true
the FeatureSource getSchema() will be returned.If query.getPropertyNames() is used to limit the result of the Query a sub type will be returned based on FeatureSource.getSchema().
- Specified by:
getSchema
in interfaceFeatureCollection<SimpleFeatureType,
SimpleFeature> - Overrides:
getSchema
in classDataFeatureCollection
- Returns:
- FeatureType describing the "common" schema to all child features of this collection
-
getTransaction
Returns transaction from SimpleFeatureSource (if it is a FeatureStore), or Transaction.AUTO_COMMIT if it is not.- Returns:
- Transacstion this FeatureResults opperates against
-
reader
Retrieve a FeatureReader<SimpleFeatureType, SimpleFeature> for this Query- Overrides:
reader
in classDataFeatureCollection
- Returns:
- FeatureReader<SimpleFeatureType, SimpleFeature> for this Query
- Throws:
IOException
- If results could not be obtained
-
boundsReader
Retrieve a FeatureReader<SimpleFeatureType, SimpleFeature> for the geometry attributes only, designed for bounds computation- Throws:
IOException
-
getBounds
Returns the bounding box of this FeatureResultsThis implementation will generate the correct results from reader() if the provided SimpleFeatureSource does not provide an optimized result via FeatureSource.getBounds( Query ). If the feature has no geometry, then an empty envelope is returned.
- Specified by:
getBounds
in interfaceFeatureCollection<SimpleFeatureType,
SimpleFeature> - Specified by:
getBounds
in classDataFeatureCollection
- Returns:
- An Envelope containing the total bounds of this collection.
- See Also:
-
org.geotools.data.FeatureResults#getBounds()
-
getCount
Number of Features in this query.This implementation will generate the correct results from reader() if the provided SimpleFeatureSource does not provide an optimized result via FeatureSource.getCount( Query ).
- Specified by:
getCount
in classDataFeatureCollection
- Throws:
IOException
- If feature could not be readDataSourceException
- See IOException- See Also:
-
org.geotools.data.FeatureResults#getCount()
-
collection
- Throws:
IOException
-