[Tilesathome] www down?

Frederik Ramm frederik at remote.org
Sat May 26 11:02:35 BST 2007


Hi,

>>> Yeah, pretty sure.  Don't forget it does a blank-tile search in  
>>> the database,
>>> if a tile doesn't exist.  so if you make the tile exist, it goes  
>>> faster.
>
> Why not just modify the 404 so that it puts down a png file with
> "blank land" / "404 sea" when someone view that square. That will fill
> up the tiles pretty quick. You can even use hard links so that only
> every 1000th blank png takes up actual disk space.

I must admit that I haven't followed the different suggestions that  
popped up too closely, so let me offer just a little bit of "brain  
food" so that everyone can check their own ideas for themselves ;-)

The formula for finding out how many tiles you need on a zoom level  
"z" to cover the world is:

I.    4**z

and the total number of tiles in all zoom levels from level 0 to  
level z is

II.    4**(z+1) / 3

the number of tiles up to zoom level z2 contained in one tile of zoom  
level z1 is (roughly)

III.   4**(z2-z1+1) / 3

and a few assumptions:

IV.   world surface is 70% sea
V.  empty tile is 70 bytes
VI. 99% of the world's land surface is currently not covered by OSM  
data, so existing tiles with content are irrelevant for this computation

 From these formulae you can derive a number of interesting things:

* A full layer with all tiles for every zoom level up to z17 will  
need about 23 billiion (2.29E10) tiles.
* 16 billion of those will be sea tiles
* If you were to store empty (69 byte) tiles for these sea tiles, you  
will need about 1.1 Terabytes for these sea tiles alone, not counting  
(a) space for directory entries (b) inodes (c) inefficiencies due  
hard disk space allocation (clusters)
* If you make a file only for every 1000th sea tile and hardlink the  
rest, you still need 1.1 Gigabytes of empty tiles, and you still need  
16 billion directory entiries
* If you store all sea tiles in the database, obviously, you will  
need 16 billion records in that table (or 7 billion if you store land  
tiles); the empty tile table consists of 7 integer values, plus keys  
required etc., assume 50 bytes per record and you end up with 800  
Gigagbytes (350 Gig if you store land tiles) for the database table  
alone

 From this it should be rather obvious that we do not want to store  
*anything* on a level-17 depth if it can be avoided.

On levels 0-12 combined, we have a total of about 22 million tiles  
for the whole world, of which about 6.7 million will be land tiles.  
Now this is a figure one could deal with - 6.7 million rows of 50  
bytes each is about 350 Megabytes in an SQL table. If we employ  
strict recursion (i.e. "if a level-5 tile is fully on land, then do  
not store any of the tiles contained therein explicitly"), we can get  
that figure down from 6.7 million to a small six-digit figure (I  
computed it once but forgot the exact number), but that would of  
course mean a performance penalty when retrieving data.

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00.09' E008°23.33'






More information about the Tilesathome mailing list