| java.lang.Object org.vfny.geoserver.global.GeoServerFeatureSource
All known Subclasses: org.vfny.geoserver.global.GeoServerFeatureStore, org.vfny.geoserver.global.GeoServerVersioningFeatureSource,
GeoServerFeatureSource | public class GeoServerFeatureSource implements FeatureSource(Code) | | GeoServer wrapper for backend Geotools2 DataStore.
Support FeatureSource decorator for FeatureTypeInfo that takes care of
mapping the FeatureTypeInfo's 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?
author: Gabriel Rold�n version: $Id: GeoServerFeatureSource.java 8449 2008-02-25 18:14:20Z aaime $ |
Field Summary | |
protected FeatureType | schema | protected FeatureSource | source |
Constructor Summary | |
| GeoServerFeatureSource(FeatureSource source, FeatureType schema, Filter definitionQuery, CoordinateReferenceSystem declaredCRS, int srsHandling) Creates a new GeoServerFeatureSource object. |
Method Summary | |
protected Query | adaptQuery(Query query, FeatureType schema) | public void | addFeatureListener(FeatureListener listener) Implement addFeatureListener. | public static GeoServerFeatureSource | create(FeatureSource featureSource, FeatureType schema, Filter definitionQuery, CoordinateReferenceSystem declaredCRS, int srsHandling) Factory that make the correct decorator for the provided featureSource.
This factory method is public and will be used to create all required
subclasses. | public Envelope | getBounds() Retrieves the total extent of this FeatureSource. | public Envelope | getBounds(Query query) Retrive the extent of the Query.
This method provides access to an optimized getBounds opperation. | public int | getCount(Query query) Adjust query and forward to source.
This method provides access to an optimized getCount opperation. | public DataStore | getDataStore() Implement getDataStore. | public FeatureCollection | getFeatures(Query query) Implement getFeatures. | public FeatureCollection | getFeatures(Filter filter) | public FeatureCollection | getFeatures() | public FeatureType | getSchema() Implement getSchema. | public Set | getSupportedHints() | 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 Query | makeDefinitionQuery(Query query, FeatureType schema) Takes a query and adapts it to match re definitionQuery filter
configured for a feature type. | public void | removeFeatureListener(FeatureListener listener) Implement removeFeatureListener. | protected FeatureCollection | reprojectFeatureCollection(CoordinateReferenceSystem targetCRS, FeatureCollection fc) |
schema | protected FeatureType schema(Code) | | GeoTools2 Schema information
Is this the same as source.getSchema() or is it used supply the order
that GeoServer requires attributes to be returned in?
|
source | protected FeatureSource source(Code) | | FeatureSource being served up
|
GeoServerFeatureSource | GeoServerFeatureSource(FeatureSource source, FeatureType schema, Filter definitionQuery, CoordinateReferenceSystem declaredCRS, int srsHandling)(Code) | | Creates a new GeoServerFeatureSource object.
Parameters: source - GeoTools2 FeatureSource Parameters: schema - FeatureType returned by this FeatureSource Parameters: definitionQuery - Filter used to limit results Parameters: declaredCRS - Geometries will be forced or projected to this CRS |
adaptQuery | protected Query adaptQuery(Query query, FeatureType schema) throws IOException(Code) | | Transforms the query applying the definition query in this layer, removes reprojection
since data stores cannot be trusted
Parameters: query - Parameters: schema - TODO throws: IOException - |
addFeatureListener | public void addFeatureListener(FeatureListener listener)(Code) | | Implement addFeatureListener.
Description ...
Parameters: listener - See Also: org.geotools.data.FeatureSource.addFeatureListener(org.geotools.data.FeatureListener) |
create | public static GeoServerFeatureSource create(FeatureSource featureSource, FeatureType schema, Filter definitionQuery, CoordinateReferenceSystem declaredCRS, int srsHandling)(Code) | | Factory that make the correct decorator for the provided featureSource.
This factory method is public and will be used to create all required
subclasses. By comparison the constructors for this class have package
visibiliy.
Parameters: featureSource - Parameters: schema - DOCUMENT ME! Parameters: definitionQuery - DOCUMENT ME! Parameters: declaredCRS - |
getBounds | public Envelope getBounds() throws IOException(Code) | | Retrieves the total extent of this FeatureSource.
Please note this extent will reflect the provided definitionQuery.
Extent of this FeatureSource, or null if nooptimizations exist. throws: IOException - If bounds of definitionQuery |
getBounds | public Envelope getBounds(Query query) throws IOException(Code) | | Retrive the extent of the Query.
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.
Parameters: query - User's query Extend of Query or null if no optimization isavailable throws: IOException - If a problem is encountered with source |
getCount | public int getCount(Query query)(Code) | | Adjust query and forward to source.
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).
Parameters: query - User's query. Number of Features for Query, or -1 if no optimization isavailable. |
getDataStore | public DataStore getDataStore()(Code) | | Implement getDataStore.
Description ...
See Also: org.geotools.data.FeatureSource.getDataStore |
getFeatures | public FeatureCollection getFeatures(Query query) throws IOException(Code) | | Implement getFeatures.
Description ...
Parameters: query - throws: IOException - See Also: org.geotools.data.FeatureSource.getFeatures(org.geotools.data.Query) |
getFeatures | public FeatureCollection getFeatures(Filter filter) throws IOException(Code) | | |
getSchema | public FeatureType getSchema()(Code) | | Implement getSchema.
Description ...
See Also: org.geotools.data.FeatureSource.getSchema |
getSupportedHints | public Set getSupportedHints()(Code) | | |
makeDefinitionFilter | protected Filter makeDefinitionFilter(Filter filter) throws DataSourceException(Code) | | 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.
Parameters: filter - Origional user supplied Filter Filter adjusted to the limitations of definitionQuery throws: DataSourceException - If the filter could not meet the limitationsof definitionQuery |
makeDefinitionQuery | protected Query makeDefinitionQuery(Query query, FeatureType schema) throws IOException(Code) | | Takes a query and adapts it to match re definitionQuery filter
configured for a feature type.
Parameters: query - Query against this DataStore Parameters: schema - TODO Query restricted to the limits of definitionQuery throws: IOException - See DataSourceException throws: DataSourceException - If query could not meet the restrictions ofdefinitionQuery |
removeFeatureListener | public void removeFeatureListener(FeatureListener listener)(Code) | | Implement removeFeatureListener.
Description ...
Parameters: listener - See Also: org.geotools.data.FeatureSource.removeFeatureListener(org.geotools.data.FeatureListener) |
reprojectFeatureCollection | protected FeatureCollection reprojectFeatureCollection(CoordinateReferenceSystem targetCRS, FeatureCollection fc) throws IOException, SchemaException, TransformException, OperationNotFoundException, FactoryException(Code) | | Wraps feature collection as needed in order to respect srs handling and reprojection
Parameters: targetCRS - Parameters: fc - throws: IOException - throws: SchemaException - throws: TransformException - throws: OperationNotFoundException - throws: FactoryException - |
|
|