Package org.apache.sis.storage
Class Query
Object
Query
- Direct Known Subclasses:
CoverageQuery,FeatureQuery
Definition of filtering to apply for fetching a resource subset.
Filtering can be applied on
FeatureSet or on GridCoverageResource.
A query contains at least two parts:
- Selection for choosing the feature instances to fetch. This is equivalent to choosing rows in a database table.
- Projection (not to be confused with map projection) for choosing the feature properties or the coverage sample dimensions to fetch. This is equivalent to choosing columns in a database table.
Query contains the information in the SELECT and
WHERE clauses of a SQL statement. A Query typically contains filtering capabilities
and (sometimes) simple attribute transformations. Well known query languages include SQL and CQL.
Optional values
All aspects of this query are optional and initialized to "none". Unless otherwise specified, all methods accept a null argument or can return a null value, which means "none".- Since:
- 0.8
- See Also:
Defined in the sis-storage module
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidsetProjection(String... properties) Sets the properties to retrieve by their names.abstract voidsetSelection(Envelope domain) Sets the approximate area of feature instances or pixels to include in the subset.
-
Constructor Details
-
Query
protected Query()Creates a new, initially empty, query.
-
-
Method Details
-
setSelection
Sets the approximate area of feature instances or pixels to include in the subset. For feature set, the domain is materialized by aFilter. For grid coverage resource, the given envelope specifies the coverage domain.The given envelope is approximate. Features may test intersections using only bounding boxes instead of full geometries. Coverages may expand the envelope to an integer amount of tiles.
- Parameters:
domain- the approximate area of interest, ornullif none.- Since:
- 1.1
-
setProjection
Sets the properties to retrieve by their names. For features, the arguments are names of feature properties. For coverages, the arguments are names of sample dimensions.Note: in this context, the "projection" word come from relational database terminology. It is unrelated to map projection.
- Parameters:
properties- properties to retrieve, ornullto retrieve all properties.- Throws:
IllegalArgumentException- if a property is duplicated.- Since:
- 1.1
-