Skip to content

Put Geofence

locationservice_put_geofence R Documentation

Stores a geofence geometry in a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request

Description

Stores a geofence geometry in a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.

Usage

locationservice_put_geofence(CollectionName, GeofenceId, Geometry,
  GeofenceProperties)

Arguments

CollectionName

[required] The geofence collection to store the geofence in.

GeofenceId

[required] An identifier for the geofence. For example, ExampleGeofence-1.

Geometry

[required] Contains the details to specify the position of the geofence. Can be a polygon, a circle or a polygon encoded in Geobuf format. Including multiple selections will return a validation error.

The geofence polygon format supports a maximum of 1,000 vertices. The Geofence Geobuf format supports a maximum of 100,000 vertices.

GeofenceProperties

Associates one of more properties with the geofence. A property is a key-value pair stored with the geofence and added to any geofence event triggered with that geofence.

Format: "key" : "value"

Value

A list with the following syntax:

list(
  GeofenceId = "string",
  CreateTime = as.POSIXct(
    "2015-01-01"
  ),
  UpdateTime = as.POSIXct(
    "2015-01-01"
  )
)

Request syntax

svc$put_geofence(
  CollectionName = "string",
  GeofenceId = "string",
  Geometry = list(
    Polygon = list(
      list(
        list(
          123.0
        )
      )
    ),
    Circle = list(
      Center = list(
        123.0
      ),
      Radius = 123.0
    ),
    Geobuf = raw
  ),
  GeofenceProperties = list(
    "string"
  )
)