<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Steve,<br><br>thanks for the clarification. I first thought that the 16MB<br>limit is for the *.img file, but in fact it is for each subfile (RGN,LBL,...) within <br>one *.img file.<br>I played a bit with the limits and noticed that we don't<br>even reach the 16 MB when the "too large" message appears<br>because we use 128 KB steps to enlarge the buffer.<br>FWIW : Attached is a small patch to fix that, it still uses the "1 KB<br>GUARD_SIZE". <br>(With the patch) I can safely create an *.img file <br>that has ~ 18 MB, while the RGN file size is 0xfebfb9,<br>which is still below the limit.<br><br>Do you think it's okay to commit that?<br><br>Gerd<br><br><div>> Date: Fri, 15 May 2015 11:45:31 +0100<br>> From: steve@parabola.me.uk<br>> To: mkgmap-dev@lists.mkgmap.org.uk<br>> Subject: Re: [mkgmap-dev] EU map too big?<br>> <br>> <br>> <br>> Hi<br>> <br>> > "This definition implies that an IMG file can never have more than 65,535<br>> > blocks, but<br>> > the use of large block sizes (2048, 4096, etc…) allow the IMG file to hold<br>> > several gigabytes of<br>> > data. The only practical limit on IMG file size seems to be the use of<br>> > 32-bit integers for file<br>> > offsets, which imposes a hard limit of 4 GB.<br>> > Large sub-files, those with more than 240 blocks of data, are spanned across<br>> > multiple FAT<br>> > blocks with each sub-file part numbered in a 32-bit integer at offset 0x10.<br>> > File size is only<br>> > present in the first of these (part 0x0000)."<br>> ><br>> > 65535 * 256 ~ 16BG, so I assume that this is the reason. I see files which<br>> > use a different<br>> > blocksize, so maybe this limit makes no more sense.<br>> ><br>> > @Steve: Can you have a look at this, please?<br>> <br>> The img file as a whole can be very large by using a large block size<br>> as the quoted passage states. This is how we create the global index<br>> and the gmapsupp files.<br>> <br>> (We may not however automatically adjust the block size for regular<br>> tiles, but that could be fixed if it became a problem.)<br>> <br>> The bigger issue is the limits on the individual files (RGN etc)<br>> within the .img file. For example the subdivision pointers from TRE<br>> into RGN are 3 byte quantities and so this means that the max possible<br>> offset into RGN for the start of a subdivision is around 16M.<br>> <br>> It is possible that there are flags that allows you to extend this,<br>> but I don't know of any, nor have I seen any files that break this<br>> limit.<br>> <br>> ..Steve<br>> _______________________________________________<br>> mkgmap-dev mailing list<br>> mkgmap-dev@lists.mkgmap.org.uk<br>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev<br></div>                                            </div></body>
</html>