tilemillmbtiles

Why do I need so many map tiles to serve a map?


It's my understanding that each map tile is a 256x256 pixel image. So... if I'm looking at a 1400 by 1400 pixel screen... that's roughly 36 tiles to cover an entire screen (6tiles by 6tiles)... and let's say I want my map at its highest zoom level to have... 20 screens worth of area on a map... that's 700 tiles for that zoom level, and on down from there for the more zoomed-out levels. So at most this is like 10k tiles.

I'm making a map right now of the city of Portland, Oregon... and I just exported my map tiles and converted them to pngs... and there's 1 MILLION files. What??!?! The highest zoom level I have is 18, and the lowest is 10.... so somehow these tiles are getting miniaturized, but I'm not sure why.

What am I missing here?


Solution

  • What you're running into is exponentiation. At each deeper zoom level, each tile is divided into 4 parts, so you have 4 times as many tiles total. And this compounds between zoom levels: so if you have 1 tile at z5, then that same geographical area is represented by 4*4*4*4=256 tiles at z10, or 65,536 tiles at z15.

    If you're looking at a map of Portland at z10, which needs around 16 tiles to cover the screen, that area is represented by 16*4^8 tiles, which is, indeed, 1,048,576 tiles.