|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.view.DefaultView
public class DefaultView
Wrapper for FeatureSource
Support FeatureSource
Because GeoServer requires that attributes always be returned in the same
order we need a way to smoothly inforce this. Could we use this class to do
so?
WARNING: this class is a placeholder for ideas right now - it may not always
impement FeatureSource.
Grabs the following from query:
Field Summary
protected FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
source
FeatureSource
Constructor Summary
DefaultView(FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> source,
Query query)
Creates a new GeoServerFeatureSource object.
Method Summary
void
addFeatureListener(FeatureListener listener)
Implement addFeatureListener.
static FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
create(FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> source,
Query query)
Factory that make the correct decorator for the provided featureSource.
ReferencedEnvelope
getBounds()
Retrieves the total extent of this FeatureSource.
ReferencedEnvelope
getBounds(Query query)
Retrive the extent of the Query.
int
getCount(Query query)
Adjust query and forward to source.
DataStore
getDataStore()
Implement getDataStore.
FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
getFeatures()
Implement getFeatures.
FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
getFeatures(org.opengis.filter.Filter filter)
Implement getFeatures.
FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
getFeatures(Query query)
Implement getFeatures.
ResourceInfo
getInfo()
Information describing the contents of this resoruce.
org.opengis.feature.type.Name
getName()
Returns the qualified name for the Features this FeatureSource serves.
QueryCapabilities
getQueryCapabilities()
Returns and indication of what query capabilities this FeatureSource
supports natively.
org.opengis.feature.simple.SimpleFeatureType
getSchema()
Implement getSchema.
java.util.Set
getSupportedHints()
Returns the set of hints this FeatureSource
is able to support.
protected org.opengis.filter.Filter
makeDefinitionFilter(org.opengis.filter.Filter filter)
If a definition query has been configured for the FeatureTypeInfo, makes
and return a new Filter that contains both the query's filter and the
layer's definition one, by logic AND'ing them.
protected DefaultQuery
makeDefinitionQuery(Query query)
Takes a query and adapts it to match re definitionQuery filter configured
for a feature type.
void
removeFeatureListener(FeatureListener listener)
Implement removeFeatureListener.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
source
protected FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> source
Constructor Detail
DefaultView
public DefaultView(FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> source,
Query query)
throws SchemaException
source
- a FeatureSourcequery
- Filter used to limit results
SchemaException
Method Detail |
---|
public org.opengis.feature.type.Name getName()
FeatureSource
Note this is different from getSchema().getType().getName()
(that
is, the feature type name), this name specifies the
AttributeDescriptor name
for the
Features served by this source. So,
FeatureSoruce.getName() == FeatureSource.getFeatures().next().getAttributeDescriptor().getName()
.
Though it's a common practice when dealing with SimpleFeatureType
and SimpleFeature
to assume they're equal. There's no conflict
(as per the dynamic typing system the org.opengis.feature
package
defines) in a Feature and its type sharing the same name, as well as in a
GML schema an element declaration and a type definition may be named the
same. Yet, the distinction becomes important as we get rid of that
assumption and thus allow to reuse a type definition for different
FeatureSoruces, decoupling the descriptor (homologous to the Feature
element declaration in a GML schema) from its type definition.
So, even if implementors are allowed to delegate to
getSchema().getName()
if they want to call the fatures and their
type the same, client code asking a
DataAccess.getFeatureSource(Name)
shall use this name to request
for a FeatureSource, rather than the type name, as used in pre 2.5
versions of GeoTools. For example, if we have a FeatureSource named
Roads
and its type is named Roads_Type
, the
DataAccess
shall be queried through Roads
, not
Roads_Type
.
getName
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
FeatureSource.getName()
public static FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> create(FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> source, Query query) throws SchemaException
This factory method is public and will be used to create all required subclasses. By comparison the constructors for this class have package visibiliy.
TODO: revisit this - I am not sure I want write access to views (especially if they do reprojection).
source
- query
-
SchemaException
protected DefaultQuery makeDefinitionQuery(Query query) throws java.io.IOException
Grabs the following from query:
query
- Query against this DataStore
java.io.IOException
- See DataSourceException
DataSourceException
- If query could not meet the restrictions of definitionQueryprotected org.opengis.filter.Filter makeDefinitionFilter(org.opengis.filter.Filter filter) throws DataSourceException
filter
- Origional user supplied Filter
DataSourceException
- If the filter could not meet the limitations of
definitionQuerypublic DataStore getDataStore()
Description ...
getDataStore
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
public void addFeatureListener(FeatureListener listener)
Description ...
addFeatureListener
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
listener
- FeatureSource.addFeatureListener(org.geotools.data.FeatureListener)
public void removeFeatureListener(FeatureListener listener)
Description ...
removeFeatureListener
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
listener
- FeatureSource.removeFeatureListener(org.geotools.data.FeatureListener)
public FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatures(Query query) throws java.io.IOException
Description ...
getFeatures
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
query
-
java.io.IOException
- For all data source errors.FeatureSource.getFeatures(org.geotools.data.Query)
public FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatures(org.opengis.filter.Filter filter) throws java.io.IOException
Description ...
getFeatures
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
filter
-
java.io.IOException
- For all data source errors.public FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatures() throws java.io.IOException
Description ...
getFeatures
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
java.io.IOException
- For all data source errors.FeatureSource.getFeatures()
public org.opengis.feature.simple.SimpleFeatureType getSchema()
Description ...
getSchema
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
public ResourceInfo getInfo()
FeatureSource
Please note that for FeatureContent:
getInfo
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
public ReferencedEnvelope getBounds() throws java.io.IOException
Please note this extent will reflect the provided definitionQuery.
getBounds
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
null
if no
optimizations exist.
java.io.IOException
- If bounds of definitionQuerypublic ReferencedEnvelope getBounds(Query query) throws java.io.IOException
This method provides access to an optimized getBounds opperation. If no
optimized opperation is available null
will be returned.
You may still make use of getFeatures( Query ).getCount() which will return the correct answer (even if it has to itterate through all the results to do so.
getBounds
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
query
- User's query
null
if no optimization is
available
java.io.IOException
- If a problem is encountered with sourcepublic int getCount(Query query)
This method provides access to an optimized getCount opperation. If no
optimized opperation is available -1
will be returned.
You may still make use of getFeatures( Query ).getCount() which will return the correct answer (even if it has to itterate through all the results to do so).
getCount
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
query
- User's query.
public java.util.Set getSupportedHints()
FeatureSource
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.
getSupportedHints
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
RenderingHints#Key
objects (eventually empty, never null).public QueryCapabilities getQueryCapabilities()
FeatureSource
getQueryCapabilities
in interface FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |