【发布时间】:2016-04-09 01:32:05
【问题描述】:
我正在尝试对 DocumentDB 进行空间查询,如下所示:
SELECT * FROM root r WHERE
ST_WITHIN({'type':'Point','coordinates':[-122.02625, 37.4718]}, r.boundingBox)
在集合中匹配一个看起来像这样的文档:
{
"userId": "747941cfb829",
"id": "747941cfb829_1453640096710",
"boundingBox": {
"type": "Polygon",
"coordinates": [
[-122.0263, 37.9718],
[-122.0262, 37.9718],
[-122.0262, 36.9718],
[-122.0263, 36.9718],
[-122.0263, 37.9718]
]
},
"distance": 0,
"duration": 1
}
我已打开空间索引 ala https://azure.microsoft.com/en-us/documentation/articles/documentdb-geospatial/,但我没有从 DocumentDB 得到匹配项。
有什么想法吗?
注意:更正了 GeoJson 坐标顺序。
【问题讨论】:
-
尝试在多边形坐标周围放置另一组数组括号。
标签: azure geospatial azure-cosmosdb