What if zoom is 0 and 32?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.1k
- Forks
- 430
- PR merge metrics
- No merged PRs in 30d
Description
In epsg3857totile function https://github.com/mapbox/tippecanoe/blob/master/projection.cpp#L77-L83 :
*x = ix * (1LL << 31) / 6378137.0 / M_PI + (1LL << 31);
*y = ((1LL << 32) - 1) - (iy * (1LL << 31) / 6378137.0 / M_PI + (1LL << 31));
if (zoom != 0) {
*x >>= (32 - zoom);
*y >>= (32 - zoom);
}
When zoom = 0, *x would be ix * (1LL << 31) / 6378137.0 / M_PI + (1LL << 31);
When zoom=32, *x also be ix * (1LL << 31) / 6378137.0 / M_PI + (1LL << 31);
I don not understand why skip shift when zoom = 0? Maybe it is a bug. tiletoepsg3857 function also have some problem.
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.
Research direction
Read projection.cpp around epsg3857totile, then inspect the related tiletoepsg3857 function mentioned in the issue. Trace the zoom 0 and zoom 32 paths and verify whether their shifts are intended or incorrect. Done means the behavior is clarified and any needed correction is covered for both conversion directions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100