public interface FeatureSource<T extends FeatureType,F extends Feature>
DataStore
 object to connect to the physical source and then retrieve a FeatureSource to work with
 the feature data, as in this excerpt from the GeoTools Quickstart example (http://geotools.org/quickstart.html)
 
     File file = ...
     FileDataStore store = FileDataStoreFinder.getDataStore(file);
     FeatureSource featureSource = store.getFeatureSource();
 DataStore| Modifier and Type | Method and Description | 
|---|---|
| void | addFeatureListener(FeatureListener listener)Registers a listening object that will be notified of changes to this  FeatureSource. | 
| ReferencedEnvelope | getBounds()Get the spatial bounds of the feature data. | 
| ReferencedEnvelope | getBounds(Query query)Get the spatial bounds of the features that would be returned by the given  Query. | 
| int | getCount(Query query)Gets the number of the features that would be returned by the given
  Query, taking into account any settings for max features and
 start index set on theQuery. | 
| DataAccess<T,F> | getDataStore()Returns the data source, as a  DataAccessobject, providing thisFeatureSource. | 
| FeatureCollection<T,F> | getFeatures()Retrieves all features in the form of a  FeatureCollection. | 
| FeatureCollection<T,F> | getFeatures(Filter filter)Retrieves features, in the form of a  FeatureCollection, based on an OGCFilter. | 
| FeatureCollection<T,F> | getFeatures(Query query)Retrieves features, in the form of a  FeatureCollection, based on aQuery. | 
| ResourceInfo | getInfo()Returns information describing this  FeatureSourcewhich may include title,
 description and spatial parameters. | 
| Name | getName()Returns the name of the features (strictly, the name of the  AttributeDescriptorfor
 the features) accessible through thisFeatureSource. | 
| QueryCapabilities | getQueryCapabilities()Enquire what what query capabilities this  FeatureSourcenatively supports. | 
| T | getSchema()Retrieves the schema (feature type) that will apply to features retrieved from this  FeatureSource. | 
| Set<RenderingHints.Key> | getSupportedHints()Returns the set of hints that this  FeatureSourcesupports viaQueryrequests. | 
| void | removeFeatureListener(FeatureListener listener)Removes an object from this  FeatureSource'slisteners. | 
Name getName()
AttributeDescriptor for
 the features) accessible through this FeatureSource.
 The value returned by this method can be different to that returned by featureSource.getSchema().getType().getName(). This is because there is a distinction
 between the name applied to features and the name of a feature type. When working with SimpleFeature and SimpleFeatureType, for example with a shapefile data source, it is
 common practice for feature and feature type names to be the same. However, this is not the
 case more generally. For instance, a database can contain two tables with the same structure.
 The feature name will refer to the table while the feature type name refers to the schema
 (table structure).
FeatureSourceResourceInfo getInfo()
FeatureSource which may include title,
 description and spatial parameters. Note that in the returned ResourceInfo object,
 the distinction between feature name and schema (feature type) name applies as discussed for
 getName().DataAccess<T,F> getDataStore()
DataAccess object, providing this FeatureSource.FeatureSourceQueryCapabilities getQueryCapabilities()
FeatureSource natively supports. For
 example, whether queries can return sorted results.FeatureSourcevoid addFeatureListener(FeatureListener listener)
FeatureSource.listener - the new listenervoid removeFeatureListener(FeatureListener listener)
FeatureSource's listeners.listener - the listener to removeFeatureCollection<T,F> getFeatures(Filter filter) throws IOException
FeatureCollection, based on an OGC Filter.filter - the filter to select features; must not be null (use Filter.INCLUDE instead)FilterIOException - if the underlying data source cannot be accessed.FilterFeatureCollection<T,F> getFeatures(Query query) throws IOException
FeatureCollection, based on a Query.query - DataAccess query for requested information, such as typeName, maxFeatures and
     filter.QueryIOException - if the underlying data source cannot be accessed.QueryFeatureCollection<T,F> getFeatures() throws IOException
FeatureCollection.
 The following statements are equivalent:
     featureSource.getFeatures();
     featureSource.getFeatures(Filter.INCLUDE);
     featureSource.getFeatures(Query.ALL);
 QueryIOException - if the underlying data source cannot be accessed.T getSchema()
FeatureSource.
 For a homogeneous data source such as a shapefile or a database table, this schema be that of all features. For a heterogeneous data source, e.g. a GML document, the schema returned is the lowest common denominator across all features.
FeatureSourceReferencedEnvelope getBounds() throws IOException
 getBounds(Query.ALL).
 It is possible that this method will return null if the calculation of bounds is judged to
 be too costly by the implementing class. In this case, you might call 
 getFeatures().getBounds() instead.
null if the bounds are unknown
     or too costly to calculate.IOException - on any errors calculating the boundsReferencedEnvelope getBounds(Query query) throws IOException
Query.
 It is possible that this method will return null if the calculation of bounds is judged to
 be too costly by the implementing class. In this case, you might call 
 getFeatures(query).getBounds() instead.
query - the query to select featuresnull if the bounds are unknown
     or too costly to calculate.IOException - on any errors calculating the boundsint getCount(Query query) throws IOException
Query, taking into account any settings for max features and
 start index set on the Query.
 
 It is possible that this method will return -1 if the calculation
 of number of features is judged to be too costly by the implementing class.
 In this case, you might call getFeatures(query).size()
 instead.
 
Example use:
 int count = featureSource.getCount();
 if( count == -1 ){
    count = featureSource.getFeatures( "typeName", count ).size();
 }query - the query to select featuresQuery;
         or -1 if this cannot be calculated.IOException - if there are errors getting the countSet<RenderingHints.Key> getSupportedHints()
FeatureSource supports via Query requests.
 Note: the existence of a specific hint does not guarantee that it will always be honored by the implementing class.
RenderingHints#Key objects; may be empty but never nullHints.FEATURE_DETACHED, 
Hints.JTS_GEOMETRY_FACTORY, 
Hints.JTS_COORDINATE_SEQUENCE_FACTORY, 
Hints.JTS_PRECISION_MODEL, 
Hints.JTS_SRID, 
Hints.GEOMETRY_DISTANCE, 
Hints.FEATURE_2DCopyright © 1996–2019 Geotools. All rights reserved.