# Spatial Queries

Spatial queries ![](https://content.gitbook.com/content/DUF1p2rT0hfE3QBlbbvE/blobs/aHGiPiM0lf2fYx5NwYMI/spatial_request.gif) are used to search for map elements of a layer that meet a spatial criterion.&#x20;

Several types of spatial criteria are available, but each uses a reference selection as a basis for the search.&#x20;

{% hint style="info" %}
Before performing the spatial query, it is essential that you select the reference elements.
{% endhint %}

Some examples of spatial queries:

* Select properties located at less than 500 meters from the selected park.
* Select route segments located within the selected zoning polygon.
* Select all lots adjacent to the selected river.

<figure><img src="https://content.gitbook.com/content/DUF1p2rT0hfE3QBlbbvE/blobs/XhoR5ZcmCcwPWucwytX8/requ-attr3.png" alt=""><figcaption></figcaption></figure>

<table data-header-hidden><thead><tr><th width="85"></th><th></th></tr></thead><tbody><tr><td><strong>1</strong></td><td>Select the information layer on which the search is performed (what you are looking for). <br>The spatial query can only be performed on a selection that has been made beforehand.</td></tr><tr><td><strong>2</strong></td><td>Press the <strong>Options</strong> button to display a list of search options. The following options are available: <br><strong>Search only in current extent</strong>: The search is performed only on the area that appears on the screen. <br><strong>Search only in current selection</strong>: The search is performed only among the elements that are already selected. <br><strong>Add to current selection</strong>: The results of the query will be added to the elements on the map that have already been selected. <br><strong>Show result list</strong>: Displays the results list in the elements explorer. <br><strong>Always show selection</strong>: Displays results, even when these do not fall within the visibility thresholds of the layers that are queried (this is useful when results span a very large territory). <br><strong>Add labels on selected elements</strong>: Displays a label on each element that is found (improves visibility of results).</td></tr><tr><td><strong>3</strong></td><td>Choose the spatial criteria to apply for the query.</td></tr><tr><td><strong>4</strong></td><td>Press <strong>Search</strong> to launch the query.</td></tr></tbody></table>

Results are selected on the map. If the **Show result list** option is selected, the [elements explorer](https://docs-jmapserver-lima.k2geospatial.com/e/applications/jmap-pro-user-guide/map-layers/elements-explorer) displays the elements returned by the query. It is then possible to launch an information report pertaining to the selection (refer to [Information Report](https://docs-jmapserver-lima.k2geospatial.com/e/applications/jmap-pro-user-guide/tools/information/information-report)).
