supercluster icon indicating copy to clipboard operation
supercluster copied to clipboard

Dynamically changing points

Open 1ec5 opened this issue 9 years ago • 13 comments
trafficstars

Currently, if a point is added, removed, or moved, you have to recluster all the points, which can be expensive. For mapbox/mapbox-gl-native#5814, it should be possible to update the clustering to account for dynamically changing points.

/cc @mourner

1ec5 avatar Aug 12 '16 15:08 1ec5

I am considering to develop a hybrid clustering layer, combining supercluster for static markers and prunecluster for dynamic markers. But if supercluster supports dynamic markers out of the box with good performances, I probably shouldn't do it.

How likely do you think supercluster will support this feature in the next two years ?

fungiboletus avatar Sep 27 '16 20:09 fungiboletus

It's likely, although will probably come with performance costs. Supercluster used to be rbush-based and was 2.3 times slower: https://github.com/mapbox/supercluster/pull/5

mourner avatar Sep 27 '16 20:09 mourner

Will you update kdbush to support dynamic points with a performance cost, or have some kind of hybrid approach as well ?

fungiboletus avatar Sep 27 '16 20:09 fungiboletus

KDBush algorithm is static by design. I'd have to roll back to RBush.

mourner avatar Sep 27 '16 20:09 mourner

I guess this is not as critical as it may seem, because you rarely need to dynamically change an already huge dataset on the client. Typically you either have a large static dataset, or a small dynamic one. Since Supercluster is extremely fast, it's usually fast enough to regenerate the whole clustering in the dynamic case.

mourner avatar Jan 19 '17 17:01 mourner

For mapbox/mapbox-gl-native#5814, the highly dynamic point annotation layer could be small or it could be large – we’ve seen plenty of examples of either in the iOS SDK. But I agree that we should try to make point annotation clustering work in the first place before worrying about this optimization. Do you think the optimization proposed in https://github.com/mapbox/mapbox-gl-native/issues/5814#issuecomment-250019778 would suffice in the meantime?

1ec5 avatar Jan 19 '17 19:01 1ec5

Hi,

I'm considering Supercluster for my backend and I need to be able to add new points to the clusters. Is there a way to add points efficiently to the clusters without rebuilding it?

I'm expecting to have more than 500k points in my DB and I can't imagine loading them everytime a new one is added. Can you suggest an approach?

Thanks

viktorstaikov avatar Aug 23 '18 15:08 viktorstaikov

For mapbox/mapbox-gl-native#5814, the highly dynamic point annotation layer could be small or it could be large – we’ve seen plenty of examples of either in the iOS SDK. But I agree that we should try to make point annotation clustering work in the first place before worrying about this optimization. Do you think the optimization proposed in mapbox/mapbox-gl-native#5814 (comment) would suffice in the meantime?

i hope it will be realize,did you guys try to do it?or meet some problems?

XiiiRuth avatar Jan 18 '19 03:01 XiiiRuth

I guess this is not as critical as it may seem, because you rarely need to dynamically change an already huge dataset on the client. Typically you either have a large static dataset, or a small dynamic one. Since Supercluster is extremely fast, it's usually fast enough to regenerate the whole clustering in the dynam

I guess this is not as critical as it may seem, because you rarely need to dynamically change an already huge dataset on the client. Typically you either have a large static dataset, or a small dynamic one. Since Supercluster is extremely fast, it's usually fast enough to regenerate the whole clustering in the dynamic case.

well,when have a large static dataset,it will be waiting for many seconds,a dynamicallu feature may be useful

XiiiRuth avatar Jan 18 '19 03:01 XiiiRuth

Are there any updates on this? I've been trying to use this through react-native-super-cluster but every change made causes quite a big delay. Anything that can be done?

RWOverdijk avatar Mar 06 '19 13:03 RWOverdijk

Not at the moment unfortunately.

mourner avatar Mar 06 '19 14:03 mourner

Ahw... Ah well. Thanks :)

RWOverdijk avatar Mar 06 '19 16:03 RWOverdijk

Supercluster uses kd bush to generate index, so it do not support dynamic indexing data

StuRuby avatar Apr 01 '19 17:04 StuRuby