> For the complete documentation index, see [llms.txt](https://help.felt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.felt.com/tools/spatial-filter.md).

# Spatial filter

Filter map layers by drawing a polygon or circle with the Spatial filter. View statistics for the area or export the filtered data.

{% hint style="success" %}
Available on the Business and Enterprise plans. [Compare plans](https://felt.com/pricing#compare)
{% endhint %}

Add the Spatial filter [extension](/developers/extensions.md) so people can draw a polygon or circle to filter your map. Its panel shows layer results, such as counts and averages, plus the shape's measurements. Anyone viewing the map can use it.

<figure><img src="https://217108486-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmRfGitkyjOEMvVsEyGWN%2Fuploads%2Fgit-blob-38858190033524dba3c949c0f10b221cccb6e1bb%2Fspatial-filter-result.webp?alt=media" alt="Circle drawn over San Francisco street trees, with the Spatial filter panel showing a count of 2,119 and the circle&#x27;s radius, area, and perimeter."><figcaption></figcaption></figure>

## Add a Spatial filter

1. On the map, click **Edit map**.
2. In the toolbar, click **Developer Platform** > **Spatial filter**. The filter appears in the **Extensions** section of the legend, and its settings open.
3. Optional: In **Title**, enter a name for the tool.
4. In **Types**, select the shapes people can draw: **Polygon**, **Circle**, or both.
5. Under **Filter results from…**, turn on each layer the filter applies to.

A Spatial filter can apply to vector and raster layers. Layers that stream pre-rendered tiles from a remote tile service can't be filtered, so their switches are unavailable. To change the settings later, in edit mode, click the filter in the **Extensions** section of the legend.

## Draw a filter

A Spatial filter works in view mode, including in an [embed](/share/embed-a-map.md), but not in edit mode. If you're editing, click **Done** first.

1. In the legend, click the Spatial filter.
2. If the filter offers both shapes, select **Polygon** or **Circle**.
3. Draw the shape on the map. The filtered layers show only what falls inside it, and the panel shows the results.
4. Click **Done**. The panel closes, and the filter stays in place.

Drawing more than one shape filters to their combined area. To remove the filter, click the trash icon at the top of the Spatial filter panel.

Only the person who draws a Spatial filter sees it, and it clears when they leave the map. The layer doesn't change. To show everyone a filtered view, [filter the layer](/layers/filter-layers.md) itself. To make a new layer from the features inside an area, use the Clip operation in [Spatial analysis](/analysis-and-dashboards/spatial-analysis.md).

## Filter results

The Spatial filter panel shows one result for each filtered layer:

* Vector layer: a feature count, such as Count of Parcels. A line or polygon that falls only partly inside the shape counts in full.
* Raster layer: the average value of the band used to style the layer, such as Average of Elevation, or the most common value for a raster styled by category.

Under the results, the **Measurements** section shows the shape's area and perimeter. For a circle, it also shows the radius.

A map's [dashboard components](/analysis-and-dashboards/dashboards.md) respond to the Spatial filter while **Update based on other filters** is on (the default), so they chart only the area someone draws.

## Export the filtered area

To export data inside a Spatial filter, click the download icon at the top of its panel. Select GeoPackage, GeoJSON, CSV, Shapefile, KML, or GeoParquet for vector layers, or GeoTIFF for raster layers. A vector export includes each whole feature that intersects the shape. A GeoTIFF export is clipped to the shape.

The download icon appears for people with Edit access to the map. For other logged-in people and people viewing an authenticated embed, it appears only when the viewer **Export data** setting is on. See [Map settings](/maps/map-settings.md) and [Export data](/export-and-print/export-data.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.felt.com/tools/spatial-filter.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
