|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectWFSFeatureSource
public class WFSFeatureSource
Simple implementation of FeatureSource for a WFS 1.1 server.
This implementation is really simple in the sense that it delegates all the hard work to the
WFSDataStore
provided.
Constructor Summary | |
---|---|
WFSFeatureSource(WFS_1_1_0_DataStore dataStore,
String typeName)
|
Method Summary | |
---|---|
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 the Query . |
DataStore |
getDataStore()
Returns the data source, as a DataAccess object, providing
this FeatureSource . |
WFSFeatureCollection |
getFeatures()
Retrieves all features in the form of a FeatureCollection . |
WFSFeatureCollection |
getFeatures(Filter filter)
Retrieves features, in the form of a FeatureCollection , based
on an OGC Filter . |
WFSFeatureCollection |
getFeatures(Query query)
Retrieves features, in the form of a FeatureCollection , based
on a Query . |
ResourceInfo |
getInfo()
Returns available metadata for this resource |
Name |
getName()
Returns the name of the features (strictly, the name of the AttributeDescriptor for the features) accessible through this
FeatureSource . |
QueryCapabilities |
getQueryCapabilities()
Enquire what what query capabilities this FeatureSource
natively supports. |
SimpleFeatureType |
getSchema()
Retrieves the schema (feature type) that will apply to features retrieved from this FeatureSource . |
Set |
getSupportedHints()
Returns the set of hints that this FeatureSource supports via Query requests. |
void |
removeFeatureListener(FeatureListener listener)
Removes an object from this FeatureSource's listeners. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WFSFeatureSource(WFS_1_1_0_DataStore dataStore, String typeName) throws IOException
IOException
Method Detail |
---|
public Name getName()
FeatureSource
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).
getName
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
FeatureSource
public DataStore getDataStore()
FeatureSource
DataAccess
object, providing
this FeatureSource
.
getDataStore
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
FeatureSource
FeatureSource.getDataStore()
public SimpleFeatureType getSchema()
FeatureSource
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.
getSchema
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
FeatureSource
FeatureSource.getSchema()
public ResourceInfo getInfo()
getInfo
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
public void addFeatureListener(FeatureListener listener)
FeatureSource
FeatureSource
.
addFeatureListener
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
listener
- the new listenerFeatureSource.addFeatureListener(FeatureListener)
public void removeFeatureListener(FeatureListener listener)
FeatureSource
FeatureSource's
listeners.
removeFeatureListener
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
listener
- the listener to removeFeatureSource.removeFeatureListener(FeatureListener)
public ReferencedEnvelope getBounds() throws IOException
FeatureSource
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.
getBounds
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
null
if the bounds are unknown or too costly to calculate.
IOException
- on any errors calculating the boundsFeatureSource.getBounds()
public ReferencedEnvelope getBounds(Query query) throws IOException
FeatureSource
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.
getBounds
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
query
- the query to select features
null
if the bounds are unknown or too costly to calculate.
IOException
- on any errors calculating the boundsFeatureSource.getBounds(Query)
public int getCount(Query query) throws IOException
FeatureSource
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();
}
- Specified by:
getCount
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
- Parameters:
query
- the query to select features
- Returns:
- the numer of features that would be returned by the
Query
;
or -1
if this cannot be calculated.
- Throws:
IOException
- if there are errors getting the count- See Also:
FeatureSource.getCount(Query)
public WFSFeatureCollection getFeatures(Filter filter) throws IOException
FeatureSource
FeatureCollection
, based
on an OGC Filter
.
getFeatures
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getFeatures
in interface SimpleFeatureSource
filter
- the filter to select features; must not be null
(use Filter.INCLUDE instead)
Filter
IOException
- if the underlying data source cannot be accessed.FeatureSource.getFeatures(Filter)
public WFSFeatureCollection getFeatures() throws IOException
FeatureSource
FeatureCollection
.
The following statements are equivalent:
featureSource.getFeatures();
featureSource.getFeatures(Filter.INCLUDE);
featureSource.getFeatures(Query.ALL);
getFeatures
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getFeatures
in interface SimpleFeatureSource
Query
IOException
- if the underlying data source cannot be accessed.FeatureSource.getFeatures()
public WFSFeatureCollection getFeatures(Query query) throws IOException
FeatureSource
FeatureCollection
, based
on a Query
.
getFeatures
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getFeatures
in interface SimpleFeatureSource
query
- DataAccess query for requested information, such as typeName,
maxFeatures and filter.
Query
IOException
- if the underlying data source cannot be accessed.FeatureSource.getFeatures(Query)
public Set getSupportedHints()
FeatureSource
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.
getSupportedHints
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
RenderingHints#Key
objects; may be empty but never null
FeatureSource.getSupportedHints()
public QueryCapabilities getQueryCapabilities()
FeatureSource
FeatureSource
natively supports. For example, whether queries can return sorted
results.
getQueryCapabilities
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
FeatureSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |