Class Query

Object
Query
Direct Known Subclasses:
Coverage­Query, Feature­Query

public abstract class Query extends Object
Definition of filtering to apply for fetching a resource subset. Filtering can be applied on Feature­Set or on Grid­Coverage­Resource. 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.
Compared to the SQL language, 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:
  • Constructor Details

    • Query

      protected Query()
      Creates a new, initially empty, query.
  • Method Details

    • setSelection

      public abstract void setSelection(Envelope domain)
      Sets the approximate area of feature instances or pixels to include in the subset. For feature set, the domain is materialized by a Filter. 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, or null if none.
      Since:
      1.1
    • setProjection

      public abstract void setProjection(String... properties)
      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, or null to retrieve all properties.
      Throws:
      Illegal­Argument­Exception - if a property is duplicated.
      Since:
      1.1