> For the complete documentation index, see [llms.txt](https://legacydocs.flytbase.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacydocs.flytbase.com/features/zones/geofences.md).

# Geofences

FlytBase enables the operators to create two kinds of geofences:

{% tabs %}
{% tab title="Polygonal Geofence" %}

### Creating a Polygon Geofence on the FlytBase

* Before proceeding ahead, ensure that the drone is connected to the FlytBase dashboard.
* Navigate to **Geofences** under **Zones** from the left navigation drawer.

<figure><img src="/files/LyocHeavpXOyZqkrX91m" alt=""><figcaption><p>Geofences</p></figcaption></figure>

* Click on the '**Edit**' option next to the drone.
* ​​Toggle the Geofence state to enable the geofence for the particular drone.
* Select ![](/files/uH7JJv0BCsOTCkWmBVM3)**Polygonal Geofence**.
* Left-click on the map to mark the **Polygon Geofence.**&#x20;

{% hint style="info" %}
An operator may also upload a KML file to create a geofence. \
The KML file must be a closed shape.
{% endhint %}

<figure><img src="/files/WE9mQf5dOvpl2v2iySWy" alt=""><figcaption><p>Setting a polygonal geofence</p></figcaption></figure>

{% hint style="info" %}
Left-click to drag on or inside the marked geofence to change its location.&#x20;

Left-click on the vertices to edit the shape by dragging the control points shown at the vertices and on each segment.
{% endhint %}
{% endtab %}

{% tab title="Circular Geofence" %}

### Creating a Circular Geofence on theFlytNow Dashboard

* Before proceeding ahead, ensure that the drone is connected to the FlytNow dashboard.
* Navigate to **Geofences** under **Zones** from the left navigation drawer.

<figure><img src="/files/LyocHeavpXOyZqkrX91m" alt=""><figcaption><p>Geofences</p></figcaption></figure>

* Click on the '**Edit**' option next to the drone.
* ​​Toggle the Geofence state to enable the geofence for the particular drone.
* Select the ![](/files/rmQM6O7wlKyH8kQOAHsw)**Circular geofence** type.
* Left-click on the map to create a Circular Geofence.

<figure><img src="/files/EsaCLexWliG7w9Hpogjf" alt=""><figcaption><p>Setting a Circular Geofence</p></figcaption></figure>

{% hint style="info" %}
Left-click on the centre point of the geofence to drag the marked boundary or left-click on the vertices to expand the marked boundary.​
{% endhint %}
{% endtab %}
{% endtabs %}

### Set Geofence Failsafe actions

The operator has the option to set one of the following actions in response to a geofence breach:

* **RTH- Return to Home:** This action will instruct the drone to return to its predetermined home location if the geofence is breached.&#x20;
* **Land:** This will instruct the drone to land at its current location.&#x20;
* **Hover:** This will instruct the drone to hover in position for the specified number of seconds over a waypoint until manual control is regained.&#x20;
* **Continue:** This will instruct the drone to continue if the failsafe is breached.&#x20;
* **RTDS- Return To Docking Station**: This action will instruct the drone to return to its docking station at the set RTDS speed and altitude in case the geofence is breached.
* Now, set the **Allowed Maximum Altitude** and **Radius**. Note that if the altitude or radius is exceeded, the set Failsafe action will be executed.

{% hint style="info" %}
If the drone crosses the geofence, the set failsafe action will be triggered. If the operator wants to cancel the action, they can click the **Abort** button on the dashboard.
{% endhint %}

<figure><img src="/files/prkmXWPTpfDTcx4cZEA0" alt=""><figcaption><p>FlytBase Dashboard: Aborting Failsafe Action</p></figcaption></figure>

**Disabling a Geofence**

* To disable the geofence, simply toggle off the **Geofence state button** as shown in the figure below and click on **Done**.

<figure><img src="/files/avE4VdQRaLNnEDg8jShQ" alt=""><figcaption><p>Deactivate geofence</p></figcaption></figure>

**Resetting a Geofence**

* Click the **Reset** button as shown below to reset the geofence on the FlytBase dashboard and draw the boundary again if needed.

<figure><img src="/files/zvjlKIueNEfcHLFNFscT" alt=""><figcaption><p>Resetting a geofence</p></figcaption></figure>

**Tips for flying with an active Geofence**

* Before launching a flight, verify that all of the parameters are configured as per the geofence set for the respective drone.
* Make sure that all missions, docking station locations, and safe locations are all set inside the geofence.
* Before executing the mission, ensure that the mission altitude and waypoint altitude are less than the **Allowed maximum altitude**.

{% hint style="info" %}
The drone pre-emptively reduces its pitch speed when it is about to breach the set geofence.
{% endhint %}
