|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.view.DefaultView
Wrapper for FeatureSource constrained by a Query.
Support FeatureSource decorator that takes care of mapping a Query & FeatureSource with the schema and definition query configured for it.
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.
Field Summary | |
protected FeatureSource |
source
FeatureSource being served up |
Constructor Summary | |
DefaultView(FeatureSource source,
Query query)
Creates a new GeoServerFeatureSource object. |
Method Summary | |
void |
addFeatureListener(FeatureListener listener)
Implement addFeatureListener. |
static FeatureSource |
create(FeatureSource source,
Query query)
Factory that make the correct decorator for the provided featureSource. |
com.vividsolutions.jts.geom.Envelope |
getBounds()
Retrieves the total extent of this FeatureSource. |
com.vividsolutions.jts.geom.Envelope |
getBounds(Query query)
Retrive the extent of the Query. |
int |
getCount(Query query)
Adjust query and forward to source. |
DataStore |
getDataStore()
Implement getDataStore. |
FeatureCollection |
getFeatures()
Implement getFeatures. |
FeatureCollection |
getFeatures(Filter filter)
Implement getFeatures. |
FeatureCollection |
getFeatures(Query query)
Implement getFeatures. |
FeatureType |
getSchema()
Implement getSchema. |
protected Filter |
makeDefinitionFilter(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 |
protected FeatureSource source
Constructor Detail |
public DefaultView(FeatureSource source, Query query) throws SchemaException
Grabs the following from query:
source
- GeoTools2 FeatureSource
SchemaException
Method Detail |
public static FeatureSource create(FeatureSource 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).
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 Filter makeDefinitionFilter(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
public void addFeatureListener(FeatureListener listener)
Description ...
addFeatureListener
in interface FeatureSource
listener
- FeatureSource.addFeatureListener(org.geotools.data.FeatureListener)
public void removeFeatureListener(FeatureListener listener)
Description ...
removeFeatureListener
in interface FeatureSource
listener
- FeatureSource.removeFeatureListener(org.geotools.data.FeatureListener)
public FeatureCollection getFeatures(Query query) throws java.io.IOException
Description ...
getFeatures
in interface FeatureSource
query
-
java.io.IOException
- For all data source errors.FeatureSource.getFeatures(org.geotools.data.Query)
public FeatureCollection getFeatures(Filter filter) throws java.io.IOException
Description ...
getFeatures
in interface FeatureSource
filter
-
java.io.IOException
- For all data source errors.FeatureSource.getFeatures(org.geotools.filter.Filter)
public FeatureCollection getFeatures() throws java.io.IOException
Description ...
getFeatures
in interface FeatureSource
java.io.IOException
- For all data source errors.FeatureSource.getFeatures()
public FeatureType getSchema()
Description ...
getSchema
in interface FeatureSource
public com.vividsolutions.jts.geom.Envelope getBounds() throws java.io.IOException
Please note this extent will reflect the provided definitionQuery.
getBounds
in interface FeatureSource
null
if no
optimizations exist.
java.io.IOException
- If bounds of definitionQuerypublic com.vividsolutions.jts.geom.Envelope 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
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
query
- User's query.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |