public class DefaultFeatureResults extends DataFeatureCollection
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.
Modifier and Type | Field and Description |
---|---|
protected SimpleFeatureSource |
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.
|
protected Query |
query
Query used to define this subset of features from the feature source
|
protected MathTransform |
transform |
id, listeners, schema
Constructor and Description |
---|
DefaultFeatureResults(SimpleFeatureSource source,
Query query)
FeatureResults query against featureSource.
|
Modifier and Type | Method and Description |
---|---|
protected FeatureReader<SimpleFeatureType,SimpleFeature> |
boundsReader()
Retrieve a FeatureReader
|
SimpleFeatureCollection |
collection() |
ReferencedEnvelope |
getBounds()
Returns the bounding box of this FeatureResults
This implementation will generate the correct results from reader() if the provided
SimpleFeatureSource does not provide an optimized result via FeatureSource.getBounds( Query
).
|
int |
getCount()
Number of Features in this query.
|
SimpleFeatureType |
getSchema()
FeatureSchema for provided query.
|
protected Transaction |
getTransaction()
Returns transaction from SimpleFeatureSource (if it is a FeatureStore), or
Transaction.AUTO_COMMIT if it is not.
|
FeatureReader<SimpleFeatureType,SimpleFeature> |
reader()
Retrieve a FeatureReader
|
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
protected Query query
protected SimpleFeatureSource featureSource
protected MathTransform transform
public DefaultFeatureResults(SimpleFeatureSource source, Query query) throws IOException
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.
source
- query
- IOException
public SimpleFeatureType getSchema()
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().
getSchema
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
getSchema
in class DataFeatureCollection
IOException
- DOCUMENT ME!DataSourceException
- DOCUMENT ME!protected Transaction getTransaction()
public FeatureReader<SimpleFeatureType,SimpleFeature> reader() throws IOException
reader
in class DataFeatureCollection
IOException
- If results could not be obtainedprotected FeatureReader<SimpleFeatureType,SimpleFeature> boundsReader() throws IOException
IOException
public ReferencedEnvelope getBounds()
This 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.
getBounds
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
getBounds
in class DataFeatureCollection
DataSourceException
- See IOExceptionorg.geotools.data.FeatureResults#getBounds()
public int getCount() throws IOException
This implementation will generate the correct results from reader() if the provided SimpleFeatureSource does not provide an optimized result via FeatureSource.getCount( Query ).
getCount
in class DataFeatureCollection
IOException
- If feature could not be readDataSourceException
- See IOExceptionorg.geotools.data.FeatureResults#getCount()
public SimpleFeatureCollection collection() throws IOException
IOException
Copyright © 1996–2019 Geotools. All rights reserved.