Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tileToBBOX output question #43

Open
Momut1 opened this issue Mar 31, 2022 · 2 comments
Open

tileToBBOX output question #43

Momut1 opened this issue Mar 31, 2022 · 2 comments

Comments

@Momut1
Copy link

Momut1 commented Mar 31, 2022

Hi there, I'm using the tileToBBOX function to extract the bbox of a tile. Easy enough. My issue comes with reading the output. Let's say I have a point at coordinates Latitude 33.43386; Longitude 8.561223. Converting this to slippy map tilenames (https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) x and y gives me 34326 and 26303 respectively at zoom level 16. When I run tileToBBOX i get the output 8.55835 -90.00000 1705.58899 33.43603 . I can see that the first and last coordinate make sense bearing in mind the original long-lat I've provided, but the middle values threw me off. I am a bit lost - is the second digit the angle of the tile, and the third one - the length of each side of the square? Can you provide some context as to what these two number mean and in general about the output of the function. Thank you!

@Burstaholic
Copy link

This is just a math error in the code, use something else like SphericalMercator

@laem
Copy link

laem commented Aug 4, 2024

Can confirm this, use https://www.npmjs.com/package/@mapbox/sphericalmercator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants