On Thu, Apr 29, 2010 at 2:16 AM, <a href="mailto:jamesmikedupont@googlemail.com">jamesmikedupont@googlemail.com</a> <span dir="ltr"><<a href="mailto:jamesmikedupont@googlemail.com">jamesmikedupont@googlemail.com</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">HI,<br>
I am working on the c++ decoder, can you please tell me roughly where<br>
the message objects are?<br>
</blockquote><div><br>(CC'ing back to the list)<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I need to understand how to decode this file.<br>
</blockquote><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Do you have any header information or is it all raw protobuf? You<br>

mentioned blocks being compressed, are you using the protobuf tools to<br>
do this? can you give me a rough layout of how to parse the bin file?<br>
</blockquote><div><br>Parsing a protocol buffer requires knowing its length beforehand, which adds in some complexities.<br><br>Currently a file consists of repetitions of the following:<br><br>  <32-bit integer encoding the header length, I believe it is in Java's default big endian order><br>
  <serialized FileBlockHeader message>   (see fileformat.proto)<br>  <serialized Blob message'>  (see fileformat.proto, the length is given in the header message)<br> <br>Code implementing this is in BlockInputStream and BlockOutputStream and FileBlock in package crosby.binary.file. <br>
To understand how compression is used, look at the definition of the Blob message and FileBlock.java<br><br>Inside the blob is a serialized osm HeaderBlock or osm PrimitiveBlock message.<br><br>Note that I am currently unhappy with the current file header scheme and may make incompatible changes. <br>
There's definitely some cruft in fileformat.proto that needs to be removed.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
thanks,<br>
mike<br>
</blockquote></div><br>