> For the complete documentation index, see [llms.txt](https://docs.widgelix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.widgelix.com/actions-formerly-rule-engine/condition-types/geofences.md).

# Geofences

Geofence conditions fire depending on whether an asset with GPS coordinates (trackers, mobile assets) is **inside** or **outside** one or more areas.

## Settings

Choose **Geofence** as the comparison type in the IS configuration:

| Field                   | Description                                                 |
| ----------------------- | ----------------------------------------------------------- |
| **Geofence Comparison** | **In the areas** or **Outside the areas**.                  |
| **Geofence Areas**      | Click **Select Geofence Areas** to draw the areas on a map. |

## Drawing areas

<figure><img src="https://2494440469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fggsr9Xlsze5cwVr4WMof%2Fuploads%2FOwhYnabmysp3pwUVCVzm%2Fgeofence-areas.png?alt=media&amp;token=1583c596-7035-4128-ac43-555652df08c3" alt="Geofence Areas dialog"><figcaption><p>Geofence Areas dialog</p></figcaption></figure>

1. Use **Search for a place or address** to move the map to your site.
2. Pick a **Draw tool**:
   * **Circle**: click on the map to drop a circle, then drag to resize it.
   * **Polygon**: click to place the corners of the area.
3. Every area appears in the **Areas** list on the left. You can define several areas; the counter at the bottom shows how many are defined.
4. Click **Save**.

## Tips

* To detect that an asset **stays** outside an area for some time (instead of a single position outside), combine the geofence condition with [Temporal Control](/actions-formerly-rule-engine/temporal-control.md), e.g. persist duration 10 minutes.
* Use **Trigger Once** so that the action fires once when the asset leaves the area and again only after it has returned.
* Switching threshold range is not available for geofence conditions.
