Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No cluster with the specified id thrown (originId is too high) #221

Open
luixo opened this issue Apr 18, 2023 · 4 comments
Open

No cluster with the specified id thrown (originId is too high) #221

luixo opened this issue Apr 18, 2023 · 4 comments
Labels

Comments

@luixo
Copy link

luixo commented Apr 18, 2023

Hello,
I'm using supercluster and found that on certain point sets it throws given error.

The example set can be found on pastebin.
Bounds and zoom I have:

"bounds": [
    37.41012735664174,
    55.62057887866567,
    37.82486124336097,
    55.879882425496476
],
"zoom": 10

The options of supercluster are:

"radius": 40,
"maxZoom": 999

Digging a little bit inside I found that error is originated because we're trying to index an array with 5 elements (index.points) with originId === 324 which was calculated from clusterId === 16642 and this.points.length === 6266.
I'm not familiar with library code enough to dig deeper.

Hope that helps, let me know if you need more info.

@mourner
Copy link
Member

mourner commented Apr 25, 2023

Can you share a full example, e.g. on JSFiddle? This is likely caused by the 999 maxZoom — Supercluster isn't really designed to work with zooms over 32 (and even with that you'd get atomic-level precision on a map).

@luixo
Copy link
Author

luixo commented May 22, 2023

I changed maxZoom to a maximum zoom available in mapboxgl and it worked like a charm.
If the design fails for some reason on zooms over 32 - should it be capped by that number in the library?

@mourner
Copy link
Member

mourner commented May 22, 2023

@luixo yes, I think we should cap internally.

@luixo
Copy link
Author

luixo commented Jul 26, 2023

Experimentally I found zoom level of 30 being the maximum before this error is thrown on my data.
Do you have an idea why exactly that number?
Should I open a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants