Definition
Geo-Fence is a virtual geographic boundary. When a device GNSS/LBS positioning enters or leaves the fence, an alert is triggered. It is used for asset tracking, fleet management, shared bike illegal parking, etc.
Technical Implementation
Geo-fences are defined as polygonal, circular, or route areas on an electronic map. Devices obtain latitude and longitude through GNSS or LBS and perform geometric calculations with the fence boundary to determine entry and exit status. Entry and exit events can trigger local alarms, report to the platform, or execute preset actions (such as locking the vehicle or sending notifications). Fences support dynamic creation, modification, activation/deactivation, and can be configured on both the platform and terminal sides, depending on business latency and power consumption requirements.
Positioning Method Selection
GNSS has high accuracy (meter-level) and is suitable for outdoor vehicles and asset tracking; LBS is based on base station positioning, has lower accuracy (hundred-meter level) but low power consumption and can be used indoors, suitable for shared bikes, children's watches, etc. Some devices use GNSS+LBS hybrid positioning, using GNSS outdoors and switching to LBS indoors or under weak signals, balancing accuracy and availability. Modules need to support the corresponding positioning capability and report location data.
Use Cases
Shared bikes use fences to manage electronic no-parking zones and recommended parking areas, with illegal parking triggering fees or locks; fleet management defines operation areas and prohibited areas, with out-of-bounds alerts; asset tracking sets safe zones, triggering alerts upon leaving; logistics delivery defines delivery ranges, automatically updating waybill status upon entering or exiting fences. Communication modules are responsible for reporting location and fence events to the platform in real time, serving as the infrastructure for geo-fence services.
Engineering Practice Supplement
Starting from 'geofencing,' common on-site issues often focus on 'metrics meeting laboratory standards but difficult to reproduce in the field.' Besides radio frequency and protocols, one should also check power grounding, connector contact, and firmware race conditions. On the cellular side, it is recommended to collect RSRP/SINR, cell reselection, and PDP reconstruction records; on the application side, there should be clear strategies for retries, idempotency, and queue persistence. When data security and compliance are involved, include the collection scope, storage location, retention period, and third-party sharing in privacy policies and contract appendices to avoid high costs of patching after deployment.
The following are additional tips related to cellular IoT project delivery: it is recommended to keep screen recordings of typical scenarios, screenshots of key indicators, and summaries of masked packet captures during the acceptance phase; in the mass production phase, change records should be kept for software and hardware versions, calibration parameters, and key component batches to facilitate problem attribution, customer audits, and long-term maintenance. When payment or personal information is involved, also check whether log masking and key rotation strategies are executable.
Geometric boundaries and the positioning error band
A geofence is a set of constraints on geographic coordinates: a circle is a center and a radius, a polygon is an ordered list of vertices, and a route fence adds a corridor width. The device or the platform tests the current position with geometry such as point-in-polygon or distance to a segment, and it raises an enter or exit event only when the state changes from inside to outside or the reverse. The position may come from satellite, from the cellular network, or from a fusion of the two, but the fence itself does not improve accuracy. When the positioning error is larger than the fence, the geometry has no stable answer. A no-parking zone only a few tens of meters across, with a larger scatter in the fix, will flip the violation on every new solution.
The method fits when the fence is clearly larger than the positioning scatter in that setting, and the service can accept one confirmation delay. Outdoor vehicles and site gates can judge immediately from a satellite fix on the device. Underground garages and indoors should use the cell, Bluetooth, or the last valid point, and the event should carry an accuracy class. If a person clicks the vertices on a map, that coordinate system must match the one the device reports. Mixing a GCJ-02 offset with WGS-84 shifts the whole fence.
Edge jitter and repeated enter and exit events
When a device drives or parks along the boundary, multipath makes the point hop from one side to the other. Without a hysteresis distance and a minimum duration, the platform receives a stream of enter and exit alerts. If the test runs only in the cloud and position reports are sparse, a vehicle may already have crossed the fence before one point is sent, and the event is missed or stamped at the wrong time. A circle with too small a radius around a junction marks a normal lane as a violation. Overlapping fences with no priority fire both “forbidden” and “work allowed” at the same place. If the device clock is wrong, enter and exit times do not line up with video or access control, and a dispute cannot be reconstructed in order.
Add a buffer at the boundary, confirm a state change only after several points fall on the same side, and use an event sequence number so a replay is not billed twice. On roads, pass the point through map matching before testing the area, so a parallel road or an interchange does not throw the point outside the fence. A short loss of satellite lock can be filled with dead reckoning, but once the extrapolated distance grows, lower the confidence and do not keep using it as a meter-level point against a fine fence.
Add a buffer outside the boundary, and confirm enter or exit only after several points fall on the same side. Carry a sequence number so replay can be deduplicated. Keep the coordinate system aligned with the base map so the whole fence is not shifted. The fence must be larger than the positioning scatter in that setting, or the verdict flips on every solution. Write a priority where regions overlap. Align device time with the platform, or the order against access control or video cannot be checked. On roads, constrain the point to the road network before testing the area. After a long extrapolation through a satellite outage, lower the confidence and stop using it against a very fine boundary.