The Query Layer interface is used to define a query expression and the color used to highlight the selected objects obtained when the query is applied. A query expression is defined by a restriction clause (WHERE clause).
LAYER EXPLORER → right click over an layer name → QUERY
This interface consists of the following steps:
Input Layer - Select the input layer.
Criteria - Defines the Restriction Clause.
Layer Selection options:
Add: Transforms the query result in the layer selected items, adding the query results to the layer selection.
New: Transforms the query result in the layer selected items and remove previous layer selection.
None: The result will be just painted over the map.
Highlight: Sets the color to be used to highlight the selected objects.
WHERE clause
The WHERE clause Interface is used to define the restriction used to generate a new dataset. The restriction can involve one or more datasets, using standard and/or spatial attributes (vertical tabs). The list of operators supported is adjusted to the type of attributes involved.
The operators <,>,<=,>=,<>,=, LIKE, NOT are used with standard attributes comparison, and the spatial operators such as ST_UNION, ST_INTERSECTION, ST_AREA among others are used to operate over geometric attributes.
To define a restriction based on Attributes follow the steps:
Select restriction type on the vertical Attribute tab:
Define a restriction by selecting:
Property
Operator - (>, >=, <, <=, = )
Value - it can be a property of other dataset or a value among all values of the property chosen (Property or Value).
Click on icon
to add this combination (property x operator x value) to the
Table/SQL tabs bellow.
On the frame Table/SQL it is possible to handle the restriction adding more clauses, removing one or all lines, or checking the SQL generated:
Check the list of restrictions.
Define the connector (and, or, nothing) and the next restriction.
Clear all
restriction using
or only one line using
.
Optionally, change to SQL tab to see the restriction generated in SQL.
Repeat the steps to define the next part of the restriction as necessary.
To define a restriction based on spatial attributes follow the steps:
Select Spatial vertical tab:
Define a restriction by selecting:
Property - geometry attribute of the selected dataset.
Operator - (ST_Contains, ST_Union, ST_Crosses, …).
Layer - select the layer to be confronted with the restriction defined.
Use Selected Objects - check this option if the goal is to apply the restriction only over the selected objects in the layer displayed.
Click on
to add this combination (property x operator x value) to the
Table/SQL tabs bellow.
On the frame Table/SQL it is possible to handle the restriction adding more clauses, removing or checking the SQL generated:
Check the list of restrictions.
Define the connector (and, or, nothing) and the next restriction.
Clear all
restriction using
or only one line using
.
Optionally, change to SQL tab to see the restriction generated in SQL.
Repeat the steps to define the next part of the restriction as necessary.