Modify Polygonal Geofence

Last Updated on : 2023-06-15 04:57:20

Modify the attributes of a polygonal geofence.

API address

PUT: /v2.0/iot-01/fences/polygon/{fence_id}

Request parameter

Parameter name Type IN Required Description
fence_id Long uri true The geofence ID.

Description of body

Parameter name Type IN Required Description
tag String false The custom dimension tag to classify the geofences. The geofences can be filtered by the dimension tags.
fence_name String false The name of the geofence.
vertexes String false The coordinates of the vertices of the polygon, including the latitude and longitude. The number of vertices ranges from 3 to 50.
coord_type String false Indicates the type of the longitude and latitude positioning coordinate system. Valid values:
  • WGS84: Google Coordinate System.
  • GCJ02: AutoNavi.
  • BD09LL: Baidu.
warn_rule Integer false Indicates the alert rules. Valid values:
  • 1: triggers an alert when someone enters the geofence.
  • 2: triggers an alert when someone exits the geofence.
  • 3: triggers an alert when someone enters or exits the geofence.

Return parameter

Parameter name Type Description
result Boolean Indicates whether the operation is successful.

Request example

PUT: /v2.0/iot-01/fences/polygon/44024
{ "tag": "ceshi", "fence_name": "The Second Polygonal Geofence", "vertexes": "30,121;31.02,121;29,118", "coord_type": "WGS84", "warn_rule": 1 }

Return example

{ "result": true, "t": 1625215422330, "success": true }

Error code

For more information, see error code.