Orion Context Broker - Location Request

Following the prompts in Orion v0.24.

  • As indicated in previous related issues, the documentation is ahead of the actual implementation. Is the location filter "geometries" and "coordination" already implemented?

  • Can anyone provide an example request. I do not understand what / how to transfer the coordinates. From the docs:

The list of coordinates (separated by a symbol) is interpreted depending on the geometry.

I tried the following unsuccessfully:

//Call 1
http://<some-ip>:<some-ip>/v2/entities/?type=Test&geometry=polygon&coords=35.46064,-9.93164;35.46066,3.07617;44.33956,3.07617;44.33955,-9.93164
//Result
{
  "error": "BadRequest",
  "description": "invalid character in URI parameter"
}

I tried similar combinations filtering special characters with encodeURIComponent, but nothing.

Entities in orion have the following attribute 'coordenadas':

{
    "id": "Test.1",
    "type": "Test",
    "coordenadas": {
        "type": "geo:point",
        "value": "43.7723705, -7.6784461"
     },
     "fecha": 1440108000000,
     "regiones": [
       "ES"
      ]
}

EDIT 11/11/2015

We upgraded Orion to version 0.25, where geometric queries are expected to be implemented using NGSI v2.

Call

http://<some-ip>:<some-ip>/version

, :

<orion>
    <version>0.25.0</version>
    <uptime>0 d, 2 h, 23 m, 17 s</uptime>
    <git_hash>a8cf800d4e9fdd7b4293a886490c40309a5bb58c</git_hash>
    <compile_time>Mon Nov 2 09:13:05 CET 2015</compile_time>
    <compiled_by>fermin</compiled_by>
    <compiled_in>centollo</compiled_in>
</orion>

, , , . , :

http://<some-ip>:<some-ip>/v2/entities?type=Test&geometry=circle;radius:6000&coords=43.7723705,-7.6784461

, .

:

http://<some-ip>:<some-ip>/v2/entities?type=Test&geometry=polygon&coords=40.199854,-4.045715;40.643135,-4.045715;40.643135,-3.350830;40.199854,-3.350830

, .

, "Coordenadas" . , , , v0.25, .

EDIT 04/11/2015

, , :

POST /v2/entities/ HTTP/1.1
Accept: application/json, application/*+json
Content-Type: application/json;charset=UTF-8
User-Agent: Java/1.7.0_71
Host: 127.0.0.1:1026
Connection: keep-alive
Content-Length: 379

 {
    "id":"Test.1",
    "type":"Test",
    "nombreEspecie":"especietest",
    "coordenadas":{
        "type":"geo:point",
        "value":"3.21456, 41.2136"
    },
    "fecha":1446624226632,
    "gradoSeguridad":1,
    "palabrasClave":"test, test, test",
    "comentarios":"comentarios, comentarios",
    "nombreImagen":"ImagenTest",
    "alertas":[],
    "regiones":[],
    "validacionesPositivas":0,
    "validacionesNegativas":0,
    "validacionesDenunciadas":0
}

, Orion. , ...

+4
1

, Orion 0.24.0 . (. github.com, ). 0.24.0, 0.24.1, 0.25.0 ( ) 2015 .

EDIT: 0.25.0 URL geometry coord, - NGSIv1. , geo:point location, , :

"coordenadas": {
     "location": {
        "type": "string",
        "value": "WGS84"
    },
    "type": "geo:point",
    "value": "3.21456, 41.2136"
}

"" (.. NGSIv1 , NGSIv2) NGSIv2 ( , Orion 0.25.0, NGSIv2 -).

+1

Source: https://habr.com/ru/post/1608321/


All Articles