Skip to content

Guide · Location

How geofencing works for time tracking

Geofencing for time tracking draws a boundary around a jobsite on a map, then tests each location reading from a worker's phone or badge against it. A reading inside the boundary counts as time at that site. Getting it right depends on two things: a boundary that matches the property, and a rule for readings near the edge, where one noisy fix can make a worker look like they left when they never did.

Last updated By ZeroBadge

What is a geofence in time tracking?

A geofence is a shape on a map with a name attached, such as "Site A" or "the shop". On its own it does nothing. It becomes useful when something reports positions over time and software checks each position against the shape.

Every geofence system has the same three parts: the boundary, a stream of location readings, and the rule that turns readings into time. Most problems people blame on "GPS" are really problems with the boundary or the rule.

The boundary
A circle (a center point and a radius) or a polygon (a list of corners). It lives in software. Nothing is installed at the site.
The readings
Positions from a phone or a worn badge, each with an uncertainty. A reading is an estimate with a margin, not a dot.
The rule
How readings become time: inside counts at the site, outside counts as off site or transit, and readings near the edge need a decision.

Should a jobsite geofence be a circle or a polygon?

A polygon, wherever the lot is not round, which is almost always. A circle has to grow until it covers the farthest corner of the property, and everything else inside that circle counts as your jobsite too: the neighbor's lot, the street, the coffee shop across the road.

Circles are common because phone operating systems offer them. Android's geofencing interface defines a fence by latitude, longitude and radius, and Google recommends a minimum radius of 100 to 150 meters for reliable results (Android developer docs). That advice makes sense for a phone, but it sets the floor on how tight a circle can be.

A 60 m × 120 m lot (about 200 × 395 ft), boxed by a circle

Lot area
60 × 120 = 7,200 m² (about 1.8 acres)
Smallest circle that reaches every corner
Radius = half the diagonal = √(30² + 60²) = √4,500 ≈ 67 m
That circle's area
π × 4,500 ≈ 14,137 m², about 2.0 times the lot
Circle at the 100 m recommended minimum
π × 100² ≈ 31,416 m², about 4.4 times the lot
Circle at 150 m
π × 150² ≈ 70,686 m², about 9.8 times the lot
Polygon drawn to the lot line
7,200 m², 1.0 times the lot

On an urban job, the extra area of a 100 m circle can take in several neighboring properties. Time spent in any of them would count as on site.

For examples of awkward shapes (an L-shaped lot, a campus split by a street, a tenant improvement inside a larger building) see geofence time tracking.

How does software decide whether a reading is inside the boundary?

For a circle, it measures the distance from the reading to the center and compares it with the radius. For a polygon, the standard method is a ray-casting test: draw an imaginary line from the reading in one direction and count how many times it crosses the polygon's edges. An odd count means inside. An even count, including zero, means outside.

The test works for any shape with straight edges, including lots with notches, which is why polygons can follow a real property line. It runs on every reading and takes a fraction of a millisecond.

  1. 1

    The site

    An L-shaped lot with corners at (0,0), (100,0), (100,60), (40,60), (40,120) and (0,120), in meters. The notch at the top right (east of x = 40 and north of y = 60) belongs to the neighbor.

  2. 2

    Reading 1 at (20, 90)

    Cast a line due east. It crosses the edge from (40,60) to (40,120) once. One crossing is odd, so the reading is inside the jobsite.

  3. 3

    Reading 2 at (70, 90)

    Cast a line due east. The vertical edges at x = 40 and x = 0 are behind it, and the edge at x = 100 only runs from y = 0 to y = 60. Zero crossings, so the reading is outside: it sits in the neighbor's notch.

  4. 4

    Same readings, circle fence

    A circle centered on the lot with a radius large enough to reach the far corners includes (70, 90). The polygon puts that reading on the neighbor's property. The circle counts it as time on your job.

How accurate is the position being tested?

Accurate to a few meters outdoors under open sky, and much less certain near buildings and indoors. The U.S. government's GPS program states that GPS-enabled smartphones are typically accurate to within a 4.9 m (16 ft) radius under open sky, and that accuracy worsens near buildings, bridges and trees (GPS.gov).

Every position is an estimate with an uncertainty radius. A reading reported as "inside, ±30 m" might be inside, or it might be 25 m outside. The inside test from the previous section only checks the center of that estimate, so accuracy decides how far you can trust the answer.

Where location readings come from, and how much to trust them
MethodWhere it worksTypical uncertaintyWhat breaks it
GPSOutdoors with a view of the skyA few meters in the openRoofs, deep floors, tall buildings, tree cover, a truck cab
Wi-Fi positioningIndoors and in dense areasTens of meters, better where networks are well knownFew networks nearby, or networks never seen before
Cellular towerAlmost anywhere with signalHundreds of meters to kilometersToo coarse to confirm a site on its own
Typical uncertainties are general ranges, not measurements of any one device. The GPS figure above is the government's stated smartphone figure.

For a side-by-side look at the three methods, see GPS vs Wi-Fi vs cellular location accuracy.

Why does a geofence edge need tolerance?

Because a reading near the boundary can land on the wrong side by chance. If one reading 10 m past the edge ends a site visit, a worker framing along the property line will "leave" and "return" several times an hour, and every flip shows up as a gap or a transit line on the timesheet.

The fix is to compare the distance past the edge with the reading's own uncertainty. A reading only counts as outside when it is clearly outside: far enough past the edge that the error margin cannot explain it. Anything closer waits for the next reading to confirm or cancel it.

An example exit rule, applied to three readings

Rule used here
Outside only if distance past the edge > 2 × uncertainty and > 50 m
9:00 AM reading
12 m past the edge, ±30 m. 12 < 60, so it is held, not counted as an exit
9:05 AM reading
8 m inside the edge, ±25 m. Back inside, so the held reading is cancelled
11:40 AM reading
85 m past the edge, ±15 m. 85 > 30 and 85 > 50, so the exit is confirmed
Site visits recorded
One visit, ending between the last inside reading and 11:40 AM

The numbers in the rule are an illustration, not a standard. Small sites need proportionally more care, because a ±30 m reading can be wider than the whole site.

Do phone geofences and a dedicated badge work the same way?

The inside test is the same. What differs is who controls the device that produces the readings. A phone geofence depends on the worker's phone being charged, carried, signed in and allowed to share location in the background. A company badge is a device the company owns and manages, so those settings are not in the worker's hands.

Phone geofencing compared with a worn cellular badge
QuestionPhone app geofenceWorn badge
Boundary shapeThe phone's built-in fencing uses circles; apps that support polygons check them in their own softwarePolygons checked in software
How often a position is checkedAndroid: usually under 2 minutes, up to 6 minutes when the phone has been stillAbout every 5 minutes
What stops readingsLocation permission off, battery saver, app closed, phone left in the truckBadge powered off or out of battery; signal loss delays reports rather than losing them
IndoorsWi-Fi improves accuracy; Android notes alerts may never arrive with Wi-Fi offWi-Fi positioning, learned for each site over the first visits
LimitsAndroid allows 100 geofences per app per device userBoundaries live on the server, not on the device
Off the clockDepends on the app pausing location when the shift ends, on a phone the worker still carriesPowered off between shifts
Android behavior is from Google's geofencing documentation. Badge behavior describes ZeroBadge.

Neither approach is free of tradeoffs. A phone can check position more often. A badge removes the dependency on personal devices and their settings. See time tracking without phones for the full comparison.

Does geofencing work inside a building?

Yes for deciding which building, no for deciding which room. GPS weakens under a roof, so indoor readings lean on Wi-Fi positioning: the device lists the networks it can hear and a positioning service estimates where those networks are. Where the networks are well known, the estimate is good enough to place someone at the right building.

  • Draw the boundary around the whole building footprint, not the suite or floor you are working on.
  • Expect the first days in a new building to be the weakest, before its networks are well known.
  • On a shell with no Wi-Fi yet, readings fall back to whatever GPS can get through the openings, which is better on upper floors and near windows.
  • A geofence cannot tell the basement from the roof. If that matters, it needs hardware installed inside, such as beacons.

More on this in indoor location without beacons.

What can a geofence not tell you?

A geofence tells you which drawn location a reading falls in. It does not tell you what the worker was doing there, and it cannot be more precise than the readings feeding it.

A geofence also should not decide whether someone is paid. Crossing a boundary is a good way to sort time between locations and a poor way to start or end a shift, because a worker who steps out to take a call or move a truck has not stopped working.

How do you draw a geofence that holds up?

Draw it to the property, give the edges room, and check it against a real day before trusting it for payroll.

  • Use a polygon that follows the lot line, including the lay-down yard and the parking you control.
  • Leave out neighbors, the public street and the restaurant next door, even if that makes the shape awkward.
  • For a building, draw the footprint, not the floor or suite.
  • Draw the shop, the office and your regular supply houses as their own locations.
  • Keep two adjacent jobs as separate shapes only if they are farther apart than typical reading uncertainty.
  • Look at the first week's readings near each edge and adjust the boundary if one side keeps flickering.
  • When a site changes (a new phase, a new gate), edit the boundary. Edits should apply to future readings, not rewrite past days.

How ZeroBadge handles this

In ZeroBadge you type an address and adjust the polygon that appears, for jobsites, the shop, the office and supply houses. Nothing is installed on site. Each worker wears a company-managed badge with its own cellular connection that reports about every 5 minutes, using GPS outdoors, Wi-Fi positioning indoors and cellular continuity in between, labelled low confidence. Every reading stores its method and confidence.

One stray reading near an edge does not end a site visit on its own, and cellular continuity never confirms a new site by itself. The geofence sorts minutes between locations; the shift itself starts at power-on and ends at power-off. If signal drops, reports are stored and uploaded with their original timestamps. The answer is always which jobsite, never which room. See geofence time tracking.

Frequently asked questions

How big should a jobsite geofence be?
As big as the property you control and no bigger. Follow the lot line, include the yard and parking you use, and leave out neighbors and the street. A circle large enough to reach every corner of a rectangular lot covers about twice the lot's area, and more if a minimum radius applies.
Why did a worker show as leaving the site when they did not?
Usually one reading near the edge landed outside by chance, or the boundary was drawn tighter than the area the crew actually uses. Check the reading's uncertainty and where it fell. A system with edge tolerance holds a near-edge reading until a second reading confirms it.
Can two jobsites next to each other have separate geofences?
Yes, if they are far enough apart that typical reading uncertainty does not overlap both. Two buildings across a narrow street, read indoors on Wi-Fi, can be hard to separate. If they are one project, draw them as two shapes under one project name.
Does crossing a geofence start or stop pay?
It should not. A boundary is a good way to sort time between locations and a poor way to decide when work began or ended. In ZeroBadge the shift starts when the badge powers on and ends when it powers off; geofences only sort the minutes in between.
How often is a worker's location checked?
It depends on the device. Android's documentation says geofence alerts usually arrive within 2 minutes and can take up to 6 minutes when a phone has been still. A ZeroBadge badge reports about every 5 minutes and stores reports when signal drops.

Sources

  1. 1.GPS Accuracy (smartphone accuracy under open sky, and what degrades it) · GPS.gov, U.S. government
  2. 2.Create and monitor geofences (circular regions, minimum radius, latency, limits) · Android Developers, Google

Get started

See ZeroBadge on your workforce.

Tell us how your crews work today. We will show you a badge-recorded week built from your own jobsites.

What we will walk through

  • 01How the badge records a shift
  • 02Your jobsites as geofences
  • 03The weekly timesheet and approval
  • 04Sending approved hours to payroll