
On Mon, Sep 13, 2010 at 3:36 PM, Steve Ratcliffe <steve@parabola.me.uk> wrote:
Its needed because mkgmap takes all kinds of input files and I don't want the user to have to say what the file format is, I just want mkgmap to work out the file format and use the correct reader.
I do this by extension or by reading the beginning of the file and looking for something distinctive. It doesn't have to be fool proof just good enough to tell genuine files apart.
Hence why I was asking if OSMHeader and or OSMData would always be present near the beginning of the file, I could look for them.
Yes, I believe OSMHeader should occur in the first 16 bytes or so. (Just looked at a hexdump. Yes, confirmed, byte offset [6,14]. Furthermore, I believe that byte offsets [4,15] will always be static when the first block is an OSMHeader, however, I cannot guarantee it because I cannot guarantee that a given protocol buffer will always serialize to the same output in the future. Scott