How To Add real time analytics to your Mapify App

Monitoring and analytics

Maps

February 28, 2024

5

min video

First things first, we will be using New York City's open data. We've already set up a NYC demo for you to explore. Make sure to check out that video to get a feel of what we'll be working with.

Multiple events are being logged in real-time in this NYC map, such as road works or closures. It can be overwhelming to keep track of everything that is going on. Therefore, we’re going to streamline the process by aggregating and counting these events.

Step one, we’ll use Mapify to send all this ongoing data to a Dataset using Mapify Workflows and a Bulk Dataset Sink node. This node will be saving all data on this Dataset.

To aggregate the numbers, we will need a different type of node, a Transformer type using a JMESPath expression. Let’s call it “Calculate Totals” and create a JMESPath expression that will return us a total count of events according to the data we’re receiving. Apply and save. Also save this new workflow.

Now, to make use of the total count of events being calculated by the workflow, we will need to visit the variables tab. We already have one variable ready to go named “Road Closures”, but starting fresh… we will create another one named “Accidents and Incidents”, and select type “Number” and “Global” and save.

Back in our workflow draft, we'll add a node to manage these variables. In the Transformer section, look for “Manage workflow variables”. Name it “Set Road Closures”, the variable is “Road Closures”, operation is “getAndSet” and finally the value of the variable. Look for it here… and here it is: “Calculate_totals_result”. Next, we will do the same, but for the other variable we created “Accidents and Incidents”. In the end, save the workflows.

In practice, this means that the workflow is going to be receiving the events from the open data API, it will calculate the total values using the JMESPath, set the values for the variables and save them in the Dataset.

It’s time to visualize our insights, and for that we need to create the widgets. Jump into the “Widgets” tab, create a new widget, type “scorecard”, select an icon and associate a workflow and variable. Additionally, Mapify let’s you customize the colours of the widget according to the values, kinda like a dashboard. For example, less than 50, green, between 50 and 100, yellow, and greater than 100, red. And Save. You got it! We do the same for the other variable.

Make sure that in your app settings, the widgets are enabled. Go to the widgets tab here in the Apps and select the Widgets you want. That’s it.

Refresh your Mapify app and witness the no-code magic unfold. You'll see the aggregated counts displayed: 229 road closures and 8 accidents or incidents in New York City, updated in real-time.

Map your buildings today using a simple, low-code SaaS platform. Try Mapify now for free, and start building your own location intelligence apps.