Geofences
What are geofences?
A geofence is an area bounded by coordinates.
Geofences can overlap, have internal empty geofences, and be nested.
Locations are automatically placed in a geofence if their coordinates are located within it. For locations in a place where geofences overlap, the optimal solution is chosen automatically during planning.
Employees can be assigned to specific geofences. Such employees can't be assigned locations from other geofences. If an employee has no assigned geofences, they can be assigned locations that don't fall into any geofence.
Alert
The geofence master data is created for each company.
Why use geofences?
- Business efficiency improves as employees visit the same locations (in geofences assigned to them) and know them better.
- You can assign employees to geofences based on their transportation method: for example, on-foot employees visit locations in the city center, whereas employees with a car visit remote locations.
- You can use geofences to set payment rates for employees. For example, visits to locations within the city are paid differently than locations outside the city.
- You can use incompatible geofences to distribute employees among destinations based on the payment rates.
Adding a geofence
- In Master data → Geofences, click Add geofence.
- In the window that opens, enter the geofence name and click Next.
- Choose the desired map scale.
- To define the geofence polygon, left-click on it. Use the points to build a polygon.
- Clicking on the point again opens a drop-down menu with the ability to edit and add an internal polygon.
- To view previously created geofences on the map, choose Show existing geofences in the upper-right corner.
- To color the geofence, click Geofence color in the upper-right corner.
- When you're finished drawing the polygons, click Create.
Editing and deleting geofences
To edit a geofence, click its name. In Edit geofence mode, you can:
- Change the geofence name.
- Specify which vehicles can and can't take orders from this geofence.
- Specify incompatible geofences.
- Set the geofence color.
- Change the geofence boundaries. Drag the points with the mouse and remove extra points using the drop-down menu.
- Create an internal polygon. Click one of the boundary points and choose Add internal polygon from the drop-down menu.
- Delete a geofence. Click Delete and confirm the deletion in the window that opens.
Alert
Geofence names must be unique. If you try to create a geofence with a name that already exists in the list, you will see a warning.
Searching for a geofence
To search for a geofence, use the Search window in the upper-right corner.
Setting geofences using coordinates
To set geofence coordinates right in your planning task, create a zones
object in the request. Each element of this item describes one geofence and contains the coordinates of the polygon vertices.
To get the coordinates, use the Yandex Map Constructor tools:
-
Draw a geofence using the Polygons tool (for more information, see Create an item in Yandex Map Constructor Help).
-
Click Save and continue → Export (for more information, see Exporting map items in Yandex Map Constructor Help).
-
Select GeoJSON → Download.
-
Use the
geometry
item in the request to form thezones
item.Sample geofence description in a request
{ "zones": [ { "id": "zone1", "geometry": { "type": "Polygon", "coordinates": [ [ 37.3890158054755, 55.8142956464218 ], [ 37.4755331394599, 55.7415407888477 ], [ 37.5716635105537, 55.7984405246533 ], [ 37.5847097752021, 55.799987651288 ], [ 37.3890158054755, 55.8142956464218 ] ] } } ] }
You can also add geofence coordinates by contacting support: send the downloaded file in geojson
format and provide the desired geofence name.