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

Feature request: "quadkey" calculations #16

Open
barryrowlingson opened this issue Apr 27, 2020 · 0 comments
Open

Feature request: "quadkey" calculations #16

barryrowlingson opened this issue Apr 27, 2020 · 0 comments

Comments

@barryrowlingson
Copy link

Feature Request

Some slippy map services (Bing maps in particular) use "quadkeys", a way of recursively partitioning the tile space. At the first zoom level, quadkey "0" is the top left tile, "1" is the top right, and "2" and "3" are the lower two. At the second zoom level, you add an extra digit to show which quarter of the higher level quarter you are in. So a quadkey of 112031 is zoom level 6. Details here https://docs.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system

I've seen a couple of questions asking about quadkeys on SO recently, and found a python library with computations for them, and wrote an R function in response. https://gis.stackexchange.com/questions/359507/how-to-convert-quadkey-into-tiles-coordinates/359636#359636

So now i can go from quadkey to lat-long using:

> t = quadkey_to_tile("12022132301033")
> slippymath::tilenum_to_lonlat(t$x, t$y, t$z)
$lon
[1] 9.382324

$lat
[1] 45.53714

Would this be suitable functionality for slippymath?

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

1 participant