|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Query
Encapsulates a data request.
The query object is used by the FeatureSource.getFeatures(Query) to encapsulate a request. For this use it the FeatureSource.getSchema().getTypeName() should match the one provided by the Query, or the Query should not provide one.
Suggested Extensions (Jody):
modules/library/api (gt-api.jar)
Field Summary | |
---|---|
static Query |
ALL
Implements a query that will fetch all features from a datasource. |
static String[] |
ALL_NAMES
Ask for all properties when used with setPropertyNames. |
static int |
DEFAULT_MAX
So getMaxFeatures does not return null we use a very large number. |
static Query |
FIDS
Implements a query that will fetch all the FeatureIDs from a datasource. |
static String[] |
NO_NAMES
Ask for no properties when used with setPropertyNames. |
static URI |
NO_NAMESPACE
TODO: should this be ANY_URI |
Method Summary | |
---|---|
CoordinateReferenceSystem |
getCoordinateSystem()
Specifies the coordinate system that the features being queried are in. |
CoordinateReferenceSystem |
getCoordinateSystemReproject()
Request data reprojection. |
Filter |
getFilter()
The Filter can be used to define constraints on a query. |
String |
getHandle()
The handle attribute is included to allow a client to associate a mnemonic name to the Query request. |
Hints |
getHints()
Specifies some hints to drive the query execution and results build-up. |
int |
getMaxFeatures()
The optional maxFeatures can be used to limit the number of features that a query request retrieves. |
URI |
getNamespace()
The namespace attribute is used to indicate the namespace of the schema being represented. |
String[] |
getPropertyNames()
The properties array is used to specify the attributes that should be selected for the return feature collection. |
SortBy[] |
getSortBy()
SortBy results according to indicated property and order. |
Integer |
getStartIndex()
|
String |
getTypeName()
The typeName attribute is used to indicate the name of the feature type to be queried. |
String |
getVersion()
From WFS Spec: The version attribute is included in order to accommodate systems that support feature versioning. |
boolean |
retrieveAllProperties()
Convenience method to determine if the query should use the full schema (all properties) of the data source for the features returned. |
Field Detail |
---|
static final URI NO_NAMESPACE
static final int DEFAULT_MAX
static final Query ALL
static final Query FIDS
static final String[] NO_NAMES
Note the query will still return a result - limited to FeatureIDs.
static final String[] ALL_NAMES
Method Detail |
---|
String[] getPropertyNames()
null
new String[0]
The available properties can be determined with a getSchema call from
the DataSource interface. A datasource can use retrieveAllProperties()
as a shortcut to determine if all its
available properties should be returned (same as checking to see if
getProperties is ALL_NAMES, but clearer)
If properties that are not part of the datasource's schema are requested then the datasource shall throw an exception.
This replaces our funky setSchema method of retrieving select properties. It makes it easier to understand how to get certain properties out of the datasource, instead of having users get the schema and then compose a new schema using the attributes that they want. The old way had problems because one couldn't have multiple object reuse the same datasource object, since some other object could come along and change its schema, and would then return the wrong properties.
boolean retrieveAllProperties()
int getMaxFeatures()
This is the only method that is not directly out of the Query element in the WFS spec. It is instead a part of a GetFeature request, which can hold one or more queries. But each of those in turn will need a maxFeatures, so it is needed here.
Integer getStartIndex()
Filter getFilter()
String getTypeName()
URI getNamespace()
String getHandle()
String getVersion()
CoordinateReferenceSystem getCoordinateSystem()
This denotes a request to Temporarily to override the coordinate system
contained in the FeatureSource
This change is not persistant at all, indeed it is only for the Features
returned by this Query. If used in conjunction with getCoordinateSystemReproject()
the reprojection will occur from getCoordinateSystem()
to
getCoordinateSystemReproject()
.
CoordinateReferenceSystem getCoordinateSystemReproject()
Gets the coordinate System to reproject the data contained in the backend datastore to.
If the DataStore can optimize the reprojection it should, if not then a decorator on the reader should perform the reprojection on the fly.
If the datastore has the wrong CS then getCoordinateSystem()
should be set to
the CS to be used, this will perform the reprojection on that.
SortBy[] getSortBy()
SortBy is part of the Filter 1.1 specification, it is referenced by WFS1.1 and Catalog 2.0.x specifications and is used to organize results.
The SortBy's are ment to be applied in order:
[year=2002 month=4],[year=2002 month=3],[year=2002 month=2],
[year=2002 month=1],[year=2003 month=12],[year=2002 month=4],
SortBy should be considered at the same level of abstraction as Filter, and like Filter you may sort using properties not listed in getPropertyNames.
At a technical level the interface SortBy2 is used to indicate the additional requirements of a GeoTools implementation. The pure WFS 1.1 specification itself is limited to SortBy.
Hints getHints()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |