Table of Contents

Geofences: Overview

Mitchell Ivany Updated by Mitchell Ivany

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.

If you’re a Super Admin, you already have full access, and no changes are needed. To learn more, see the User Role Creation & Best Practices article.
Entity
Permission
Reason
Geofence
View all geofences
View geofences, their address membership, and the geofence filters.
Geofence
Create a geofence
Draw or import a new geofence.
Geofence
Update a geofence
Edit a geofence's name, shape, or restrictions.
Geofence
Delete a geofence
Delete a geofence that isn't linked to a company.
Company
Update a company
Link geofences to a company.

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.
Restricting Geofences keeps your lists tidy. A Geofence restricted to Companies won’t appear when you’re choosing a Geofence for a schedule availability, and the reverse is also true.

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.
The Geofences list showing four geofences with their Restricted To, Address Membership, and Companies columns, each marked Done and linked to a company.

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.

The Geofences list with the Kenosha County side panel open, showing its name, Address Membership status of Done, a map of its vertices, and its linked company.

Drawing a Geofence

  1. Go to Location Tools > Geofences and click Create Geofence.
  2. Enter a Name.
  3. Optionally, restrict the Geofence to Schedules, Services, Companies, or any combination of these. Leave it blank to make the Geofence available everywhere.
    The Restricted to dropdown opened in the Create Geofence window, showing Companies, Schedule Availabilities, and Services.
  4. 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.
  5. Draw the boundary on the map.
  6. Click Create.
The Create Geofence window with Name and Restricted to fields, and a map with Create Mode, Edit Mode, and Other Geofences buttons and an address search.

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.

The Create Geofence window zoomed out over the Midwest with Other Geofences turned on, showing existing geofences outlined in orange.
If your instance has more than 10 Geofences, they aren’t drawn when the map loads, which keeps the map fast. Use the filters to choose which Geofences to display.

Importing a Geofence from a file

Instead of drawing a boundary by hand, you can import one from a file exported from mapping software.

  1. Go to Location Tools > Geofences, open the Create Geofence menu, and select Import Geofence.
    The Create Geofence button’s dropdown opened, showing Import Geofence.
  2. Enter a Name.
  3. Choose a file. You can import:
    • A .kml file
    • A .kmz file
    • A .zip file containing .geojson files
  4. Optionally, restrict the Geofence to Schedules, Services, Companies, or any combination of these.
  5. Click Create.
The Import Geofence window with Name, a Select File button listing the supported .kml, .zip, and .kmz file types, and a Restricted to field.

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.

The Geofences list after importing KB Test – Downtown Waukesha, with a Geofence created confirmation and the new geofence’s Address Membership showing Queued.
Only the outer boundary of each shape is imported. In a .zip file, only .geojson and .json files are read, and other files such as folders or a README are ignored. In a .kmz file, every .kml file inside is read and its shapes are combined, while images and other files are skipped.

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.
Filters by a Geofence are only complete once its Address Membership status reads Done. While the status is Queued or In Progress, filtered results may be missing some addresses.

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.

  1. Click the filter button next to the table’s search box.
  2. In Choose Filter, select Geofence.
    The Accounts table filter menu opened, with Geofence underlined in the list of filters.
  3. Choose one or more Geofences.

The applied filter reads Geofence is one of followed by the Geofences you chose.

The Accounts table filtered to accounts whose geofence is one of Kenosha County.

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.

The dispatcher’s Job Queue tab with the Geofence filter set to Is one of, and the list of geofences open to choose from.
For the steps, see the Filtering: 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.

  1. Go to Settings > Scheduling > Schedule Availabilities and open the schedule availability.
  2. Expand the Geofences dropdown and select the Geofence.
  3. Click Save.
The Edit Schedule Availability window with Kenosha County selected in the Geofence field.
Only Geofences restricted to Schedules, or not restricted at all, appear in this list.

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.

  1. Go to Settings > Company > Companies and edit the company.
  2. In Geofences, select one or more Geofences.
  3. Click Save.
The Edit Company window for Parent Internet, with Kenosha County selected in the Geofences field.
Only Geofences restricted to Companies, or not restricted at all, can be selected.
How this changes the account form

Once a Geofence is restricted to Companies, new accounts no longer pre-select the default company.

The Create Account window before a serviceable address is chosen, with no company selected and all four companies listed.

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.

The Create Account window with a Kenosha serviceable address chosen, and the Company list narrowed to Parent Internet and USA Wireless.

For more on how this works with multiple companies, see the Managing Multiple Companies in Sonar: Best Practices article.

A Geofence linked to a company can’t be deleted. Remove it from every company first.

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.
    The Companies list with the Parent Internet side panel open, showing the company’s details and a map of its Kenosha County geofence.
  • 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.
    The map with the Geofences layer list open, showing a Search box, a View All toggle, and individual geofence toggles with zoom buttons.
    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.

Need a hand?

Our Support Team is here to help

How did we do?

Example Jobs & Templates

Job Types: Best Practices