|
|||||||||||
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. |
FeatureCollection |
getFeatures()
Loads all features from the datasource into the return FeatureResults. |
FeatureCollection |
getFeatures(Filter filter)
Loads features from the datasource into the returned FeatureResults, based on the passed filter. |
FeatureCollection |
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 FeatureCollection getFeatures(Query query) throws java.io.IOException
query
- a datasource query object. It encapsulates requested
information, such as typeName, maxFeatures and filter.
java.io.IOException
- For all data source errors.Query
public FeatureCollection getFeatures(Filter filter) throws java.io.IOException
filter
- An OpenGIS filter; specifies which features to retrieve.
null is not allowed, use Filter.NONE instead.
java.io.IOException
- For all data source errors.public FeatureCollection getFeatures() throws java.io.IOException
Filter.NONE can also be used to get all features. Calling this function
is equivalent to using Query.ALL
java.io.IOException
- For all data source errors.public FeatureType getSchema()
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.
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) throws java.io.IOException
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.
java.io.IOException
- DOCUMENT ME!public int getCount(Query query) throws java.io.IOException
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 |