mapbox / mbtiles-spec

specification documents for the MBTiles tileset format
https://www.mapbox.com/help/an-open-platform/#mbtiles
Other
612 stars 99 forks source link

zxy from zoom_level, tile_column, tile_row in mbtiles file #48

Closed divya1c closed 7 years ago

divya1c commented 7 years ago

Hi!

I want to get all the zxy of tiles present. So, I opened my mbtiles file in an sqlite3 viewer. I see that my zoom_level and tile_column values are the same as z and x in my mapbox-gl front end requests. But, my tile_row is very different from my y. How do I get my y from the tile_row?

Thanks :)

divya1c commented 7 years ago

I found the answer in tippecanoe's readme. I'm using tippecanoe-enumerate to list all tiles.

e-n-f commented 7 years ago

You can also get the ZXY-style y coordinate with

select zoom_level, tile_column, (1 << zoom_level) - 1 - tile_row from tiles;