Map Array in Stream Analytics

Ingo Busse 1 Reputation point

Is it possible to map an array contained in a message via the geospatial functions?

"id": "<msgid>",
"location": {50.2, 30.3},
"geofences": [{"name": xxx, "polygon": <polygon1>},{"name": "yyy", "polygon": <polygon2>}]

I.e. to get all names the location is inside? But not as separate messages but in this one.

Azure Stream Analytics
Azure Stream Analytics
An Azure real-time analytics service designed for mission-critical workloads.
343 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,381 Reputation points Microsoft Employee

    Hello @IngoBusse-2268 ,

    Thanks for the question . Just wanted to check if you have tried the option of something like .

    SELECT location,
    GetArrayElement(geofences, 0) AS fence1,
    GetArrayElement(geofences, 1) AS fence2,
    GetArrayElement(geofences, 2) AS fence3
    FROM ...

    Use GetarrayElement

    Thanks Himanshu

    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members