Skip to main content
Version: 2.4.6

Zone

note

This resource shows how to interact with zone configurations in SENSR. You can add, delete or modify zones.

GET

/[SENSR version]/settings/zone/list

$ curl -X GET 'http://localhost:9080/[SENSR version]/settings/zone/list'
** Respond **
[
{
"id": "Int",
"name": "String",
"zone_type": "String",
"speed_limit": "Float",
"loitering_threshold": "Int",
"min_z": "Float",
"max_z": "Float",
"vertices": "Array[Vector2]"
}
]

/[SENSR version]/settings/zone

  • Get an actual config of the desired zone

  • If you do not pass any zone-id, this command returns the full zone-ids in SENSR.

  • Parameters
    • zone-id : ID of zone.
  • Return code
    • 200 OK
    • 400 BAD REQ
  • Example

$ curl -X GET 'http://localhost:9080/[SENSR version]/settings/zone?zone-id=1001'
** Respond **
{
"id": 1001,
"name": "zone-1001",
"zone_type": "Event",
"speed_limit": 27.77,
"loitering_threshold": 0,
"min_z": 0.0,
"max_z": 2.5,
"vertices": [
[
8.95,
-21.91
],
[
-13.30,
-25.27
],
[
-12.95,
-4.06
],
[
16.37,
5.74
],
[
9.58,
-21.35
]
]
}


PUT

/[SENSR version]/settings/zone

  • Adds a new zone. If this command was successful, the id of newly added zone is returned.

  • The "id"-field in the body will be ignored, you should use the new ID returned by this command.

  • Parameters
  • Return code
    • 200 OK
    • 400 BAD REQ
  • Example

$ curl -X PUT 'http://localhost:9080/[SENSR version]/settings/zone' 
--data '{
"id": 1001,
"name": "zone-1001",
"zone_type": "Event",
"speed_limit": 27.77,
"loitering_threshold": 0,
"min_z": 0.0,
"max_z": 2.5,
"vertices": [
[
-4.04,
5.27
],
[
-3.68,
3.32
],
[
-5.65,
3.02
],
[
-5.96,
4.85
]
]
}'
** Respond **
"1001


POST

/[SENSR version]/settings/zone

  • Update the configuration of an existing zone. The "id"-field should correspond to an existing zone.

  • Parameters
  • Return code
    • 200 OK
    • 400 BAD REQ
  • Example

$ curl -X POST 'http://localhost:9080/[SENSR version]/settings/zone' 
--data '{
"id": 1001,
"name": "zone-1001",
"zone_type": "Event",
"speed_limit": 27.77,
"loitering_threshold": 0,
"min_z": 0.0,
"max_z": 2.5,
"vertices": [
[
-4.04,
5.27
],
[
-3.68,
3.32
],
[
-5.65,
3.02
],
[
-5.96,
4.85
]
]
}'
** Respond **
200 OK


DELETE

/[SENSR version]/settings/zone

  • Delete a zone specified by the zone-id parameter.

  • Parameters
    • zone-id : ID of zone.
  • Return code
    • 200 OK
    • 400 BAD REQ
  • Example

$ curl -X DELETE 'http://localhost:9080/[SENSR version]/settings/zone?zone-id=1001'        
** Respond **
200 OK

/[SENSR version]/settings/zone-all

  • Delete all zones.

  • Parameters
  • Return code
    • 200 OK
    • 400 BAD REQ
  • Example

$ curl -X DELETE 'http://localhost:9080/[SENSR version]/settings/zone-all'        
** Respond **
200 OK

Logo
If you need access, please contact