[ka-Map-users] Interesting Problem for precaching

Stephen Woodbridge woodbri at swoodbridge.com
Fri Jun 30 11:05:16 EDT 2006

Hi Paul, et al,

When you precache you typically generate a rectangluar area that 
contains a lot of ocean tiles, ie: tiles that contain no drawn objects 
and are only the background color. These are typically in the ballpark 
of about 100+- bytes in size. So we don't care right?


These actually take up one disk allocation unit which is 4096 bytes (on 
linux by default). It would significantly reduce the disk usage for 
cached tiles if we could have mapserver detect that no objects were 
drawn on a metatile and then just toss the metatile and don't generate 
those tiles. Based on my current mapfile of US and Canada this would 
probably account for about 1/3 of the tiles in the cache once you 
eliminate most of the Pacific, Atlantic, Arctic and Caribean Oceans and 
Hudson Bay.

Any thoughts on how we might be able to do this?
Is there a way to get mapscript to return a flag like:

    $img = $oMap->draw();
    if ($img->didDrawObjects()) {
       // split the meta tile
    } else {
       // mark the metatile as empty

such it would return ture/false if it draws any objects.

I would probably limit this to precache but it might be possible to mark 
the tile as empty in the meta directory and return a default common 
background tile via tile.php.


More information about the ka-Map-users mailing list