Spatial Query
The Spatial Query is used
to define a query expression based on spatial attributes
and show all objects obtained when the query is applied. A
query
expression is defined by a
restriction clause (WHERE clause).
It is accessible
through:
Layer Explorer > Right
Click over a layer name > Spatial Query...
or
Layer > Spatial Query...
Follow
the steps bellow to define/execute the spatial query:CRITERIA FRAME
- Input
Layer - Select the input layer (should be visualized in the Map
Display).
- Criteria - Defines a restriction based on
spatial attributes:
- Geometry Property -
usually it is already selected
- Operator
(st_intersects, st_disjoints, st_touches, 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 transform this
criteria involving geometry property into a restriction. - Define
another criteria and add to this one if it is logically
acceptable. Check the example at the end.
RESTRICTION
FRAME: here it is possible to check the restrictions, remove one line
or all of them.
- Click on
to clear
only one line. - Click on
to clear all
restriction expression and start again.
LAYER
SELECTION FRAME
- Add - it adds the query result to the ones already selected and shows them all.
- New - it removes the previously selected items and shows only the new ones selected by this query.
- None
- it clear previoulsy selected items from the Map Display and prepares for a new query.
- Apply -
apply the query restriction after selecting one of the
options(add, new) and check the result in the Map Display.
QUERY
LAYER 
- Name - it shows the layer name
- Create
Layer - press here to create a Query Layer (a
special kind of layer will appear into the Layer Explorer with the
same name).
- Close this interface and go to the Layer Explorer to
visualize the Query Layer created.
Alternatively, it is possible to create a new real
Layer with
the selected objects (instead of a Query Layer generated above).
Follow the steps below to generate a real new Layer:
- Close
- keep the selected objects on the Map Display and press close.
- Go to the Layer Explorer
-> Right Click over the layer name
- Choose: Save
Selected Objects...
- Choose
a new name to the
Layer.
- The new
layer will have
only the selected objects.
Example: Suppose you
want to select all the Municipality touching the two
ones selected in the Map Display.
Map Display showing the two municipalities selected (the query will use the option Use
Selected objects)

Defining - Spatial Query

Restriction generated

Resulting Query on Map Display: it shows all objects touching
the two municipalities selected as input
