Fiware Orion:订阅的地理位置过滤器

Fiware Orion:订阅的地理位置过滤器,fiware,fiware-orion,Fiware,Fiware Orion,我知道你可以使用地理定位过滤器queryContextOrion 在订阅场景中是否可以执行类似的筛选?换句话说,当position属性位于预定义区域内时,上下文实体属性的更改是否可以通知我 例如: 谢谢。NGSI协议考虑了指定订阅限制的可能性。因此subscribeContext操作支持对订阅的FIWARE::Location限制 所以答案是:是的 例子 使用POST queryContext创建实体: { "contextElements": [ { "type": "Cit

我知道你可以使用地理定位过滤器
queryContext
Orion

在订阅场景中是否可以执行类似的筛选?换句话说,当position属性位于预定义区域内时,上下文实体属性的更改是否可以通知我

例如:


谢谢。

NGSI协议考虑了指定订阅限制的可能性。因此subscribeContext操作支持对订阅的FIWARE::Location限制

所以答案是:是的

例子 使用POST queryContext创建实体:

{
  "contextElements": [
  {
    "type": "City",
    "isPattern": "false",
    "id": "Madrid",
    "attributes": [
    {
      "name": "position",
      "type": "coords",
      "value": "1, 1",
      "metadatas": [
      {
        "name": "location",
        "type": "string",
        "value": "WGS84"
      }
      ]
    },
    {
      "name": "a1",
      "type": "string",
      "value": "v1"
    }
    ]
  }
  ],
  "updateAction": "APPEND"
}
使用POST subscribeContext订阅区域中的更改:

{
  "entities": [
      {
          "type": "City",
          "isPattern": "true",
          "id": ".*"
      }
  ],
  "attributes": [
      "a1"
  ],
  "reference": "http://<host>:<port>/notify",
  "duration": "P1M",
  "notifyConditions": [
      {
          "type": "ONCHANGE",
          "condValues": [
              "a1"
          ]
      }
  ],
   "restriction": {
      "scopes": [
      {
        "type" : "FIWARE::Location",
        "value" : {
          "polygon": {
            "vertices": [
            {
              "latitude": "0",
              "longitude": "0"
            },
            {
              "latitude": "0",
              "longitude": "6"
            },
            {
              "latitude": "6",
              "longitude": "6"
            },
            {
              "latitude": "6",
              "longitude": "0"
            }
            ]
          }
        }
      }
      ]
    }
}
{
“实体”:[
{
“类型”:“城市”,
“isPattern”:“true”,
“id”:“*”
}
],
“属性”:[
“a1”
],
“参考”:“http://:/notify”,
“持续时间”:“P1M”,
“通知条件”:[
{
“类型”:“ONCHANGE”,
“价值观”:[
“a1”
]
}
],
“限制”:{
“范围”:[
{
“类型”:“FIWARE::Location”,
“价值”:{
“多边形”:{
“顶点”:[
{
“纬度”:“0”,
“经度”:“0”
},
{
“纬度”:“0”,
“经度”:“6”
},
{
“纬度”:“6”,
“经度”:“6”
},
{
“纬度”:“6”,
“经度”:“0”
}
]
}
}
}
]
}
}
然后更新实体的a1值,看看会发生什么