# Spatial analysis

{% embed url="<https://www.youtube.com/watch?v=MudknS9d-y0>" %}

Manipulate and analyze geographic data to extract meaningful insights. Combine layers, identify patterns, and discover spatial relationships to make informed decisions.

## Using spatial analysis

To perform analysis on layers, click on the ![](https://217108486-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmRfGitkyjOEMvVsEyGWN%2Fuploads%2FFXhPP6A5qGrl52o8O5IM%2Ftransformations.svg?alt=media\&token=ebf46d3c-a17f-48fb-acb5-393e90c8e663) **Spatial analysis** tool in the toolbar, or use the **`Command/Control + K`** keyboard shortcut and type **Spatial analysis** or the name of any specific analysis, like **Buffer**.

## Available methods

{% hint style="warning" %}
Processing large layers could take time. Consider clipping large layers to your area of interest before running other operations.
{% endhint %}

| Name             | Description                                                                           | Example use case                                                                                        | Input                     | Output                                              |
| ---------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------- | --------------------------------------------------- |
| **Buffer**       | For each feature, generate a polygon covering an area within a distance               | To identify specific locations that are within a certain radius of features like roads, hospitals, etc. | Any                       | Polygons                                            |
| **Bounds**       | For each feature, generate a rectangular polygon completely covering the feature      | To simplify features to broad coverage areas                                                            | Any                       | Polygons                                            |
| **Centroid**     | For each feature, generate a point at the center of it                                | To simplify a polygon layer to a point layer, like metro areas to just cities                           | Lines or polygons         | Polygons                                            |
| **Clip**         | Keep only the parts of each feature inside polygons from another layer                | To reduce a global or countrywide layer to just an area of interest                                     | Any and polygons          | Any (same as input)                                 |
| **Count Points** | Add the total number of points covered by each polygon to each feature                | Count the number of airports in each US state                                                           | Points and polygon layers | Polygon layer with number of points as an attribute |
| **Dissolve**     | Create a single new polygon covering all features                                     | To simplify overlapping or contiguous polygons, like buffers                                            | Polygons                  | Polygons                                            |
| **Intersect**    | Keep only the features in layer A that intersect layer B                              | To identify features that overlap another layer, like roads inside national parks                       | Any and polygons          | Any (same as input)                                 |
| **Subtract**     | Keep only the parts of each feature outside the polygons from another layer           | Remove flood zones from candidate areas for development projects                                        | Any and polygons          | Any (same as input)                                 |
| **Join**         | For each feature, generate a new one that includes the columns from both input layers | To add non-geographic data to a geographic layer, like GDP per year to a countries layer                | Any and any               | Any (same as input)                                 |

{% hint style="info" %}
When using the Join tool always choose the layer with the target output geometry as the first layer in the dropdown menus of the analysis tool. When working with a non-spatial (tabular) layer, make sure to configure that table as the *second layer* in the menu.
{% endhint %}

## Spatial analysis exercise

Try out Felt’s spatial analysis tools for yourself in this step-by-step tutorial to find suitable habitat for the Iberian Lynx!

Download the datasets: <https://drive.google.com/drive/folders/1eKmVEg1hZk8TlVnQPu150oaTQNu07YkX>

{% embed url="<https://www.youtube.com/watch?v=97NX-lqZjtU>" %}
