当使用经度值大于90或小于-90时,Orion Geo定位查询返回内部服务器错误

时间:2014-07-16 19:37:54

标签: fiware-orion

我正在测试解释地理位置的查询here以及当我使用LatLng的正值时 (印度洋中部,中国,澳大利亚,加拿大西部等)Context Broker返回内部服务器错误,例如:

此查询: 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":[]
}

返回:

{
  "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 }"
  }
}

Circle也出现同样的问题:

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

将返回:

{
  "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 }"
  }
}

我很确定这是因为正值,因为当我在Lat或Lng值中有正值时,我会从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}} - 异常:count失败:{errmsg:“exception :糟糕的地理查询“,代码:2,确定:0.0}”

  • 猎户座版本:0.14.0
  • MongoDB版本:2.6.3
  • CentOS 6.5

1 个答案:

答案 0 :(得分:1)

0.14.0之前的猎户座版本有一个known bug,可以避免使用经度大于90度(或小于-90度)的查询。该错误已经在代码库中的develop分支中修复,将包含在Orion 0.14.1版本中。

感谢Leonan Carvalho帮助调试此问题!