Skip to content

GpsLocation

The GPS Location operation checks whether a coordinate falls within a circular geofence. The geofence is defined by a centre point (latitude, longitude) and a radius in kilometres. Distance is calculated using the Haversine formula.

GPS Location operation

Inputs

PortTypeRequiredDescription
> (Gate)AnyNoWhen connected, a false or Nil value stops the path. See Gate Inputs.
LatitudeInteger or FloatYesLatitude of the point to check (-90 to 90).
LongitudeInteger or FloatYesLongitude of the point to check (-180 to 180).

Outputs

PortTypeDefaultDescription
OutBoolean(unset until first valid run)true if the point is within the geofence, false otherwise.

Properties

NameTypeDefaultDescription
Radius (km)Number1.0Geofence radius in kilometres (0.01—1000).
LatitudeNumber51.509865Latitude of the geofence centre.
LongitudeNumber-0.118092Longitude of the geofence centre.
On ErrorComboStop this branchPer-op On Error verb (Stop this branch / Continue with the last value / Continue with the fallback). See the Error Handling guide.

State on Reload

The last computed Out value is preserved across restarts.


  1. Gate check — If the Gate is connected and false or Nil, the execution path stops; outputs remain unchanged.

  2. Validate inputs — Latitude must be a finite number in [-90, 90]; longitude in [-180, 180]. Out-of-range or non-finite values, or an unconnected Mandatory input, invoke the On Error verb.

  3. Calculate distance — The Haversine formula computes the great-circle distance between the input point and the geofence centre.

  4. Compare — If the distance is less than or equal to Radius, Out is true; otherwise false.


Assume the geofence centre is London: Latitude 51.509865, Longitude -0.118092.

Radius: 5.0 km

InputValue
Latitude51.507351 (Trafalgar Square)
Longitude-0.127758

Output: true — the point is within 5 km of the centre.


  • Triggering alerts when a device enters or leaves a designated area
  • Activating location-based actions for asset tracking
  • Monitoring personnel or vehicles within operational zones

GPS Location can hit these errors: an unconnected Mandatory Latitude/Longitude input, a non-numeric value (the Type mask catches most of these earlier), latitude outside [-90, 90], longitude outside [-180, 180], or any non-finite value.

Any of these triggers the On Error verb you picked. See the Error Handling guide for the common On Error model; GPS Location’s options are:

VerbWhat it does
Stop this branch (default)This Node and its dependents stop; Out keeps its value and reads as a failed update.
Continue with the last valueDependents run on the value Out already holds, not stamped as new; it reads as a failed update.
Continue with the fallbackDependents run on Out’s per-output Fallback, stamped as this run’s value; it reads as a failed update. The Editor refuses a Task where the Fallback is unset.

Out carries the per-output Fallback you set in Settings under the Out port, like any other Output — Nil until you set one, and a Boolean false is the usual choice for a location test.

Gate closure is not an error — a closed Gate stops the Path and consults no verb.


  • The Haversine formula assumes a perfect sphere; for sub-metre precision over very short distances, more complex geodesic calculations may be needed.
  • Input coordinates must be in decimal degrees within standard ranges.