Table of Contents
- Feature Details
- Where Geofences are used
- Viewing Geofences
- Drawing a Geofence
- Importing a Geofence from a file
- Shape limits
- How address membership works
- Filtering by Geofence
- Applying a Geofence to a schedule availability
- Linking a Geofence to a company
- How to tell if a Geofence is in place
- Errors you may see
- Related Articles
Geofences: Overview
Updated
by Mitchell Ivany
- Feature Details
- Where Geofences are used
- Viewing Geofences
- Drawing a Geofence
- Importing a Geofence from a file
- Shape limits
- How address membership works
- Filtering by Geofence
- Applying a Geofence to a schedule availability
- Linking a Geofence to a company
- How to tell if a Geofence is in place
- Errors you may see
- Related Articles
Read Time: 8 mins
A Geofence is a boundary you draw on a map, or import from a file, to define a geographic area. Geofences can limit where technicians are scheduled, which services an address is eligible for, and which companies can be assigned to an account. They also let you filter accounts, jobs, tickets, network sites, serviceable addresses, and the map by area.
Sonar works out ahead of time, which addresses fall inside each Geofence. This is called address membership. It runs in the background, so filtering by Geofence stays fast no matter how many addresses you have.
Permissions
Before getting started with the feature, your user roles will need to be adjusted to account for the permissions required to use Geofences.
Feature Details
Where Geofences are used
A Geofence can be restricted to one or more of the following. A Geofence with no restriction is available everywhere.
- Schedules: limits where a technician’s schedule availability applies.
- Services: limits which addresses are eligible for a service.
- Companies: limits which companies can be assigned to an account, based on the account’s serviceable address.
Viewing Geofences
Go to Location Tools > Geofences to see all Geofences. Along with each Geofence’s name, the list shows:
- Address Membership: where the membership calculation stands. See How address membership works below.
- Companies: the companies the Geofence is linked to.

Click the arrow at the end of a Geofence’s row to open its side panel. The side panel shows the Geofence’s Address Membership status, its shape on a map, its linked companies, and notes.

Drawing a Geofence
- Go to Location Tools > Geofences and click Create Geofence.
- Enter a Name.
- Optionally, restrict the Geofence to Schedules, Services, Companies, or any combination of these. Leave it blank to make the Geofence available everywhere.

- Use the address search to move the map to the area you need. The search only moves the map. It doesn’t change your shape.
- Draw the boundary on the map.
- Click Create.

Other Geofences is on by default and outlines your existing Geofences in orange, so you can draw new boundaries that line up with them. If nothing appears, zoom out.

Importing a Geofence from a file
Instead of drawing a boundary by hand, you can import one from a file exported from mapping software.
- Go to Location Tools > Geofences, open the Create Geofence menu, and select Import Geofence.

- Enter a Name.
- Choose a file. You can import:
- A .kml file
- A .kmz file
- A .zip file containing .geojson files
- Optionally, restrict the Geofence to Schedules, Services, Companies, or any combination of these.
- Click Create.

The Geofence is created right away. Its Address Membership status then moves from Queued to In Progress to Done as Sonar works out which addresses fall inside it.

Shape limits
Every new or changed shape, whether drawn or imported, is checked against these limits:
- Each shape needs at least 3 points (vertexes).
- A shape can have up to 10,000 vertexes when its file is uploaded.
- Sonar automatically removes unneeded vertexes, such as extra points along a straight edge, without changing the boundary. After this simplification, a shape can have up to 5,000 vertexes to be saved.Geofences created before these limits existed keep working for scheduling and services. You can still rename them, but changing the shape of a Geofence that’s over the limits shows an error, and the new shape must meet the limits before it can be saved.
How address membership works
When a Geofence is created or its shape changes, Sonar calculates which addresses fall inside it. This runs in the background and can take a few minutes for large areas. New addresses, and addresses whose location changes, are checked automatically.
The Address Membership column shows where the calculation stands:
- Queued: waiting to start.
- In Progress: running.
- Done: complete. Filters by this Geofence are now accurate.
- Skipped: the shape has more than 5,000 vertexes after simplification, so it can’t be used in filters. It still works for scheduling and services.
- Failed: the calculation didn’t finish. Contact Sonar Support.
- Blank: the calculation has never run for this Geofence.
Address membership is only used for filtering. Scheduling and service eligibility always check against the full shape, exactly as you saved it.
Filtering by Geofence
Once a Geofence’s Address Membership status reads Done, you can filter by it in the Accounts, Network Sites, Serviceable Addresses, Jobs, and Tickets tables.
- Click the filter button next to the table’s search box.
- In Choose Filter, select Geofence.

- Choose one or more Geofences.
The applied filter reads Geofence is one of followed by the Geofences you chose.

You can also filter by Geofence in the scheduling job queue and technician list, and on the map’s Accounts, Network Sites, and Addresses layers. For details, see the Filtering: Overview, Scheduling Dispatcher View: Overview, and The Map Interface: Overview articles.

Applying a Geofence to a schedule availability
Applying a Geofence to a schedule availability limits that availability to jobs inside the Geofence.
- Go to Settings > Scheduling > Schedule Availabilities and open the schedule availability.
- Expand the Geofences dropdown and select the Geofence.
- Click Save.

Linking a Geofence to a company
Linking Geofences to a company limits that company to accounts whose serviceable address falls inside one of those Geofences.
- Go to Settings > Company > Companies and edit the company.
- In Geofences, select one or more Geofences.
- Click Save.

How this changes the account form
Once a Geofence is restricted to Companies, new accounts no longer pre-select the default company.

After a serviceable address is chosen, the Company list shows only companies whose Geofences contain it. If exactly one company matches, it’s selected for you. If the address isn’t inside any company’s Geofence, every company is offered.

For more on how this works with multiple companies, see the Managing Multiple Companies in Sonar: Best Practices article.
How to tell if a Geofence is in place
- On a schedule availability: edit the schedule availability. The applied Geofence shows in its Geofence field.
- On a company: open the company’s side panel from Settings > Company > Companies. Its linked Geofences are drawn on a map.

- On the Geofence itself: open the Geofence’s side panel to see its shape and linked companies.
- On the map: turn on the Geofences layer to see your Geofences, each in its own color. Click the layer to open its list, where you can:
- search for a Geofence,
- turn View All on to draw every Geofence,
- turn individual Geofences on or off,
- click the magnifying glass next to a Geofence to zoom to it.
If your instance has more than 10 Geofences, they aren’t all drawn when the map loads, which keeps the map fast. Use the Geofences layer’s list to choose which ones to display.Errors you may see
- “The uploaded file is too large once unzipped. Please upload a smaller file.” The file is over the size limit once unpacked.
- “The uploaded file could not be parsed. Please check that it is a valid KML, KMZ or GeoJSON file.” The file isn’t valid, or a coordinate in it isn’t a number.
- “The uploaded file contains a coordinate outside the valid range…” A coordinate is outside ±90 latitude or ±180 longitude.
- “The uploaded file does not contain any polygon shapes that can be used to create a Geofence.” The file has no shapes, or the .zip or .kmz file has no readable files inside.
- “There must be at least 3 vertexes.” A shape has fewer than 3 points.
- “There must be no more than 10,000 vertexes.” The shape is over the vertex limit.
- “There must be no more than 5,000 vertexes after simplification.” The shape is still over the limit after Sonar simplifies it.
- “This Geofence cannot be deleted while it is associated with one or more companies.” Remove the Geofence from every company first.
- “One or more selected Geofences cannot be used for companies.” The Geofence is restricted to something other than Companies.
Related Articles
- The Map Interface: Overview
- Filtering: Overview
- How to: Setting Up a Company in Sonar
- Managing Multiple Companies in Sonar: Best Practices
- Scheduling Dispatcher View: Overview
- Setting Up Schedules General Overview
- Configure Service Eligibility Criteria: Overview
Need a hand?
Our Support Team is here to help