Unexpected scale behavior for large areas that intersect WGS84 boundaries
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- data
Research direction
Start with the transformScale entry point and the supplied reproduction, then inspect how bbox and bboxPolygon process its output near WGS84 boundaries. Reproduce the Europe example and compare other centers and scale factors; done means scaling is clipped to WGS84 without warping or unexpected boundary inversion.
Written by the indexing model from the issue text.
Description
I tried to double the bounding box of Europe using turf and I get this weird result:
- Gist: https://gist.github.com/anonymous/5c524c6f302d07ba32674f7b7f2420d0
- Code to reproduce:
const Europe = /* See GeoJSON */;
const doubleEurope = transformScale(Europe,2);
const boundsOfDoubleEurope = bboxPolygon(bbox(transformScale(Europe, 2)));
The gist is quite self-explanatory.
The wrong result of transformScale clearly affects everything else. What I don't get is why it warps the resulting rectangle, extending its northern side much more than twice (or perhaps it is just inverting some sign).
Other similar odd results:
- using a different center (e.g. 'ne', 'sw') results in other wrong figures
- using scale factors higher than 2 results in even stranger figures.
I would expect the scaled figured to be clipped with WGS84 properly, and to never warp.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Contributor 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 Turfjs/turf
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
@turf/boolean-contains
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·