Skip to content

Forecast Geofence Events

locationservice_forecast_geofence_events R Documentation

This action forecasts future geofence events that are likely to occur within a specified time horizon if a device continues moving at its current speed

Description

This action forecasts future geofence events that are likely to occur within a specified time horizon if a device continues moving at its current speed. Each forecasted event is associated with a geofence from a provided geofence collection. A forecast event can have one of the following states:

ENTER: The device position is outside the referenced geofence, but the device may cross into the geofence during the forecasting time horizon if it maintains its current speed.

EXIT: The device position is inside the referenced geofence, but the device may leave the geofence during the forecasted time horizon if the device maintains it's current speed.

IDLE:The device is inside the geofence, and it will remain inside the geofence through the end of the time horizon if the device maintains it's current speed.

Heading direction is not considered in the current version. The API takes a conservative approach and includes events that can occur for any heading.

Usage

locationservice_forecast_geofence_events(CollectionName, DeviceState,
  TimeHorizonMinutes, DistanceUnit, SpeedUnit, NextToken, MaxResults)

Arguments

CollectionName

[required] The name of the geofence collection.

DeviceState

[required] Represents the device's state, including its current position and speed. When speed is omitted, this API performs a containment check. The containment check operation returns IDLE events for geofences where the device is currently inside of, but no other events.

TimeHorizonMinutes

The forward-looking time window for forecasting, specified in minutes. The API only returns events that are predicted to occur within this time horizon. When no value is specified, this API performs a containment check. The containment check operation returns IDLE events for geofences where the device is currently inside of, but no other events.

DistanceUnit

The distance unit used for the NearestDistance property returned in a forecasted event. The measurement system must match for DistanceUnit and SpeedUnit; if Kilometers is specified for DistanceUnit, then SpeedUnit must be KilometersPerHour.

Default Value: Kilometers

SpeedUnit

The speed unit for the device captured by the device state. The measurement system must match for DistanceUnit and SpeedUnit; if Kilometers is specified for DistanceUnit, then SpeedUnit must be KilometersPerHour.

Default Value: KilometersPerHour.

NextToken

The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.

Default value: null

MaxResults

An optional limit for the number of resources returned in a single call.

Default value: 20

Value

A list with the following syntax:

list(
  ForecastedEvents = list(
    list(
      EventId = "string",
      GeofenceId = "string",
      IsDeviceInGeofence = TRUE|FALSE,
      NearestDistance = 123.0,
      EventType = "ENTER"|"EXIT"|"IDLE",
      ForecastedBreachTime = as.POSIXct(
        "2015-01-01"
      ),
      GeofenceProperties = list(
        "string"
      )
    )
  ),
  NextToken = "string",
  DistanceUnit = "Kilometers"|"Miles",
  SpeedUnit = "KilometersPerHour"|"MilesPerHour"
)

Request syntax

svc$forecast_geofence_events(
  CollectionName = "string",
  DeviceState = list(
    Position = list(
      123.0
    ),
    Speed = 123.0
  ),
  TimeHorizonMinutes = 123.0,
  DistanceUnit = "Kilometers"|"Miles",
  SpeedUnit = "KilometersPerHour"|"MilesPerHour",
  NextToken = "string",
  MaxResults = 123
)