流分析地理空间功能使用

Stream analytics geospatial function usage

我想通过使用 latitude/longitude 数据(通过 Azure IoTHub 发送)和目标 latitude/longitude 或多边形数据(来自参考输入)来使用流分析地理空间函数。

我知道我们可以在查询中加入流和引用输入,但是是否有可能实现一个解决方案,我们没有任何数据可以在流和引用输入之间加入并且仍然计算例如使用 ST_DISTANCE?

的点之间的距离

示例参考输入数据:

"points":[
{
    "point": {
    "type" : "Point",
    "coordinates" : [0.0, 10.0] } 
},
{
    "point": {
    "type" : "Point",
    "coordinates" : [0.0, 0.0] }
},
{
    "point": {
    "type" : "Point",
    "coordinates" : [0.0, -5.0] }
}]

上面的数据会有更多的点,所以在查询中手动输入点将不是一个好的解决方案。

我希望输出包含比较的点及其距离。

在使用 SQL 查询后,我发现实际上 CROSS JOIN 在流分析中可用,但在文档中不可用。所以使用类似的东西:

SELECT ST_DISTANCE(CreatePoint(input.Lat, input.Lon), CreatePoint(ref.Lat, ref.Lon)) 
INTO output FROM inputStream input 
CROSS JOIN reference ref

有效。