coordsFromBbox enlarge width and height twice
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- web-dev
Research direction
Start in index.js at lines 42-43 and 50-51, where the issue identifies the initial size calculation and the second enlargement. Reproduce the two console.log examples, then verify that coordsFromBbox no longer doubles the width and height and agrees with coordsFromCenter for the same bounds.
Written by the indexing model from the issue text.
Description
The width calculated by coordsFromBbox() is base_width * scale *scale, which should be base_width * scale. Let check out:
console.log(abaculus.coordsFromBbox(0, 2, [-180, -85.0511, 180, 85.0511], 19000, 256))
console.log(abaculus.coordsFromCenter(0, 2, {x: 0, y: 0, w: 256, h: 256}, 19000, 256))
What I got is :
{ w: 1024, h: 1024, x: 256, y: 256 }
{ w: 512, h: 512, x: 256, y: 256 }
We have already get the right size from here: https://github.com/mapbox/abaculus/blob/master/index.js#L42-L43
But we enlarged the size again at here: https://github.com/mapbox/abaculus/blob/master/index.js#L50-L51
And x: 256, y: 256 is definitely not the center of w: 1024, h: 1024, which proves the results calculated by coordsFromBbox is wrong.
If this problem is confirmed. I will send a PR.
- Dominant language
- JavaScript
- Stars
- 128
- Forks
- 33
- 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/abaculus
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Place markersOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
vector.pbf blendingOpen
Difficulty 1/5 Under an hour Newbie friendliness 55/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CircuitVerse/CircuitVerse#7967 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CopilotKit/aimock#491 ·
Maintainers usually reply within 1 day
-
cvss-severity:high devguard l3montree-cybersecurity/.../devguard-documentation pkg:devguard/l3montree-c.../devguard-documentation risk:low state:open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
l3montree-dev/devguard-documentation#338 · 1 comment ·
-
bug runtime spec compliance
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
frostney/GocciaScript#1413 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
keyxmakerx/Chronicle#967 ·
Maintainers usually reply within 1 day