logo separator

[mkgmap-dev] Automatic block-size setting

From Steve Ratcliffe steve at parabola.me.uk on Sat Jan 20 12:58:50 GMT 2018

Hi Andrzej

> I have looked at block sizes and all is reasonable. Tiles are usually 2k 
> or 4k, ovm_* are 512 or 1k, MDR are 8k or bigger. I guess you have set 
> some preference for bigger blocks in case of MDR.

I read your post where you noted that often bigger block sizes
lead to a smaller file, so I made it calculate the whole file
size and then pick the smallest one.

Unless there is a bug, there should not be any special preference for
larger blocks in the MDR case,

I just did a run with trace information and I got:

INFO: bs=512, whole size=47126016, hb=386, fb=91657, blocks=92043

INFO: bs=1024, whole size=47029248, hb=98, fb=45829, blocks=45927

INFO: bs=2048, whole size=46981120, hb=25, fb=22915, blocks=22940

INFO: bs=4096, whole size=46960640, hb=7, fb=11458, blocks=11465

INFO: bs=8192, whole size=46956544, hb=2, fb=5730, blocks=5732

INFO: bs=16384, whole size=46972928, hb=1, fb=2866, blocks=2867

[ hb = number of header blocks, fb = number of file blocks ]

So the block size = 8192 does seem to give the lowest file size; only
by 4k bytes.

I was a bit suprised, but the number of header blocks needed goes down
by a quarter when the block size is doubled, and that makes up for
the wastage of bigger blocks.

..Steve


More information about the mkgmap-dev mailing list