Is it possible to show the summation of the data of clustered points like the Point Cluster sample with Azure Maps?

Kent010341 231 Reputation points
2022-03-23T07:06:43.097+00:00

The sample I mentioned is Point Clusters in Bubble Layer.

For example, assuming I have data from a system that collects how many alarms are at several sites separated in a country.
Those data contain where they are (longitude and latitude), and the number of alarms of each site.

What I want is showing each point (at its location) with its alarm count on it just like the clustered point in the sample, and it can also be clustered to a single point with the summation of alarms of these clustered points on it when I zoom out.

Is the sample able to meet this requirement?

If so, I wonder if there's a sample of it.
And if not, is there any sample that meets this requirement?

Thanks.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
835 questions
0 comments No comments
{count} votes

Accepted answer
  1. rbrundritt 20,921 Reputation points Microsoft Employee Moderator
    2022-03-23T15:32:52.827+00:00

    If you are fine with the points in the cluster being determined by the map based on zoom level, then yes, this would work for you. Note that if you wanted the cluster all sensors limited to say an individual building then that would be custom clustering logic that doesn't exist in the map and you would need to do some preprocessing of the data to support that. Here is a sample for cluster aggregates: https://samples.azuremaps.com/?sample=cluster-aggregates

    Also good to know, is "cluster aggregates" supports addition, multiplication, min, and max expressions. For more advanced calculations you can break your calculations into parts and calculate aggregates of parts and then in the cluster layer, have a style expression that combines these separate clustered calculated values into a more complex formula. For example, if you wanted to calculate the size of range of values in a cluster, you can have two separate aggregate calculations, one to get the min, the other the max. Then in layers style options, you can combine these in your style expression by subtracting the max by the min to get the difference between min and max.

    Documentation for cluster aggregates: https://learn.microsoft.com/en-us/azure/azure-maps/clustering-point-data-web-sdk#aggregating-data-in-clusters

    If you can provide an example of the properties one of your features will contain and what you are looking to calculate (i.e. total sum of X), I'd be happy to help you build the expression.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.