HERE Technologies and Wherobots announce partnership Learn More

What is a Geofence? How Geofencing Works, With Examples

Authors

A geofence is a virtual boundary drawn around a real place on a map. When a phone, car or ship crosses that boundary, software records it: going in is an entry, and going out is an exit. The check is simple. The result depends on how often the device reports its position. If a ship reports once every 15 minutes and spends 10 minutes inside a zone, the visit can fall between two reports and go uncounted.

We tested that on the right whale speed zones off the U.S. East Coast. Ships 65 feet or longer must slow to 10 knots inside these zones during set seasons. We ran a geofence check in Wherobots on 42.7 million positions of those ships from March 2024. With one position per minute, we counted 7,689 zone visits. With one position every 15 minutes, 203 of those visits went uncounted, and all 203 were shorter than 15 minutes.

Key takeaways

  • A geofence is a polygon or a circle on a map. For each location, software tests one thing: is this point inside the shape?
  • Entry and exit events come from comparing each location with the one before it. A dwell event fires when a device stays inside for a set time.
  • With one position per minute in March 2024, we counted 7,689 visits by 1,576 ships to 9 right whale speed zones.
  • 106 visits (1.4%) started within 10 minutes of the same ship leaving the same zone. A dwell rule of 3 minutes, with gaps of up to 10 minutes merged, left 7,208 visits.
  • With one position every 15 minutes, 32.3% of visits shorter than 5 minutes and 16.5% of visits of 5 to 15 minutes went uncounted. Every visit of 15 minutes or more was still counted.
  • Inside the zones, 8.3% of moving positions were over 10 knots. In waters within 30 nautical miles outside the zones, 32.1% were.

What is a geofence?

Google's Android developer guide, Create and monitor geofences says: "the latitude, longitude, and radius define a geofence, creating a circular area, or fence, around the location of interest." Washington's My Health My Data Act defines one in law as "a virtual boundary that is 2,000 feet or less from the perimeter of the physical location."

A geofence does not have to be a circle. A port, a school campus or a speed zone is usually a polygon: a shape made of straight edges between corner points. The right whale zones in our test are polygons and circles cut by the coastline.

Three maps of right whale speed zones drawn in yellow over ship traffic in blue. Left: a circle of 20 nautical miles around the entrance to the Port of New York and New Jersey, cut off by the New Jersey and Long Island shores. Middle: Cape Cod Bay, bounded by the shore and two straight lines at sea. Right: a long strip of sea along the coast from Wilmington, North Carolina, to Brunswick, Georgia
Three right whale speed zones from the federal rule: a circle, a polygon and a coastal band. Zone boundaries from the National Oceanic and Atmospheric Administration (NOAA). Positions of ships 65 feet or longer in March 2024 come from NOAA Marine Cadastre AIS (Automatic Identification System) data, counted in H3 hexagons in Wherobots. Analysis: Wherobots. Basemap: OpenFreeMap, OpenMapTiles, OpenStreetMap contributors.

Geofencing is the process of checking locations against geofences and acting on the result. The action can be an alert, a log entry, a rule that applies only inside the zone, or an ad.

How geofencing works

The point-in-polygon test

Each location is a point: a latitude and a longitude. The core question is whether the point falls inside the geofence polygon. Computer scientists call this the point-in-polygon problem.

The common method is to draw a line from the point in one direction and count how many polygon edges the line crosses. An odd count means the point is inside; an even count means it is outside. Moshe Shimrat published this method as Algorithm 112 in Communications of the ACM in 1962. Eric Haines compared the speed of several point-in-polygon methods in Point in Polygon Strategies (Graphics Gems IV, 1994). Kai Hormann and Alexander Agathos covered the cases where a point sits on an edge in The point in polygon problem for arbitrary polygons (Computational Geometry, 2001).

In SQL (Structured Query Language), the test is a function such as ST_Intersects or ST_Contains. ST_Contains returns false for a point on the boundary; ST_Intersects returns true.

Enter, exit and dwell events

One inside-or-outside answer is a state. An event comes from comparing two states in time order:

  • Enter: the previous location was outside and this one is inside.
  • Exit: the previous location was inside and this one is outside.
  • Dwell: the device has stayed inside for a set time.

Android's geofencing API uses these three events. Google's guide recommends the dwell event to "reduce 'alert spam'". A device near the edge can flip in and out, because each reported location is a few meters off. The app developer sets the dwell time, called the loitering delay.

Diagram in two panels. Left: a polygon with two points. A line from point A, inside, crosses 1 edge; a line from point B, outside, crosses 2 edges. Right: a row of one-minute positions passes through a rectangular geofence. Enter marks the first position inside, Dwell marks 3 minutes inside, and Exit marks the first position outside
How a geofence check works. Left: the crossing test from Shimrat (1962), where an odd number of edge crossings means inside. Right: enter, dwell and exit events from positions in time order, as in Android’s geofencing API. Diagram: Wherobots.

Many geofences at once

A phone app tracks a few geofences. A fleet or shipping system checks millions of locations against thousands of zones. That is a spatial join: a join between two tables on a spatial test in place of a shared key. A spatial index finds the few zones near each point before the exact test runs. The R-tree, which Antonin Guttman introduced in R-trees: a dynamic index structure for spatial searching (ACM SIGMOD, 1984), is one such index.

Geofence vs geofencing, geotargeting and geocoding

TermWhat it isInputOutput
GeofenceA boundary drawn around a placeA polygon or a center and radiusA shape stored in an app or table
GeofencingChecking locations against geofences and acting on the resultLocations in time orderEnter, exit and dwell events
GeotargetingChoosing content or ads by a user's general locationAn internet address or a stated cityContent for that area
GeocodingTurning an address into coordinatesAn addressA latitude and longitude
Geofence warrantA court order for location records inside an area and time windowAn area and a time windowRecords of the devices found

Geofence examples

Speed zones at sea. The National Oceanic and Atmospheric Administration (NOAA) runs NOAA Fisheries, the agency that protects marine mammals. It requires most vessels 65 feet or longer to travel at 10 knots or less in set zones along the East Coast at set times of year. These zones are Seasonal Management Areas (SMAs). Each one is a geofence with a season attached.

The rule is section 224.105 of Title 50 of the Code of Federal Regulations (CFR), written 50 CFR 224.105. It took effect through a 2008 final rule.

Fleets and vehicles. Fleet software records when a truck enters or leaves a depot or a customer site, which gives arrival and departure times. Jean-François Reclus and Kristen Reed-Drouard described geofencing to control and manage heavy goods vehicles at the 16th Intelligent Transport Systems (ITS) World Congress in Stockholm in 2009.

Phones and apps. An app can register up to 100 geofences per user on an Android device, according to Android's guide. A store app can alert a store when a customer arrives to pick up an order.

Marketing. Geofencing marketing sends an ad or a notification when a phone enters an area such as a store or a stadium. It uses the same entry check.

Law enforcement. A geofence warrant asks a company for records of every device inside an area during a time window.

Geofencing, privacy and the law

Geofencing needs a stream of locations. The legal questions are about who holds that stream and who can ask for it.

Phones. Android's API alerts an app when the phone enters or leaves a registered geofence. The app needs location permission to register geofences. Phone locations from Wi-Fi networks can be tens of meters off, so Android's guide recommends a radius of at least 100 to 150 meters.

Health care. Washington's My Health My Data Act makes it unlawful to place a geofence around an in-person health care facility for three uses. They are identifying or tracking people seeking care, collecting their health data, and sending them ads.

Geofence warrants. In United States v. Chatrie, police served Google with a warrant after a 2019 bank robbery near Richmond, Virginia. Google first returned 19 accounts linked to devices within 150 meters of the bank in the 30 minutes before and after the robbery, the Supreme Court news site SCOTUSblog reported.

On June 29, 2026, the Supreme Court held 6 to 3 that getting these records was a Fourth Amendment search. Justice Elena Kagan wrote for the majority. The Court sent the case back to decide whether the search was reasonable. Earlier, in United States v. Smith (2024), the Fifth Circuit held geofence warrants to be general warrants, which the Fourth Amendment forbids.

Where the data sits. In December 2023 Google announced that Location History, renamed Timeline, would be saved on the user's device.

Geofences in Wherobots

In this section we run a geofence check on a month of ship positions. We ran it in WherobotsDB, the spatial SQL engine in Wherobots, which comes from the original creators of Apache Sedona. Ships broadcast their position by AIS (Automatic Identification System), a radio system that reports a ship's identity, position, course and speed. The geofences are the right whale SMAs.

North Atlantic right whales are endangered. NOAA Fisheries estimated 384 right whales alive at the start of 2024. Vessel strikes are one of the threats it lists. Angelia Vanderlaan and Christopher Taggart studied this in Vessel collisions with whales: the probability of lethal injury based on vessel speed (Marine Mammal Science, 2007). They found that the chance a strike kills a whale falls below one half at 11.8 knots.

The test

Claim. A geofence check is one spatial join. Its result depends on how often each ship reports its position. With a report every minute, ships near a zone edge produce a few false entries and exits, and a dwell rule removes them. With a report every 15 minutes, short visits go uncounted.

What would support it. At one position per minute, few visits are short re-entries. When we keep fewer positions, the visits we lose are the short ones.

What would break it. Many visits at one position per minute are re-entries within minutes, so most raw events are false. Or keeping fewer positions loses long visits as often as short ones.

Data and method

The positions come from NOAA Marine Cadastre AIS data for 2024. These are daily GeoParquet files of U.S. AIS records, downsampled by NOAA to one position per vessel per minute. Larger ships carry a Class A transmitter. It reports every 2 to 10 seconds while underway, under the AIS standard of the International Telecommunication Union, ITU-R M.1371. So NOAA's files already keep only a few of the reports each ship sent.

We loaded all 31 days of March 2024 into Wherobots: 235,256,466 positions from 37,812 vessels. We kept positions between 24 and 46 degrees north and 60 and 82 degrees west: 61,586,520 positions from 14,190 vessels. The rule applies to vessels 65 feet (19.8 meters) or longer, so we kept positions from ships with a reported length of at least 19.8 meters: 42,691,450 positions. A few ships have two rows in the same minute. We kept the first row per ship per minute, which left 42,680,220 positions from 5,987 ships.

The zone boundaries come from NOAA's Seasonal Management Areas map data. There are 10 zones. Nine were in season for all of March. The Great South Channel zone runs from April 1 to July 31, so we left it out.

ZoneSeason under 50 CFR 224.105Area (km²)Visits in March 2024Ships
Mid-Atlantic U.S. (Wilmington, North Carolina, to Brunswick, Georgia)November 1 to April 3017,0861,513454
Entrance to the Chesapeake BayNovember 1 to April 301,8281,231543
Ports of New York and New JerseyNovember 1 to April 301,5371,035437
Delaware BayNovember 1 to April 301,681894384
Block Island SoundNovember 1 to April 305,073829199
Southeast U.S.November 15 to April 159,101786266
Off Race PointMarch 1 to April 303,419703123
Cape Cod BayJanuary 1 to May 152,148481106
Ports of Morehead City and Beaufort, North CarolinaNovember 1 to April 302,25021769

Step 1 is the geofence check: a spatial join between the positions and the zones.

sedona.sql("""SELECT CAST(get_json_object(props,'$.objectid') AS INT) zid, get_json_object(props,'$.location') zone, geom
              FROM org_catalog.geofence.sma WHERE get_json_object(props,'$.location') <> 'Great South Channel'""").createOrReplaceTempView("z")
sedona.sql("""SELECT mmsi, t, ts, sog, vessel_type, length, geom FROM (
                SELECT mmsi, t, CAST(unix_timestamp(t) AS BIGINT) ts, sog, vessel_type, length, geom,
                       ROW_NUMBER() OVER (PARTITION BY mmsi, CAST(unix_timestamp(t) / 60 AS BIGINT) ORDER BY t) r
                FROM org_catalog.geofence.ais_east_2024_03 WHERE length >= 19.8) WHERE r = 1""").createOrReplaceTempView("p")
sedona.sql("SELECT p.mmsi, p.ts, z.zid FROM p JOIN z ON ST_Intersects(z.geom, p.geom)").writeTo("org_catalog.geofence.inside").createOrReplace()

mmsi is the ship's radio identity number. sog is speed over ground in knots, as the ship's transmitter reported it.

Step 2 turns inside-or-outside states into visits. For each ship that entered a zone, the query lines up all its positions in time order. It flags each one as in or out of that zone, in the table tr. A visit starts at an inside position whose previous position was outside, or came more than 30 minutes earlier:

WITH s AS (
  SELECT *, LAG(inz) OVER w AS pin, LAG(ts) OVER w AS pts
  FROM tr WINDOW w AS (PARTITION BY zid, mmsi ORDER BY ts)),
b AS (SELECT *, CASE WHEN inz = 1 AND (pin IS NULL OR pin = 0 OR ts - pts > 1800) THEN 1 ELSE 0 END AS st FROM s),
g AS (SELECT *, SUM(st) OVER (PARTITION BY zid, mmsi ORDER BY ts ROWS UNBOUNDED PRECEDING) AS vid FROM b WHERE inz = 1)
SELECT zid, mmsi, vid, MIN(ts) t_in, MAX(ts) t_out, COUNT(*) n_rec
FROM g GROUP BY zid, mmsi, vid

Step 3 keeps fewer positions. For each ship and zone, the query keeps the first position in each 5-minute or 15-minute block. A visit counts as missed when no kept position falls inside the zone between its entry and exit:

WITH th AS (SELECT zid, mmsi, ts, inz FROM (
              SELECT *, ROW_NUMBER() OVER (PARTITION BY zid, mmsi, CAST(ts / 900 AS BIGINT) ORDER BY ts) r FROM tr) WHERE r = 1),
hit AS (SELECT v.zid, v.mmsi, v.vid, MAX(th.inz) found
        FROM v LEFT JOIN th ON th.zid = v.zid AND th.mmsi = v.mmsi AND th.ts BETWEEN v.t_in AND v.t_out
        GROUP BY v.zid, v.mmsi, v.vid)
SELECT COUNT(*) visits, SUM(CASE WHEN COALESCE(found, 0) = 0 THEN 1 ELSE 0 END) missed FROM hit

Results

The spatial join found 1,716,855 positions inside the 9 zones, from 1,576 ships. Step 2 grouped them into 7,689 visits. 329 visits had a single position, and 393 lasted less than 3 minutes.

Few visits were false re-entries. 106 visits (1.4%) started within 10 minutes of the same ship leaving the same zone, and 22 within 3 minutes. We applied a dwell rule: merge visits split by 10 minutes or less outside the zone, then keep visits of 3 minutes or more. That left 7,208 visits, 6.3% fewer than the raw count.

Bar chart of zone visits missed after thinning, by visit length. Under 5 minutes, 470 visits: 17.0% missed at one position every 5 minutes and 32.3% at one every 15 minutes. 5 to 15 minutes, 309 visits: none missed at 5 minutes and 16.5% at 15 minutes. 15 to 60 minutes and 60 minutes or more: none missed at either rate
Share of zone visits with no position inside the zone after thinning, from NOAA Marine Cadastre AIS for March 2024 and the right whale Seasonal Management Areas. Spatial join and thinning in WherobotsDB SQL. Analysis: Wherobots. At one position every 15 minutes, 32.3% of visits under 5 minutes disappear.

Keeping fewer positions lost only short visits. At one position every 5 minutes, 80 of the 7,689 visits (1.0%) had no position inside the zone. All 80 lasted less than 5 minutes. At one position every 15 minutes, 203 visits (2.6%) went uncounted: 152 of 470 visits under 5 minutes (32.3%) and 51 of 309 visits of 5 to 15 minutes (16.5%). No visit of 15 minutes or more was missed at either rate.

Map of a ship track passing the corner of the Block Island Sound speed zone off Montauk, New York. One-minute positions are blue outside the zone and yellow inside it, with 12 yellow positions in a row. Red circles mark the 5 positions kept at one every 15 minutes. None of them is inside the zone. A dashed red line between them cuts across the zone corner
One ship’s pass through the Block Island Sound Seasonal Management Area on March 28, 2024, from NOAA Marine Cadastre AIS. The point-in-polygon test and the thinning ran in WherobotsDB SQL. Analysis: Wherobots. Basemap: OpenFreeMap, OpenMapTiles, OpenStreetMap contributors. At one position per minute, the ship has 12 positions inside the zone; at one every 15 minutes, it has none.

On March 28, 2024, a ship crossed a corner of the Block Island Sound zone off Montauk, New York. It reported 12 positions inside the zone over 13 minutes, at 8.3 to 9.9 knots.

The map shows 63 of its one-minute positions. Keeping one position every 15 minutes leaves 5 of them, and none of those is inside the zone. A line drawn between the kept positions crosses the zone, but the geofence check only tests the positions.

Speed inside the zones

The geofence check also gives the speed of each ship at each position inside the zones. We compared moving ships inside the zones with moving ships in the waters around them. "Moving" means a reported speed of 1 knot or more. We left out vessels reporting the military or law enforcement type, since the rule exempts federal vessels and state law enforcement vessels on duty.

"Around them" means within 30 nautical miles (55.6 km) of a zone's edge. We buffered each zone by that distance with ST_Buffer on the spheroid, then tested positions with ST_Intersects.

Horizontal bar chart of the share of positions above 10 knots. Within 30 nautical miles outside the zones: 32.1% of positions from 2,377 ships. Inside the active zones: 8.3% from 1,528 ships. By zone: Mid-Atlantic U.S. 18.6%, Entrance to the Chesapeake Bay 7.3%, Ports of New York and New Jersey 7.2%, Delaware Bay 6.7%. Then Morehead City and Beaufort 5.5%, Southeast U.S. 5.4%, Block Island Sound 5.1%, Cape Cod Bay 4.4%, Off Race Point 1.8%
Share of positions above 10 knots for ships 65 feet or longer moving at 1 knot or more, March 2024. Data: NOAA Marine Cadastre AIS and the right whale Seasonal Management Areas. Speed over ground as reported by each ship. Analysis: Wherobots. Inside the zones, 8.3% of positions were above 10 knots; in nearby waters, 32.1%.

Inside the zones, 8.3% of moving positions were over 10 knots, with a median speed of 7.5 knots. Within 30 nautical miles outside the zones, 32.1% were over 10 knots, with a median of 8.2 knots. Every one of the 1,528 ships inside a zone also had positions in the nearby waters. Their own positions there were over 10 knots 34.0% of the time. The Mid-Atlantic band off Georgia and the Carolinas had the highest share inside a zone, at 18.6%.

These numbers count positions. Measuring compliance with the rule needs more data. Speed comes from each ship's own transmitter. Ships may deviate from the limit to keep a safe maneuvering speed, and a few ships report no length. Ships also slow down near ports for other reasons, so the gap between inside and outside is not all caused by the rule.

NOAA's 2020 assessment of the speed rule reported that in most zones more than 85% of vessels subject to the rule kept speeds under 10 knots. Our position share inside the zones, 91.7% at or under 10 knots, is in the same range.

Verdict

The claim held. At one position per minute, 1.4% of visits were re-entries within 10 minutes, and a dwell rule cut the visit count by 6.3%. At one position every 15 minutes, 2.6% of all visits went uncounted. They were 32.3% of visits under 5 minutes and 16.5% of visits of 5 to 15 minutes. No longer visit was lost.

The NOAA files keep one position per ship per minute, so this test cannot measure visits shorter than a minute.

Geofencing research history

Point in polygon (1962 to 2001). Shimrat's 1962 algorithm counted edge crossings. Haines (1994) compared the speed of crossing tests, angle-summing tests and grid methods. Hormann and Agathos (2001) gave a test that handles points on the boundary and polygons whose edges cross each other.

Spatial indexes (1984). Guttman's R-tree grouped nearby shapes into nested boxes, so a query reads only the boxes near a point. Spatial databases use R-trees and similar indexes to run point-in-polygon joins on large tables.

Geofencing for vehicles (2009). Reclus and Reed-Drouard applied geofences to heavy goods vehicles in a paper at the ITS World Congress.

Speed zones for whales (2007 to 2014). Vanderlaan and Taggart (2007) linked vessel speed to the chance that a strike kills a whale. NOAA set the 10-knot zones in a 2008 rule.

Paul Conn and Gregory Silber wrote Vessel speed restrictions reduce risk of collision-related mortality for North Atlantic right whales (Ecosphere, 2013). They estimated that the restrictions cut the risk of a strike killing a whale by 80 to 90%. David Laist, Amy Knowlton and Daniel Pendleton wrote Effectiveness of mandatory vessel speed limits for protecting North Atlantic right whales (Endangered Species Research, 2014). They mapped right whale carcasses from vessel strikes against the 10 zones, before and after the rule.

Geofences at scale (2015 onward). Checking every position of every ship against every zone is a spatial join over millions of rows. Jia Yu, Jinxuan Wu and Mohamed Sarwat introduced GeoSpark (ACM SIGSPATIAL, 2015) to run spatial joins on Apache Spark, a system that splits data processing across many machines. Yu, Zongsi Zhang and Sarwat described how it divides spatial data across machines in Spatial data management in Apache Spark: the GeoSpark perspective and beyond (GeoInformatica, 2018). GeoSpark became Apache Sedona, the engine WherobotsDB is built on.

The Wherobots post Streaming Spatial Data into Wherobots with Spark Structured Streaming runs the same check on live data. Each micro-batch of incoming asset positions is joined to a table of geofence polygons with ST_Intersects. A micro-batch is the small group of records a stream processes at one time.

Conclusions

  1. A geofence check is a point-in-polygon test, and many geofences at once are a spatial join. If you check more than a few devices against more than a few zones, store the zones as polygons and run one join with ST_Intersects. In our test, one join checked 42.7 million positions against 9 zones.
  2. Use a dwell rule before you count visits. At one position per minute, 1.4% of ship visits were re-entries within 10 minutes. Merging gaps of 10 minutes or less and keeping visits of 3 minutes or more cut the count by 6.3%. Set the dwell time from your own re-entry counts.
  3. Match how often positions are reported to the shortest visit you need to count. At one position every 15 minutes, 32.3% of visits under 5 minutes and 16.5% of visits of 5 to 15 minutes went uncounted. Every longer visit was still counted. If you need visits shorter than your sampling interval, get more frequent positions.
  4. Do not draw lines between sparse positions and call the result a visit. A line between two kept positions can cross a zone corner the ship passed through. Only positions tested inside the zone count as evidence of a visit.
  5. Speed inside a geofence is not a compliance measure. Inside the right whale zones, 8.3% of moving positions were over 10 knots, against 32.1% in nearby waters. A compliance finding also needs the ship's exemptions, its logbook deviations and checked length data.
  • Spatial join: the operation that checks many points against many geofences
  • Map matching: placing GPS (Global Positioning System) records on the roads a vehicle drove, another way to turn a location stream into events
  • Points of interest (POI) data: the places many geofences are drawn around
  • Isochrone: a zone drawn by travel time, which can serve as a geofence
  • H3: the hexagonal grid used to count positions in the header map
  • Geospatial data: the vector data model that points and polygons belong to
  • Coordinate reference system: why distances in degrees differ from distances in meters
  • Geospatial database: the systems that store geofences and run spatial joins
  • Geospatial analysis: the wider set of methods that geofencing is part of

Read more from Wherobots

Wherobots is the AI Context Engine for Physical World Data. Run geofence checks on your own location data at cloud.wherobots.com.

Frequently asked questions

What is a geofence?

A geofence is a virtual boundary drawn around a real place on a map. When a phone, car or ship crosses that boundary, software records it. Going in is an entry, and going out is an exit. Each event can start an action, such as an alert, a log entry or a notification.

Does geofencing track your location?

Geofencing needs a location to work, so the device or service that runs it reads your location. On an Android phone, an app can register up to 100 geofences with the operating system and gets an alert when the phone enters or leaves one. The app needs location permission to register geofences.

In law enforcement, a geofence warrant asks a company for records of devices that were inside an area during a time window. In June 2026 the U.S. Supreme Court held in Chatrie v. United States that getting those records is a Fourth Amendment search.

What is geofencing in cars used for?

In cars and trucks, a geofence is a zone in fleet or vehicle software. The software records when a vehicle enters or leaves a depot, a customer site or a restricted area, and can send an alert. Fleets use these events to log arrival and departure times and to check that vehicles stay on approved routes. Research on heavy goods vehicles has used geofences to control where trucks may drive.

What is the point of geofencing?

With geofencing, software turns a stream of locations into events tied to a place: entered, left, or stayed for a set time. Software can then act on each event, with no person watching a map. One example is a speed rule that applies only inside a zone. Others are a delivery app that alerts a store when a courier arrives, and a fleet log of arrival and departure times.

Is geofencing illegal?

Geofencing itself is legal and common in apps, fleets and shipping. Some uses are limited by law. Washington’s My Health My Data Act bans geofences around in-person health care facilities for some uses. These are tracking people seeking care, collecting their health data and sending them ads.

Geofence warrants, which ask a company for every device inside an area during a time window, are a Fourth Amendment search under the 2026 Supreme Court decision in Chatrie v. United States.

What is a geofence warrant?

A geofence warrant asks a company that stores location history, such as Google, for records of every device inside an area during a time window. In Chatrie v. United States, the warrant asked for devices within 150 meters of a bank in the 30 minutes before and after a 2019 robbery, and Google returned 19 accounts. The Supreme Court held 6 to 3 that this was a search and sent the case back to decide whether it was reasonable.

How accurate is a geofence?

A geofence is only as accurate as the location that feeds it and how often that location arrives. Android’s documentation recommends a radius of 100 to 150 meters to cover the error of locations from Wi-Fi networks, and says alerts usually arrive within 2 minutes. In a test on March 2024 ship positions, with one position every 15 minutes, 32.3% of zone visits shorter than 5 minutes went uncounted.

What is geofencing marketing?

Geofencing marketing sends an ad or a notification to a phone when it enters an area, such as a store or an event. It uses the same entry check as any other geofence. Some laws limit it: Washington state bans geofences around health care facilities for ads to people seeking care.

How do you build a geofence in SQL?

Store each geofence as a polygon in one table and each location as a point in another. A spatial join with ST_Intersects or ST_Contains returns the points inside each geofence. Window functions then order each device’s points by time and mark where it moved from outside to inside (an entry) or from inside to outside (an exit).