---
metadata:
  - name: generator
    content: Diplodoc Platform v5.19.6
alternate:
  - https://docs.routeq.com/doc/en/vrp/options-geozones.md
title: RouteQ — properties and options — geofencing options
---
> **Documentation Index:** Fetch the complete configuration index at https://docs.routeq.com/doc/en/llms.txt


# Consider geofences

You can create geofences in the [interface](https://docs.routeq.com/doc/en/vrp/geozones.md#geozones-interface) and then use them for planning via Excel or API. You can also set geofences directly in the [API request](https://docs.routeq.com/doc/en/vrp/geozones.md#geozones-api).

## Ignore zones  {#ignore-zones}

If you enable the `options.ignore_zones` option, you will cancel all geofencing restrictions. For more information, see [Geofences](https://docs.routeq.com/doc/en/vrp/properties-of-vehicles.md#geozones) and [Incompatible geofences](#incompatible-zones).

```json
"options": {
    "ignore_zones": true
}
```

When planning with an Excel file, you can specify the `ignore_zones` option in the Planning interface on the **Settings** → **Consider geofences** tab. The `ignore_zones` = `true` field value corresponds to the pressed button **No**.

## Incompatible geofences {#incompatible-zones}

When planning routes, you may need to allocate orders to different runs:

- Due to the road's characteristics. For example, we don't recommend delivering orders to opposite sides of a river or railway in one run. This way, you use bridges and crossings less often.
    
- Because of billing specifics. For example, to divide orders by direction.
    
In such cases, you can use geofences and specify their incompatibility on the **Options** sheet in the `incompatible_zones.N` field, where N is the number of the incompatible geofence set (there can be multiple sets, numbering starts from 0). 

Orders in incompatible geofences can't be delivered in the same run. When planning routes, orders are distributed to different runs if they have at least one incompatible geofence.

```json
"options": {
    "incompatible_zones": [
        [
            "zone2",
            "zone3"
        ]
    ]
}
```

Incompatible zones can also be set for [individual couriers](https://docs.routeq.com/doc/en/vrp/properties-of-vehicles.md#incompatible-geozones).

**Example 1**

This example shows incompatible geofences `zone1` and `zone2`. Their orders can't be delivered in one run. Order 2 is in `zone1`, and order 4 is in `zone2`. All orders are delivered by the same vehicle.

As a result, the vehicle does two runs.

[API request (JSON)](https://courier.yandex.ru/vrs/api/v1/log/request/c3b82854-1f10384c-e276f36d-67b8138f) ⋅ [API response](https://courier.yandex.ru/vrs/api/v1/result/c3b82854-1f10384c-e276f36d-67b8138f) ⋅  [View on map](https://yandex.com/courier/mvrp-map#c3b82854-1f10384c-e276f36d-67b8138f)

**Example 2**

The same conditions as in Example 1, but the following setting is used in the Planning interface: **Settings** → **Consider geofences** → **No**.

As a result, the vehicle delivers all orders in the same run.

[API request (JSON)](https://courier.yandex.ru/vrs/api/v1/log/request/7d7bfaa4-f7f13036-c23247bb-11ff5f4) ⋅ [API response](https://courier.yandex.ru/vrs/api/v1/result/7d7bfaa4-f7f13036-c23247bb-11ff5f4) ⋅  [View on map](https://yandex.com/courier/mvrp-map#7d7bfaa4-f7f13036-c23247bb-11ff5f4)


## Excluded zones {#avoid-zones}

The company can prohibit couriers from entering certain geofences. These could be areas like mountainous roads with high accident rates, unsafe bridges, or river crossings. You can set such geofences [in the interface](https://docs.routeq.com/doc/en/vrp/geozones.md#geozones-interface) or [via the API](https://docs.routeq.com/doc/en/vrp/geozones.md#geozones-api) and list them by name, separated by commas, in the `avoid_zones` field on the **Options** sheet when planning a route. 

{% note info "The difference between forbidden and excluded geofences" %}

You can specify geofences within which the couriers aren't allowed to deliver orders in the `forbidden_zones` field on the **Vehicles** sheet. See [Setting geofences](https://docs.routeq.com/doc/en/vrp/properties-of-vehicles.md#geozones). But couriers can still travel through these geofences. Geofences listed in the **Options** sheet in the `avoid_zones` field restrict couriers from traveling through them.

{% endnote %}

You can use a maximum of 300 points to specify excluded zones via the [interface](https://docs.routeq.com/doc/en/vrp/geozones.md#geozones-interface) or [API](https://docs.routeq.com/doc/en/vrp/geozones.md#geozones-api). To ensure you stay within the limit, consider these suggestions:

* Use a triangular shape for your geofences.

* Instead of selecting the entire zone, focus on key points such as checkpoints and entry points.

For example, you don't need to select the entire bridge area to prohibit couriers from passing through it. Just add a triangular geofence at the entrance.

{% cut "Screenshot" %}

![](_images/avoid-zones-example.png)

{% endcut %}

{% note warning %}

We recommend that you design the excluded zones to intersect as few roads as possible. The service counts the total number of roads inside the zones from `avoid_zones`, as well as intersections with toll roads when [toll‑road](https://docs.routeq.com/doc/en/vrp/avoid-tolls.md) avoidance is enabled.

If this number exceeds the technical limit, routes won't be built.

{% endnote %}


### Allocation of problem orders {#haversine-fallback}

If the route to the order location can't be planned using roads without passing through excluded zones, the order is added to the planned route by default, but planned as a straight-line distance. The length of the route segment is calculated as five times the straight-line distance to the order location. To avoid such planning, specify the option `haversine_fallback` as `false` (by default it's `true`). This way, such orders will be placed in the unassigned category. 

**Example 1**

The courier delivers 5 orders. Order 5 needs to be delivered to an island. The route is planned through the bridge. The length of the route is 46.08 km. The distance to Order 5 is 5.78 km. The route to the order location is plotted via the bridge. You can see this in the ["by road" mode](https://docs.routeq.com/doc/en/vrp/interface-result.md#routes).

[API request (JSON)](https://courier.yandex.ru/vrs/api/v1/log/request/44c31341-71d5d556-1e9fa447-b3671c24) ⋅ [API response](https://courier.yandex.ru/vrs/api/v1/result/44c31341-71d5d556-1e9fa447-b3671c24) ⋅  [View on map](https://yandex.com/courier/mvrp-map#44c31341-71d5d556-1e9fa447-b3671c24)

**Example 2**

The same as in Example 1, but all bridges to the island are defined as excluded zones. By default, `haversine_fallback` is set to `true`, and the route to Order 5 is calculated as a straight-line distance. The route length is 57.64 km, and the distance to Order 5 is 10.35 km.

[API request (JSON)](https://courier.yandex.ru/vrs/api/v1/log/request/84c366cd-36541ad6-531455b6-e238d989) ⋅ [API response](https://courier.yandex.ru/vrs/api/v1/result/84c366cd-36541ad6-531455b6-e238d989) ⋅  [View on map](https://yandex.com/courier/mvrp-map#84c366cd-36541ad6-531455b6-e238d989)

**Example 3**

The same as in Example 2, but the `haversine_fallback` parameter is `false`. Order 5 becomes unassigned. 

[API request (JSON)](https://courier.yandex.ru/vrs/api/v1/log/request/71e6ef2b-d40ffc6d-cc7cf78e-7452d0c2) ⋅ [API response](https://courier.yandex.ru/vrs/api/v1/result/71e6ef2b-d40ffc6d-cc7cf78e-7452d0c2) ⋅  [View on map](https://yandex.com/courier/mvrp-map#71e6ef2b-d40ffc6d-cc7cf78e-7452d0c2)

{% include [warehouse-feedback](_includes/feedback-81845556eeea.md) %}
