Missing points when bounds are scoped to the extent of points
Nobody has claimed this yet.
- #261 by @spokodev — closed without merging
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- data
Research direction
Start with the linked CodeSandbox reproduction and trace how Supercluster handles the bbox whose southwest and northeast corners are point coordinates. Inspect the bbox query and clustering behavior around boundary points, then add a regression check showing that the reproduced points are consistently accounted for.
Written by the indexing model from the issue text.
Description
I've noticed this (inconsistently) on several occasions: when the bounds that are used to create the bbox sent to Supercluster are created by iterating over them and extending the bounds to each point's geometry, sometimes points get left out. I have a working CodeSandbox to reproduce this: https://codesandbox.io/s/supercluster-points-8kqttt.
In this example, the points are:
const features = [
{
type: "Feature",
properties: {
isUser: true,
userId: "5"
},
geometry: {
type: "Point",
coordinates: [-123.211605, 43.972615]
}
},
{
type: "Feature",
properties: {
isUser: true,
userId: "3"
},
geometry: {
type: "Point",
coordinates: [-123.245515, 43.9150233333333]
}
},
{
type: "Feature",
properties: {
isUser: true,
userId: "16"
},
geometry: {
type: "Point",
coordinates: [-123.192528333333, 44.0307166666667]
}
},
{
type: "Feature",
properties: {
state: "old",
userId: "8"
},
geometry: {
type: "Point",
coordinates: [-123.194573333333, 44.0107]
}
}
];
The bbox that gets passed to supercluster ends up being [-123.245515, 43.9150233333333, -123.192528333333, 44.0307166666667]. The point that gets left out (ie not contained within a cluster, but not returned as an individual point either) has the coordinates [-123.245515, 43.9150233333333], which represents the southwest corner of the bbox. It would make more sense to me if both that and the point with userId: "16" were both left out, since point 16 represents the northeast corner of the bbox, but point 16 is consistently returned.
This is definitely an edge case (literally, on the edge of the bounding box, get it...), but I'm curious to understand what's going on.
- Dominant language
- JavaScript
- Stars
- 2.4k
- Forks
- 303
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/supercluster
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mapbox/supercluster#265 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mapbox/supercluster#254 · 2 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
mapbox/supercluster#218 · 4 comments ·
-
Nested geoJson properties are copied by referencePossibly taken @mrkwanzaa claimed this 1337 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
mapbox/supercluster#215 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mapbox/supercluster#211 · 2 comments ·
All issues in mapbox/supercluster
Similar issues
-
enhancement p2 setup
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Query Log shows "Upstream" for CNAME cloaking, schedule, NXDOMAIN hijack and response IP blocksOpenbug good first issue query-log web
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
ferrous-networking/ferrous-dns#326 ·
Maintainers usually reply within 1 day
-
type: typos
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Ylianst/MeshCentral#8294 ·
Maintainers usually reply within 1 day