|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.store.DataFeatureCollection org.geotools.data.DefaultFeatureResults
Generic "results" of a query, class.
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.
Nested Class Summary |
Nested classes inherited from class org.geotools.feature.Feature |
Feature.NULL |
Field Summary | |
protected FeatureSource |
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 |
Constructor Summary | |
DefaultFeatureResults(FeatureSource source,
Query query)
FeatureResults query against featureSource. |
Method Summary | |
FeatureCollection |
collection()
Convert this set of results to a FeatureCollection. |
com.vividsolutions.jts.geom.Envelope |
getBounds()
Returns the bounding box of this FeatureResults This implementation will generate the correct results from reader() if the provided FeatureSource does not provide an optimized result via FeatureSource.getBounds( Query ). |
int |
getCount()
Number of Features in this query. |
FeatureType |
getSchema()
FeatureSchema for provided query. |
protected Transaction |
getTransaction()
Returns transaction from featureSource (if it is a FeatureStore), or Transaction.AUTO_COMMIT if it is not. |
FeatureReader |
reader()
Retrieve a FeatureReader for this Query |
Methods inherited from class org.geotools.data.store.DataFeatureCollection |
accepts, add, addAll, addListener, clear, close, close, closeIterator, contains, containsAll, features, fireChange, fireChange, fireChange, getAttribute, getAttribute, getAttributes, getDefaultGeometry, getFeatureType, getID, getNumberOfAttributes, getParent, isEmpty, iterator, openIteartor, purge, remove, removeAll, removeListener, retainAll, setAttribute, setAttribute, setDefaultGeometry, setParent, size, sort, sort, subCollection, toArray, toArray, writer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Collection |
equals, hashCode |
Field Detail |
protected Query query
protected FeatureSource featureSource
Constructor Detail |
public DefaultFeatureResults(FeatureSource source, Query query)
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 featuresource using AUTO_COMMIT.
source
- query
- Method Detail |
public FeatureType 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
getSchema
in class DataFeatureCollection
java.io.IOException
- DOCUMENT ME!
DataSourceException
- DOCUMENT ME!protected Transaction getTransaction()
public FeatureReader reader() throws java.io.IOException
reader
in interface FeatureResults
reader
in class DataFeatureCollection
java.io.IOException
- If results could not be obtainedpublic com.vividsolutions.jts.geom.Envelope getBounds()
This implementation will generate the correct results from reader() if the provided FeatureSource 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 FeatureResults
getBounds
in class DataFeatureCollection
DataSourceException
- See IOExceptionFeatureResults.getBounds()
public int getCount() throws java.io.IOException
This implementation will generate the correct results from reader() if the provided FeatureSource does not provide an optimized result via FeatureSource.getCount( Query ).
getCount
in interface FeatureResults
getCount
in class DataFeatureCollection
java.io.IOException
- If feature could not be read
DataSourceException
- See IOExceptionFeatureResults.getCount()
public FeatureCollection collection() throws java.io.IOException
FeatureResults
This method is logically the same as:
public FeatureCollection collection() throws IOException {
FeatureCollection collection = FeatureCollections.newCollection()
for (FeatureReader r = reader(); r.hasNext();) {
collection.add( r.next() );
}
return collection;
}
collection
in interface FeatureResults
collection
in class DataFeatureCollection
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |