top of page

Geolocation in Fabric Real Time Intelligence

  • Writer: azurecoder
    azurecoder
  • May 27, 2024
  • 3 min read

Lots of announcements at Build 2024. It's easy to miss the significant ones in lieu of the noise of the multitude of stuff.


I've been using Real Time Hub for a while now in Fabric. It's a boon for people that are not me and Elastacloud and need basic features to ingest Streams into Fabric. It's far from complete over the complex building blocks of Spark Streaming and Stream Analytics but it does have some powerful abstractions which make real time less scary.


I'm going to spend some time going through a few posts which will highlight some of these updates and their relevance. For now I'm struggling typing as the cat successfully swiped at my finger and every right-hand tap is a killer.


We recently built out two real-time solutions around fleet management which allow data from lots of vehicles to stream into Fabric via EventStreams and then in Kusto. One of the things that becomes very possible is to build out a real-time filter on a the Kusto Dashboard map.


Kusto Dashboard maps can be a little flaky. There are some caching issues which put the vehicle fleet off the coast of Somalia on the odd occasion. A key here is to ensure that the polygons aren't too complicated. We can build these ourselves though. In this instance I did this using geojson.io which allows us to build out polygons on the map and then export them as GeoJSON. The image shows how to build out polygons with fewer edges than you would find in a shape file.

What this means is that you can build out Kusto functions to ensure that you can filter regions or areas on a map.


The following KQL function takes the GeoJSON you can see in the image and allow lats and longs to be passed into the function to filter down on whether a point is in Scotland. This is done through the geo_point_in_polygon inbuilt function.

.create function IsInScotlandRegion(latitude:real, longitude:real)
{
    let GreaterScotlandPolygon = dynamic({
    "type": "Polygon",
    "coordinates": [
          [
            [
              -2.082081594279913,
              55.8157714841559
            ],
            [
              -0.22550176287018076,
              60.997982605241475
            ],
            [
              -1.3863838168968527,
              61.06990266611555
            ],
            [
              -9.78654990948121,
              57.951587901512
            ],
            [
              -6.8996400476373765,
              55.85102604688106
            ],
            [
              -4.851855779088027,
              54.51361966314133
            ],
            [
              -3.7140797989307544,
              54.58587400300186
            ],
            [
              -2.2771484554597237,
              55.507485850078666
            ],
            [
              -2.3509185441140232,
              55.65595738167232
            ],
            [
              -2.082081594279913,
              55.8157714841559
            ]
          ]
        ]
    });
    geo_point_in_polygon(latitude, longitude, GreaterScotlandPolygon)
}

We should just then be able to add a dropdown. Sorry for the crappy graphic. I'm still getting used to a mac. Using Seashore for blurs. Not feeling it though.



The beautiful thing about this now is that you can then just build out filters into the map to check all the points in Scotland. Grrr, mac, so rubbish. Will repost with proper readable Gaussian filters for now you get the gist.




Easy thing then is to build out a query linking the filter dropdown and the map together via the regional functions you've created. In this query the first where clause filters what the map will show. We had outliers in ours which gave us an extended map. You can either get rid of those from the dataset or from the mapset. I chose the latter. This focuses us on the UK. The second simply ensures that the point gets labelled in the


| where latitude >= 50.0 and latitude <= 58 and longitude >= -10.0 and longitude <= 2.0 
| extend AllRegions = case(IsInEastAngliaRegion(longitude, latitude), "East Anglia",                         IsInEastMidlandsRegion(longitude, latitude), "East Midlands",                         IsInLondonRegion(longitude, latitude), "Greater London",                         IsInNorthWestRegion(longitude, latitude), "North West",                         IsInNorthEastRegion(longitude, latitude), "North East",                         IsInNorthernIrelandRegion(longitude, latitude), "Northern Ireland",                          IsInScotlandRegion(longitude, latitude), "Scotland",                          IsInSouthEastRegion(longitude, latitude), "South East",                         IsInSouthWestRegion(longitude, latitude), "South West",                         IsInWalesRegion(longitude, latitude), "Wales",                         IsInYorkshireAndHumberRegion(longitude, latitude), "Yorkshire and Humber",                         "Other")

Real Time Intelligence will be a panacea for those wanting to bring real-time behaviours into Fabric. You still need to be innovative though. As we go through our journey and do the piece of innovation like this I'll push it back out for comment and reflection.


For now I'll nurse my finger and whimper a little. I noticed that I haven't blogged for about a year. Generally for the last 12 months I've been miserable but I'm back on form and enjoying solving problems for our customers so keep reading my musings if you want to hear all about it.


BTW, thanks to Amanda and Darren for their amazing contributions over the past few weeks. Happy trails.


 
 
 

Recent Posts

See All
The new new normal

Well the number of people looking for work in the cloud and data sector has now shot up as everyone adjusts their forecast expectations...

 
 
 

13 Comments


rahumezuv
Apr 08

다른 서비스와 비교했을 때 처리 시간이 확실히 빠른 편이었습니다. 문의 후 바로 응답을 받을 수 있었고, 상품권현금화 절차가 중간에 투명하게 안내되어 신뢰를 느꼈습니다. 전반적으로 안정적인 운영이 돋보입니다.

Like

rahumezuv
Apr 08

처음 접했을 때는 복잡할 것 같았지만 실제로는 핀파니 이용 과정이 간단해서 쉽게 사용할 수 있었습니다. 사용자 친화적인 점이 인상적이었습니다.


Like

lyrucym
Apr 03

오랜 시간 업무로 뭉친 근육을 풀기 위해 받은 출장마사지 효과가 확실했습니다. 몸이 가벼워지고 피로가 줄어들었습니다.


Like

lyrucym
Apr 03

사용자 중심의 편리한 기능이 많아 누구나 쉽게 사용할 수 있으며 상품권매입 활용하면 더욱 편리한 사용 경험을 제공받을 수 있다.

Like

lyrucym
Apr 01

처음에는 조금 망설였지만 결과적으로 매우 만족했습니다. 생각보다 훨씬 전문적이고 출장마사지 체계적이었어요. 피로 회복에 큰 도움이 됐습니다.


Like

07590333990

©2019 by Richard Conway. Proudly created with Wix.com

bottom of page