| org.geotools.data.FeatureSource
All known Subclasses: org.geotools.data.store.ContentFeatureSource, org.geotools.data.view.DefaultView, org.geotools.data.store.AbstractFeatureSource2, org.geotools.data.AbstractFeatureSource, org.geotools.data.postgis.WrappingPostgisFeatureSource, org.geotools.caching.impl.IndexView,
FeatureSource | public interface FeatureSource (Code) | | Highlevel API for Features from a specific location.
Individual Shapefiles, databases tables , etc. are referenced through this
interface. Compare and constrast with DataStore.
Differences from DataStore:
-
This is a prototype DataSource replacement, the Transaction methods have
been moved to an external object, and the locking api has been intergrated.
-
FeatureCollection has been replaced with FeatureResult as we do not wish to
indicate that results can be stored in memory.
-
FeatureSource has been split into three interfaces, the intention is to use
the instanceof opperator to check capabilities rather than the previous
DataSourceMetaData.
author: Jody Garnett author: Ray Gallagher author: Rob Hranac, TOPP author: Chris Holmes, TOPP version: $Id: FeatureSource.java 26489 2007-08-08 15:36:02Z aaime $ |
Method Summary | |
void | addFeatureListener(FeatureListener listener) Adds a listener to the list that's notified each time a change to the
FeatureStore occurs. | Envelope | getBounds() Gets the bounding box of this datasource. | Envelope | getBounds(Query query) Gets the bounding box of the features that would be returned by this
query.
To retrieve the bounds of the DataSource please use getBounds(
Query.ALL ) .
This method is needed if we are to stream features to a gml out, since a
FeatureCollection must have a boundedBy element.
If getBounds(Query) returns null due to expense consider
using getFeatures(Query).getBounds() as a an alternative.
Parameters: query - Contains the Filter and MaxFeatures to find the bounds for. | int | getCount(Query query) Gets the number of the features that would be returned by this query.
If getBounds(Query) returns -1 due to expense consider
using getFeatures(Query).getCount() as a an alternative.
Parameters: query - Contains the Filter and MaxFeatures to find the bounds for. | DataStore | getDataStore() Access to the DataStore implementing this FeatureStore. | FeatureCollection | getFeatures(Query query) Loads features from the datasource into the returned FeatureResults,
based on the passed query.
Parameters: query - a datasource query object. | FeatureCollection | getFeatures(Filter filter) Loads features from the datasource into the returned FeatureResults,
based on the passed filter.
Parameters: filter - An OpenGIS filter; specifies which features to retrieve.null is not allowed, use Filter.INCLUDE instead. | FeatureCollection | getFeatures() Loads all features from the datasource into the return FeatureResults.
Filter.INCLUDE can also be used to get all features. | FeatureType | getSchema() Retrieves the featureType that features extracted from this datasource
will be created with.
The schema returned is the LCD supported by all available Features. | public Set | getSupportedHints() Returns the set of hints this
FeatureSource is able to support.
Hints are to be specified in the
Query , for each data access where they
may be required.
Depending on the actual value provide by the user, the
FeatureSource may decide not to honor the hint. | void | removeFeatureListener(FeatureListener listener) Removes a listener from the list that's notified each time a change to
the FeatureStore occurs. |
addFeatureListener | void addFeatureListener(FeatureListener listener)(Code) | | Adds a listener to the list that's notified each time a change to the
FeatureStore occurs.
Parameters: listener - FeatureListener |
getBounds | Envelope getBounds() throws IOException(Code) | | Gets the bounding box of this datasource.
With getBounds(Query) this becomes a convenience method for
getBounds(Query.ALL), that is the bounds for all features contained
here.
If getBounds() returns null due to expense consider using
getFeatures().getBounds() as a an alternative.
The bounding box of the datasource or null if unknown and tooexpensive for the method to calculate. throws: IOException - if there are errors getting the bounding box. |
getBounds | Envelope getBounds(Query query) throws IOException(Code) | | Gets the bounding box of the features that would be returned by this
query.
To retrieve the bounds of the DataSource please use getBounds(
Query.ALL ) .
This method is needed if we are to stream features to a gml out, since a
FeatureCollection must have a boundedBy element.
If getBounds(Query) returns null due to expense consider
using getFeatures(Query).getBounds() as a an alternative.
Parameters: query - Contains the Filter and MaxFeatures to find the bounds for. The bounding box of the datasource or null if unknown and tooexpensive for the method to calculate or any errors occur. throws: IOException - DOCUMENT ME! |
getCount | int getCount(Query query) throws IOException(Code) | | Gets the number of the features that would be returned by this query.
If getBounds(Query) returns -1 due to expense consider
using getFeatures(Query).getCount() as a an alternative.
Parameters: query - Contains the Filter and MaxFeatures to find the bounds for. The number of Features provided by the Query or -1 if count is too expensive to calculate or any errors or occur. throws: IOException - if there are errors getting the count |
getDataStore | DataStore getDataStore()(Code) | | Access to the DataStore implementing this FeatureStore.
You may use this to access such as namespace provided by
DataStore.
DataStore implementing this FeatureStore |
getFeatures | FeatureCollection getFeatures(Query query) throws IOException(Code) | | Loads features from the datasource into the returned FeatureResults,
based on the passed query.
Parameters: query - a datasource query object. It encapsulates requestedinformation, such as typeName, maxFeatures and filter. Collection The collection to put the features into. throws: IOException - For all data source errors. See Also: Query |
getFeatures | FeatureCollection getFeatures(Filter filter) throws IOException(Code) | | Loads features from the datasource into the returned FeatureResults,
based on the passed filter.
Parameters: filter - An OpenGIS filter; specifies which features to retrieve.null is not allowed, use Filter.INCLUDE instead. Collection The collection to put the features into. throws: IOException - For all data source errors. |
getFeatures | FeatureCollection getFeatures() throws IOException(Code) | | Loads all features from the datasource into the return FeatureResults.
Filter.INCLUDE can also be used to get all features. Calling this function
is equivalent to using
Query.ALL
Collection The collection to put the features into. throws: IOException - For all data source errors. |
getSchema | FeatureType getSchema()(Code) | | Retrieves the featureType that features extracted from this datasource
will be created with.
The schema returned is the LCD supported by all available Features. In
the common case of shapfiles and database table this schema will match
that of every feature available. In the degenerate GML case this will
simply reflect the gml:AbstractFeatureType.
the schema of features created by this datasource. |
getSupportedHints | public Set getSupportedHints()(Code) | | Returns the set of hints this
FeatureSource is able to support.
Hints are to be specified in the
Query , for each data access where they
may be required.
Depending on the actual value provide by the user, the
FeatureSource may decide not to honor the hint.
a set of RenderingHints.Key objects (eventually empty, never null). |
removeFeatureListener | void removeFeatureListener(FeatureListener listener)(Code) | | Removes a listener from the list that's notified each time a change to
the FeatureStore occurs.
Parameters: listener - FeatureListener |
|
|