1

I'm testing Geo-located queries explained here and when I use a positive values of LatLng (Middle of Indian Ocean, China, Australi, West of Canadá, etc) the Context Broker returns Internal Server Error, for example:

This Query: myorion.local:1026/NGSI10/queryContext?offset=0&limit=100&details=on :

{
"restriction":{
    "scopes":[
        {
            "type":"FIWARE_Location",
            "value":{   
                "polygon":{
                    "vertices":[
                        {"latitude":2.811371193331,"longitude":130.078061},
                        {"latitude":13.031027211328,"longitude":130.078061},
                        {"latitude":13.031027211328,"longitude":140.24472766667},
                        {"latitude":2.811371193331,"longitude":140.24472766667}
                        ]
                    }
            }
        }
    ]
    },
    "entities":[
        {"id":".*","type":"Arduino","isPattern":"true"}
    ],
    "attributes":[]
}

Returns:

{
  "errorCode" : {
    "code" : "500",
    "reasonPhrase" : "Internal Server Error",
    "details" : "collection: orion.entities - query(): { query: { $or: [ { _id.id: /.*/, _id.type: "Arduino" } ], _id.servicePath: { $exists: false }, location.coords: { $geoWithin: { $geometry: { type: "Polygon", coordinates: [ [ [ 2.811371193331, 130.078061 ], [ 13.031027211328, 130.078061 ], [ 13.031027211328, 140.24472766667 ], [ 2.811371193331, 140.24472766667 ], [ 2.811371193331, 130.078061 ] ] ] } } } }, orderby: { creDate: 1 } } - exception: count fails:{ errmsg: "exception: bad geo query", code: 2, ok: 0.0 }"
  }
}

The same problem happens for Circle:

{
"restriction":{
    "scopes":[
        {
            "type":"FIWARE_Location",
            "value":{
                "circle":{
                    "centerLatitude":0.60024334316097,
                    "centerLongitude":102.58133563829,
                    "radius":610000
                    }
            }
        }
    ]
    },
    "entities":[
        {"id":".*","type":"Arduino","isPattern":"true"}
    ],
    "attributes":[]
}

Will return:

{
  "errorCode" : {
    "code" : "500",
    "reasonPhrase" : "Internal Server Error",
    "details" : "collection: orion.entities - query(): { query: { $or: [{ _id.id: /.*/, _id.type: "Arduino" } ], _id.servicePath: { $exists: false }, location.coords: { $geoWithin: { $centerSphere: [ [ 0.6002433431609701, 102.58133563829 ], 0.0957463506513891 ] } } }, orderby: { creDate: 1 } } - exception: count fails:{ errmsg: "exception: bad geo query", code: 2, ok: 0.0 }"
  }
}

I'm pretty sure that is because of positive values, because aways when I have a positive value in Lat or Lng value i get this erro from Context Broker

"collection: orion.entities - query(): { query: { $or: [{ _id.id: /.*/, _id.type: "Arduino" } ], _id.servicePath: { $exists: false }, location.coords: { $geoWithin: { $centerSphere: [ [ 0.6002433431609701, 102.58133563829 ], 0.0957463506513891 ] } } }, orderby: { creDate: 1 } } - exception: count fails:{ errmsg: "exception: bad geo query", code: 2, ok: 0.0 }"

  • Orion Version: 0.14.0
  • MongoDB Version: 2.6.3
  • CentOS 6.5
4

1 回答 1

1

Orion 0.14.0 之前的版本有一个已知错误,该错误会避免使用经度大于 90 度(或小于 -90 度)的查询。该错误已在代码库的开发分支中修复,将包含在 Orion 0.14.1 版本中。

感谢 Leonan Carvalho 帮助调试这个问题!

于 2014-07-28T19:11:48.913 回答