Skip to content

Conversation

@Duan971231
Copy link
Contributor

fixes: #13062

Based on this issue, I have reviewed the source code of ElementCluster.js and found that using kdBush after upgrading from v3.0.0 to v4.0.2, continue use Uint32Array will result in negative numbers being represented as 2 ^ 32. When using index. range in the code, there will be no expected results.

If not filled in here, the default will still be Float64Array

Expected adoption

@github-actions
Copy link

Thank you for the pull request, @Duan971231!

✅ We can confirm we have a CLA on file for you.

@Duan971231 Duan971231 changed the title Kd bush branch EntityCluster BUG Resolve the issue of incomplete aggregation. Nov 29, 2025
@Duan971231 Duan971231 mentioned this pull request Dec 5, 2025
@javagl
Copy link
Contributor

javagl commented Jan 8, 2026

@lukemckinstry (You did the initial triage on the issue) : This PR fixes the issue, which also affects the currently deployed 'Clustering' sandcastle.

Here is a comparison of the current main state, and the state of this PR:

Cesium Clustering PR 13064

The state of this PR is the right one, literally.

@lukemckinstry lukemckinstry self-requested a review January 13, 2026 19:09
Copy link
Contributor

@lukemckinstry lukemckinstry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR and apologies for the slow follow up.
I see the improvement clearly in the example linked in #13062.
I actually do not see a difference between the current prod clustering sandcastle and this branch (I am unable to reproduce the left and right states above), but I also do not see any regressions and clustering appears to be working as expected.

@javagl
Copy link
Contributor

javagl commented Jan 13, 2026

I actually do not see a difference between the current prod clustering sandcastle and this branch

A somewhat reliable way for reproducing the issue in https://sandcastle.cesium.com/index.html?id=clustering is to zoom in a bit (to the USA), move the westcoast just out of view, and then drag right, moving the westcoast back into the view. The newly appearing/visible cities/points will not be clustered (only when dragging even further).

@lukemckinstry
Copy link
Contributor

Thanks @javagl that makes it very clear so I see the improvement now.
@Duan971231 are you able to add a changelog entry for this PR before we merge?

@Duan971231
Copy link
Contributor Author

@lukemckinstry Hello, which changelog entry should I change? the CHANGELOG.md in the code hasn't been updated for quite some time.

@javagl
Copy link
Contributor

javagl commented Jan 14, 2026

The file to be modified is https://github.com/CesiumGS/cesium/blob/main/CHANGES.md - it's just about adding a line similar to the one that was added at 6a6627f , saying something like

- Fixed a bug where entities have not been clustered correctly [#13064](https://github.com/CesiumGS/cesium/pull/13064)

(adjust the wording as you see fit)

@Duan971231
Copy link
Contributor Author

@javagl Okay, the code has been submitted

@lukemckinstry lukemckinstry added this pull request to the merge queue Jan 14, 2026
Merged via the queue into CesiumGS:main with commit 8a00879 Jan 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EntityCluster BUG

3 participants