【发布时间】:2017-01-05 17:16:03
【问题描述】:
据我所知,couchbase 支持地理空间数据,但我不知道如何使用它。
有人知道,是否可以通过 Couchbase 中的 N1QL SELECT 语句查询边界框内的元素?
如果是,SELECT 语句将如何使用边界框查询以下 json 中的元素?
{
"type": "Feature",
"properties": {
"name": "Bermuda Triangle",
"area": 1150180
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-64.73, 32.31],
[-80.19, 25.76],
[-66.09, 18.43],
[-64.73, 32.31]
]
]
}
}
{
"type": "Feature",
"properties": {
"name": "Flemish Diamond",
"area": 2947
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[3.55, 51.08],
[4.36, 50.73],
[4.84, 50.85],
[4.45, 51.30],
[3.55, 51.08]
]
]
}
}
{
"type": "Feature",
"properties": {
"name": "Research Triangle",
"area": 252
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-78.93, 36.00],
[-78.67, 35.78],
[-79.04, 35.90],
[-78.93, 36.00]
]
]
}
}
【问题讨论】: