Azure cosmos db 地理数据查询不一致
Azure cosmos db geographical data query inconsistency
使用 cosmos DB 地理空间配置到地理并执行以下查询我得到(在我看来)不一致的结果:
将地理空间配置更改为几何时,结果符合预期。所以我假设我忽略了一些 GIS 原则?我们还在 SQL 服务器中尝试了类似的查询,结果符合预期。
查询参考:
SELECT ST_WITHIN({'type': 'Point', 'coordinates': [
7.75,
45.12
]},
{'type': 'Polygon', 'coordinates': [[
[30.80, 59.40],
[-10, 59.40],
[-10, 43.35],
[30.80, 43.35],
[30.80, 59.40]
]]})
此查询不会产生相同的结果,因为 Geography 绘制在地球上,而 Geometry 是一个平面。使用几何模式时,您需要定义一个边界框,因为该平面是无限的。请参阅 Geometry data indexing examples 了解更多详情。
谢谢。
使用 cosmos DB 地理空间配置到地理并执行以下查询我得到(在我看来)不一致的结果:
将地理空间配置更改为几何时,结果符合预期。所以我假设我忽略了一些 GIS 原则?我们还在 SQL 服务器中尝试了类似的查询,结果符合预期。
查询参考:
SELECT ST_WITHIN({'type': 'Point', 'coordinates': [
7.75,
45.12
]},
{'type': 'Polygon', 'coordinates': [[
[30.80, 59.40],
[-10, 59.40],
[-10, 43.35],
[30.80, 43.35],
[30.80, 59.40]
]]})
此查询不会产生相同的结果,因为 Geography 绘制在地球上,而 Geometry 是一个平面。使用几何模式时,您需要定义一个边界框,因为该平面是无限的。请参阅 Geometry data indexing examples 了解更多详情。
谢谢。