Geospatial Functions in Azure Stream Analytics

Sign in to queue

Description

In this episode of Azure Friday, Donovan Brown is joined by Sam Chandrashekar as they take a look at native support for geospatial functions in Azure Stream Analytics (now Generally Available). Take advantage of built-in geospatial functions in your stream-processing logic to define geographical areas, and evaluate incoming geospatial data for containment, proximity, and overlap to generate alerts, easily kick-off necessary workflows, and more.

Tag:

Azure

Embed

Download

The Discussion

  • User profile image
    rvdbrand

    Will more functions be added later? Because for geofencing, checking for positions in or outside of circles might be very handy.

  • User profile image
    HiredMind

    This needs a Linq provider. Developers are moving away from straight SQL queries, and MS is embracing Linq and Entity Framework in almost all other aspects of development. I've forgotten much of SQL since switching to EF, and each time I have to use it, I have to go search out the documentation. A Ling provider would also enable "push" into your app via IObservable or IEnumerable & yield, rather than periodic polling.

  • User profile image
    Christos

    Are you gonna develop on the spatial sector more stuff? like PostGIS, this is something that a .NET developer would really need in Azure !!!

    Keep up the great job,
    X.

  • User profile image
    TheRealSam

    @rvdbrand: We certainly plan on adding additional functions going forward. Please submit requests for features and functions at UserVocie.

    We are certainly looking to natively supporting the ability to draw a circle. For the time being, you can use ST_DISTANCE from the center of a circle to determine whether a point is inside or outside a circular region.

    - Sam from the video

  • User profile image
    TheRealSam

    @Christos: Most certainly! We are continuing to invest in this area and have exciting new functionality in the pipeline. Watch the Stream Analytics blog to stay posted on the latest announcements and details for participating in private preview functionality.

    - Sam from the video

  • User profile image
    TheRealSam

    @HiredMind: Thanks for the feedback. At this time, Stream Analytics queries can be authored in our SQL-like declarative language. Additionally, JavaScript can be used for User Defined Functions.

    We are looking into adding support for C# and a LINQ provider going forward. The same is true for additional languages.

     

    - Sam from the video

  • User profile image
    Omar

    I saw you changed the query at run time. Do you have any repo that we can check to see how yo are doing that. I know the Azure sdk... but it could be nice to see a real example.
    Thank you very much!

  • User profile image
    Adam

    Okay, I give. I have been trying to get ST_WHILE to work for the last 4 hours without success. I have two test files as follows:

    Test File 1 Structure:
    [{
    "id": "a2b8bcd8-ff79-4bb7-a86f-615556104c1f",
    "mechanism": "geo",
    "geometry": {
    "type": "Point",
    "coordinates": [15.0, 15.0]
    }
    }]

    Test File 2 Structure:
    [{
    "geometry":{
    "type": "Polygon",
    "coordinates": [[10.0, 10.0], [20.0, 10.0], [20.0, 20.0], [10.0, 20.0], [10.0, 10.0]]
    }
    }]

    Test File 1 represents data from an event hub. Test File 2 represents static reference data. I am running the following query:
    select st_within(eh.geometry, r.geometry) from eventhub eh join reference r on eh.mechanism='geo'

    The result says this:
    GeJSON polygon must contain field "type" with value "Polygon" and field "coordinates" with a list of no less than 4 point type elements, first point must be equal to last point. Values cannot be null.

    I have tried every variation known to mankind on the files but the result is always the same. I can get ST_WHILE to work if I manually use CreatePoint and CreatePolygon but that is not a workable solution. Do you all have a bug, or is there something wrong with my file structures above?

    Thanks for any help.

  • User profile image
    Steve

    Adam - you need an extra set of square brackets round your coordinates. Try this:-

    [[[10.0, 10.0], [20.0, 10.0], [20.0, 20.0], [10.0, 20.0], [10.0, 10.0]]]

Add Your 2 Cents