supercluster icon indicating copy to clipboard operation
supercluster copied to clipboard

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

Open luixo opened this issue 2 years ago • 5 comments

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.

luixo avatar Apr 18 '23 14:04 luixo

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).

mourner avatar Apr 25 '23 16:04 mourner

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?

luixo avatar May 22 '23 16:05 luixo

@luixo yes, I think we should cap internally.

mourner avatar May 22 '23 16:05 mourner

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?

luixo avatar Jul 26 '23 22:07 luixo

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?

@luixo same here, when adding a mark with same coordinates, any zoom above 30 throwns "no cluster with specifier id"

jgabriel98 avatar Aug 07 '24 14:08 jgabriel98