ThinkGeo.com    |     Documentation    |     Premium Support

Cluster Problem

Hello
I have a Problem with the cluster features in my app,they seem to have a wrong way of clustering things as it clusters features that are in a larger distance and leave outside of the cluster feature others that are in smalller distance.


I have two features here the one in the blue circle is much closer to the cluster ball than the red one,but when i zoom out:

The one than is closer is still unclustered while the other that is far from the cluster ball is clustered.

Also sometimes two cluster features are so close that they should cluster together in one feature but they are still seperate,like in the blue circle in this picture.


How is this possible? and is there a way to fix it and how?

Hi Mario,

For “cluster” function it need to find a center feature or limit a base area, if you only adjust the distance between each features, in many scenario you will found nearly all the features are included in the same group.

In our logic we cluster the features by cells, so in certain scenario if one feature is on the edge of one cell, maybe you will see the other feature is closer to it but is not in same group.

Our ClusterPointStyle class have two properties: cellSize and minimumFeaturesPerCellToCluster, you can modify the value to get better result in your scenario.

Wish that’s helpful.

Regards,

Ethan

Is there a way to change the point which around will appear the cluster ball? something other than the center of gravity of the features that are clustered?
Thanks!

Hi Mario,

We cannot manual modify the cluster feature position, it will be placed in the center point of each cell which is decided by the cellSize and minimumFeaturesPerCellToCluster.

If the default behavior is not you need, you can override the DrawCore function of ClusterPointStyle to build custom logic, if you met any detail question when you tried to implement that please let us know.

Regards,

Ethan

according to the ClusterPointStyle class the feature is drawn in the center of gravity of the features it clusters
https://wiki.thinkgeo.com/wiki/source_code_serviceseditionsample_clusterpointstyle_cs_090918.zip
If i try to override Drawcore of the class how can i change the point of the feature to place it in the center of the cell ,and not the center of gravity of the features?

Hi Mario,

I think this code is what you need: cell.BoundingBox.GetCenterPoint();

I hope that’s able to help you.

Regards,

Ethan