Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

What is the level of compression gained caching mod_tile's larger metatile instead of 256 by 256 .png tiles?

I am trying to determine the extra cost of storage resources for pre-rendering some set of .png tiles, which will be served as static files.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted
+50

To elaborate on johanvdw's answer: Files stored on hard drives use a minimum amount of storage, and the amount of storage they use is incremental and based on the formatted block size. The default windows block size is 4096 bytes, meaning that each file uses at least 4096 bytes of storage, and the amount of space used increments based on the block size. Every time you double the size of your tile width and height (i.e. go from 256x256 to 512x512), you reduce the amount of required tiles by a factor of 4 (or very close to 4 in any case). So if you reduce the amount of tiles by 4, you will reduce the amount of potentially wasted bytes by 3 x block size (you could still waste up to 4096 bytes per 512x512 tile). In practice, it is difficult to predict exactly how much space you will save by doubling the size of your block tiles without generating a cache for a well chosen sample of data.

I ran across an old blog post of someone who reduced their blog size from 512x512 to 128x128 to discover they required 10x the amount of storage as they did before, but the main reason in his case is a large amount of sparse data (i.e. empty tiles) combined with a small tile size resulted in a huge amount of wasted space. The resulting empty tiles were approximately 400 bytes, resulting in 3600 bytes of wasted space for each tile. Combined with increasing the number of required tiles by a factor of 16, resulted in such a large discrepancy between the two tile cache sizes. Url: ArcGIS Server Cache and Optimal Hard Disk Block Size

share|improve this answer
add comment

This will be a function of the block size used to format your hard disk and the actual tiles you have. It is best to create a small set and test it:

On a windows box you can right click your directory and look at the properties to find out how much space on the disk your files occupy and how large they are. On unix systems you could use ls -ls to have both the number of bytes of a file and the number of blocks they occupy. A simple way to find out the block size is running stat . in the directory where your files are located.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.