latlng

Asset tracking and theft alerts

Know where every trailer, container, and piece of equipment is, and get an alert the moment an asset leaves its yard — or its tracker goes silent.

The challenge

Assets move less often than vehicles, but when they move unexpectedly it matters: a trailer leaving the yard at night, a generator that's no longer on the construction site, a container that never arrived at the port. Trackers report sparsely to save battery, and some stop reporting altogether.

Teams need a current inventory by site, an alert on unexpected movement, and a way to tell "hasn't moved" apart from "tracker is dead".

How latlng helps

Inventory by site

within a yard polygon returns every asset on site. Add "output": "Count" for a quick tally, or filter by type or owner fields.

Leave-the-yard alerts

Register each yard as a geofence hook detecting Exit. The first position report outside the fence triggers a webhook to your alerting system.

Only after hours

Keep a mode field such as locked on assets outside working hours, and filter the fence on it so daytime moves don't page anyone.

Silent tracker alerts

Set expire_seconds a little above the reporting interval. When a tracker misses its window, the asset expires and the yard fence fires a Del event, so a jammed or dead tracker raises the same alert as a move.

Trailer-to-tractor pairing

Roaming geofences can alert when a trailer comes within range of an unexpected tractor, or when paired equipment drifts apart.

Durable, auditable events

Alerts are delivered from a durable queue with retries and dead-lettering, and every event has a stable ID you can store for audit trails.

How it fits together

  1. 01

    Trackers report

    GPS trackers send occasional positions through your IoT platform to latlng.

  2. 02

    latlng evaluates

    Each update is checked against the yard and site geofences.

  3. 03

    Alerts fire

    Exit events reach your alerting or ticketing system as webhooks.

  4. 04

    Silence is an event

    Trackers that stop reporting expire and fire Del events, and site counts reflect only assets that reported recently.

Alert when a locked asset leaves the yard — or goes silent

This hook fires only for assets whose mode field is locked, so normal daytime movements are ignored. With Del in commands, a locked asset whose tracker stops reporting also triggers it: the receiver sees "command": "Set" for an asset that moved out and "command": "Del" for one that expired.

HTTP
curl -s -X POST http://127.0.0.1:7421/hooks \
  -H 'content-type: application/json' \
  -d '{
    "name": "yard-north-exit",
    "endpoint": "https://alerts.internal.example.com/asset-exit",
    "def": {
      "collection": "assets",
      "query": {
        "Within": {
          "area": { "GeoJson": { "type": "Polygon", "coordinates": [[
            [9.930, 53.548], [9.945, 53.548], [9.945, 53.556], [9.930, 53.556], [9.930, 53.548]
          ]] } },
          "options": {
            "where_in_filters": [ { "field": "mode", "values": ["locked"] } ]
          }
        }
      },
      "detect": ["Exit"],
      "commands": ["Set", "Del"]
    }
  }'

Where latlng stops

  • latlng receives positions from your trackers or IoT platform over HTTP; it doesn't speak device protocols like MQTT or proprietary tracker formats directly.
  • Expiry and explicit deletes both arrive as Del events; there is no separate expiry event type. If you delete assets through the API, record that on your side so the receiver can tell a decommissioned asset from a silent one.
  • Movement history and audit reports belong in a database; store webhook events there with their event IDs.

Frequently asked questions

How do I get an alert when equipment leaves a site?

Register the site boundary as a geofence hook that detects exit events on your assets collection. When a tracker reports a position outside the polygon, latlng sends a webhook to your alerting endpoint.

How do I avoid alerts during working hours?

Add a field such as mode to each asset and filter the geofence on it, for example only firing for assets marked locked. Switch the field at the start and end of shifts with a field update.

How can I tell if a tracker has stopped reporting?

Write each position with expire_seconds slightly longer than the reporting interval. If a tracker misses its window, the asset is deleted by the background expiry sweep, disappears from site queries, and fires a Del event to hooks whose commands include Del — an asset inside a yard fence arrives as command Del with detect Exit.

Does latlng connect directly to GPS trackers?

No. Trackers usually report to an IoT platform or ingestion service, which forwards positions to latlng's HTTP API or through the TypeScript SDK.