public class WFSStoredQueryFeatureSource extends ContentFeatureSource
entry, hints, lock, query, queryCapabilities, schema, transaction
Constructor and Description |
---|
WFSStoredQueryFeatureSource(ContentEntry entry,
WFSClient client,
StoredQueryDescriptionType desc) |
Modifier and Type | Method and Description |
---|---|
protected FeatureReader<SimpleFeatureType,SimpleFeature> |
applyReprojectionDecorator(FeatureReader<SimpleFeatureType,SimpleFeature> reader,
Query query,
GetFeatureRequest request) |
protected SimpleFeatureType |
buildFeatureType()
Creates the feature type or schema for the feature source.
|
protected boolean |
canFilter()
Determines if the datastore can natively perform a filtering.
|
protected boolean |
canLimit()
Determines if the datastore can natively limit the number of features returned in a query.
|
protected boolean |
canOffset()
Determines if the datastore can natively skip the first
offset number of
features returned in a query. |
protected boolean |
canReproject()
Determines if the datastore can natively perform reprojection.
|
protected boolean |
canRetype()
Determines if the datasatore can natively perform "retyping" which includes limiting the
number of attributes returned and reordering of those attributes
If the subclass can handle retyping natively it should override this method to return
true . |
protected boolean |
canSort()
Determines if the datastore can natively perform sorting.
|
protected GetFeatureRequest |
createGetFeature(Query query,
GetFeatureRequest.ResultType resultType) |
protected ReferencedEnvelope |
getBoundsInternal(Query query)
Calculates the bounds of a specified query.
|
protected int |
getCountInternal(Query query)
Calculates the number of features of a specified query.
|
WFSDataStore |
getDataStore()
The datastore that this feature source originated from.
|
ResourceInfo |
getInfo()
A default ResourceInfo with a generic description.
|
protected FeatureReader<SimpleFeatureType,SimpleFeature> |
getReaderInternal(Query localQuery)
Subclass method for returning a native reader from the datastore.
|
QName |
getRemoteTypeName() |
protected String |
getSupportedSrsName(GetFeatureRequest request,
Query query) |
protected boolean |
handleVisitor(Query query,
FeatureVisitor visitor)
Subclass method which allows subclasses to natively handle a visitor.
|
protected Filter |
resolvePropertyNames(Filter filter)
Transform provided filter; resolving property names
|
protected Query |
resolvePropertyNames(Query query)
This method changes the query object so that all propertyName references are resolved to
simple attribute names against the schema of the feature source.
|
accepts, addFeatureListener, addHints, buildQueryCapabilities, canEvent, canLock, canTransact, doLockInternal, doUnlockInternal, getAbsoluteSchema, getBounds, getBounds, getCount, getEntry, getFeatures, getFeatures, getFeatures, getName, getQueryCapabilities, getReader, getReader, getReader, getSchema, getState, getSupportedHints, getTransaction, getView, getView, isView, joinQuery, lockFeatures, lockFeatures, lockFeatures, processLock, removeFeatureListener, setFeatureLock, setTransaction, unLockFeatures, unLockFeatures, unLockFeatures
public WFSStoredQueryFeatureSource(ContentEntry entry, WFSClient client, StoredQueryDescriptionType desc)
protected GetFeatureRequest createGetFeature(Query query, GetFeatureRequest.ResultType resultType) throws IOException
IOException
protected boolean handleVisitor(Query query, FeatureVisitor visitor) throws IOException
ContentFeatureSource
Subclasses would override this method and return true in cases where the specific visitor could be handled without iterating over the entire result set of query. An example would be handling visitors that calculate aggregate values.
handleVisitor
in class ContentFeatureSource
query
- The query being made.visitor
- The visitor toIOException
protected boolean canReproject()
ContentFeatureSource
If the subclass can handle reprojection natively then it should override this method to
return true
. In this case it must do the reprojection or throw an
exception.
Not overriding this method or returning false
will case the feature reader
created by the subclass to be wrapped in a reprojecting decorator when the query specifies a
coordinate system reproject (using crs and crsReproject)
To handle reprojection an implementation should:
Query.getCoordinateSystem()
- optional override - if provided this is used
instead of the native CRS provided by the data format (as a workaround for clients).
Query.getCoordinateSystemReproject()
- if this value is provided it is
used to set up a transform from the origional CRS (native or from query).
canReproject
in class ContentFeatureSource
ReprojectFeatureReader
protected boolean canOffset()
ContentFeatureSource
offset
number of
features returned in a query.
If the subclass can handle a map feature cap natively then it should override this method
to return true
. In this case it must do the cap or throw an exception.
Not overriding this method or returning false
will case the feature reader
created by the subclass to be be accesset offset times before being returned to the caller.
canOffset
in class ContentFeatureSource
protected boolean canSort()
ContentFeatureSource
If the subclass can handle retyping natively it should override this method to return
true
. In this case it must do the retyping or throw an exception.
Not overriding this method or returning false
will cause an exception to be
thrown when the query specifies sorting.
canSort
in class ContentFeatureSource
true
ContentFeatureSource.canSort()
protected boolean canRetype()
ContentFeatureSource
If the subclass can handle retyping natively it should override this method to return
true
. In this case it must do the retyping or throw an exception.
Not overriding this method or returning false
will cause the feature reader
created by the subclass to be wrapped in a retyping feature reader when the query specifies a
retype.
canRetype
in class ContentFeatureSource
true
ContentFeatureSource.canRetype()
protected boolean canFilter()
ContentFeatureSource
If the subclass can handle filtering natively it should override this method to return
true
. In this case it must do the filtering or throw an exception. This
includes the case of partial native filtering where the datastore can only handle part of the
filter natively. In these cases it is up to the subclass to apply a decorator to the reader
it returns which will handle any part of the filter can was not applied natively. See FilteringFeatureReader
.
Not overriding this method or returning false
will cause the feature reader
created by the subclass to be wrapped in a filtering feature reader when the query specifies
a filter. See FilteringFeatureReader
.
canFilter
in class ContentFeatureSource
true
ContentFeatureSource.canFilter()
protected boolean canLimit()
ContentFeatureSource
If the subclass can handle a map feature cap natively then it should override this method
to return true
. In this case it must do the cap or throw an exception.
Not overriding this method or returning false
will case the feature reader
created by the subclass to be wrapped in a max feature capping decorator when the query
specifies a max feature cap.
canLimit
in class ContentFeatureSource
true
ContentFeatureSource.canLimit()
public WFSDataStore getDataStore()
Subclasses may wish to extend this method in order to type narrow its return type.
getDataStore
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getDataStore
in class ContentFeatureSource
FeatureSource
protected Query resolvePropertyNames(Query query)
For example, this method ensures that propertyName's such as "gml:name" are rewritten as simply "name".
resolvePropertyNames
in class ContentFeatureSource
protected Filter resolvePropertyNames(Filter filter)
resolvePropertyNames
in class ContentFeatureSource
protected ReferencedEnvelope getBoundsInternal(Query query) throws IOException
ContentFeatureSource
null
.getBoundsInternal
in class ContentFeatureSource
Filter.INCLUDE ==
query.getFilter()
, reprojected to the Query's crs, or null
otherwise as it would
be too expensive to calculate.IOException
FeatureSource.getBounds(Query)
,
ContentFeatureSource.getBoundsInternal(org.geotools.data.Query)
protected int getCountInternal(Query query) throws IOException
ContentFeatureSource
getCountInternal
in class ContentFeatureSource
-1
as it would be too expensive to calculate.IOException
FeatureSource.getCount(Query)
,
ContentFeatureSource.getCountInternal(org.geotools.data.Query)
protected FeatureReader<SimpleFeatureType,SimpleFeature> getReaderInternal(Query localQuery) throws IOException
ContentFeatureSource
It is important to note that if the native reader intends to handle any of the following natively:
true
:
ContentFeatureSource.canReproject()
- handles Query.getCoordinateSystemReproject()
internally.
Example would be PostGIS using Proj to handle reproejction internallyContentFeatureSource.canFilter()
- handles Query#getFilter() internally.getReaderInternal
in class ContentFeatureSource
IOException
FeatureSource.getFeatures(Query)
,
ContentFeatureSource.getReaderInternal(org.geotools.data.Query)
protected String getSupportedSrsName(GetFeatureRequest request, Query query)
protected FeatureReader<SimpleFeatureType,SimpleFeature> applyReprojectionDecorator(FeatureReader<SimpleFeatureType,SimpleFeature> reader, Query query, GetFeatureRequest request)
protected SimpleFeatureType buildFeatureType() throws IOException
ContentFeatureSource
Implementations should use SimpleFeatureTypeBuilder
to build the feature type.
Also, the builder should be injected with the feature factory which has been set on the
DataStore (see ContentDataStore.getFeatureFactory()
. Example:
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); b.setFeatureTypeFactory( getDataStore().getFeatureTypeFactory() ); //build the feature type ...
buildFeatureType
in class ContentFeatureSource
IOException
public QName getRemoteTypeName() throws IOException
IOException
public ResourceInfo getInfo()
ContentFeatureSource
Subclasses should override to provide an explicit ResourceInfo object for their content.
getInfo
in interface FeatureSource<SimpleFeatureType,SimpleFeature>
getInfo
in class ContentFeatureSource
Copyright © 1996–2022 Geotools. All rights reserved.