|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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:
Method Summary | |
void |
addFeatureListener(FeatureListener listener)
Adds a listener to the list that's notified each time a change to the FeatureStore occurs. |
com.vividsolutions.jts.geom.Envelope |
getBounds()
Gets the bounding box of this datasource. |
com.vividsolutions.jts.geom.Envelope |
getBounds(Query query)
Gets the bounding box of the features that would be returned by this query. |
int |
getCount(Query query)
Gets the number of the features that would be returned by this query. |
DataStore |
getDataStore()
Access to the DataStore implementing this FeatureStore. |
FeatureResults |
getFeatures()
Loads all features from the datasource into the return FeatureResults. |
FeatureResults |
getFeatures(Filter filter)
Loads features from the datasource into the returned FeatureResults, based on the passed filter. |
FeatureResults |
getFeatures(Query query)
Loads features from the datasource into the returned FeatureResults, based on the passed query. |
FeatureType |
getSchema()
Retrieves the featureType that features extracted from this datasource will be created with. |
void |
removeFeatureListener(FeatureListener listener)
Removes a listener from the list that's notified each time a change to the FeatureStore occurs. |
Method Detail |
public DataStore getDataStore()
You may use this to access such as namespace
provided by
DataStore.
public void addFeatureListener(FeatureListener listener)
listener
- FeatureListenerpublic void removeFeatureListener(FeatureListener listener)
listener
- FeatureListenerpublic FeatureResults getFeatures(Query query) throws java.io.IOException
query
- a datasource query object. It encapsulates requested
information, such as typeName, maxFeatures and filter.
DataSourceException
- For all data source errors.
java.io.IOException
Query
public FeatureResults getFeatures(Filter filter) throws java.io.IOException
filter
- An OpenGIS filter; specifies which features to retrieve.
null is not allowed, use Filter.NONE instead.
DataSourceException
- For all data source errors.
java.io.IOException
public FeatureResults getFeatures() throws java.io.IOException
Filter.NONE can also be used to get all features. Calling this function
is equivalent to using Query#ALL
DataSourceException
- For all data source errors.
java.io.IOException
public FeatureType getSchema()
public com.vividsolutions.jts.geom.Envelope getBounds() throws java.io.IOException
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.
java.io.IOException
- if there are errors getting the bounding box.public com.vividsolutions.jts.geom.Envelope getBounds(Query 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.
query
- Contains the Filter and MaxFeatures to find the bounds for.
public int getCount(Query query)
If getBounds(Query) returns -1
due to expense consider
using getFeatures(Query).getCount()
as a an alternative.
query
- Contains the Filter and MaxFeatures to find the bounds for.
-1
if count is too expensive to calculate or any errors or occur.
java.io.IOException
- if there are errors getting the count
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |