Location
Golioth Location is a comprehensive device positioning service, making it possible to determine and track device location via a variety of sources, including GNSS and network information. The following examples demonstrate the flexibility of leveraging Golioth Location in Pipelines.
Network-Based Positioning
Network-based
positioning resolves
device location from delivered network information, such as cell tower and Wi-Fi
access point data. In the following example, the location
transformer is used
to obtain position, which is then used to update the device location via the
location
destination, before being recorded to LightDB
Stream.
filter:
path: "*"
content_type: application/cbor
steps:
- name: convert-to-json
transformer:
type: cbor-to-json
version: v1
- name: resolve-position
transformer:
type: location
version: v1
- name: store-location
destination:
type: location
version: v1
- name: stream-location
destination:
type: lightdb-stream
version: v1
Returning Location to Devices
When using network-based positioning, devices are not made aware of their position because it is calculated in Pipelines. The following example builds on the previous one, adding a step to update LightDB State, which allows a device to fetch its own current position using the Golioth Firmware SDK.
filter:
path: "*"
content_type: application/cbor
steps:
- name: convert-to-json
transformer:
type: cbor-to-json
version: v1
- name: resolve-position
transformer:
type: location
version: v1
- name: store-location
destination:
type: location
version: v1
- name: stream-location
destination:
type: lightdb-stream
version: v1
- name: set-state
destination:
type: lightdb-state
version: v1
Traditional (GNSS) Positioning
In the following example, a device with GNSS capabilities streams its position
to Golioth without requiring a resolution step. The location information is
still delivered to Golioth Location via the location
destination, and is
recorded in LightDB Stream. Pairing this pipeline with one of the preceding
examples demonstrates how devices can seamlessly transition between GNSS and
network-based positioning while presenting location data in a consistent manner.