On Wed, Nov 21, 2012 at 3:46 AM, Jochen Topf <span dir="ltr"><<a href="mailto:jochen@remote.org" target="_blank">jochen@remote.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Tue, Nov 20, 2012 at 09:17:59PM -0600, Scott Crosby wrote:<br>
> Not quite. The granularity of timestamps can go down to the milliseconds.<br>
><br>
> <a href="https://github.com/DennisOSRM/OSM-binary/blob/master/src/osmformat.proto#L96" target="_blank">https://github.com/DennisOSRM/OSM-binary/blob/master/src/osmformat.proto#L96</a><br>
<br>
</div>Ugh. Yes. That was always somewhat of a problem in the protocol IMHO. Nobody<br>
needs more granularity than seconds because the main database doesn't have it.<br>
Similar for the latitude/longitude granularity. Nobody uses that. And it just<br>
makes all the code reading PBF files a bit more complex and a bit slower.<br></blockquote><div><br></div><div>Today the database lacks those features, but the future can be different. The trivial complexity of that feature in readers allows many possible future features, without a breaking format change. The ones I had in mind were:</div>
<div><br></div><div> Lower granularity makes it easy to create lower-precision excerpts that are smaller to send and easier to store.</div><div> Allow OSM tooling to handle contour lines, or other grid-specified data, where making the granularity size matching the grid size can lead to vastly improved compression.</div>
<div> Support future higher-precision data, e.g., generated from GPS block 3 satellites.</div><div> Millisecond timestamps are much easier to use as unique changeset ID's than second-granularity timestamps.</div>
<div><br></div><div>The runtime cost of this is a couple of multiplications that loop-invariant code motion can remove; about 30 nanoseconds for each 8000 entity block, and is much much cheaper than the branch prediction failures of VarInt decoding.</div>
<div><br></div><div>Scott</div><div><br></div></div>