[OSM-dev] Writing PBF

Jochen Topf jochen at remote.org
Tue Dec 13 10:46:34 GMT 2011


The PBF format has maximum block sizes. Osmium used to just write 8000 objects
into each block and hope that there is enough space. Turns out that there are
cases where that doesn't work. If there are a lot of very large relations, the
block can overflow. Somebody noticed that problem and Peter Körner fixed it
in Osmium (Thanks!). Osmium now checks whether the buffer is 95% full and
then writes it out (the 95% should leave more than enough space for the
string table). Its still not a perfect strategy, you could create an OSM file
that would overflow the buffer, but it should not happen in practice.

So if you see this problem, upgrade to a newer version of Osmium.

And if you have implemented a PBF writer, you should probably check whether
it suffers from the same or similar problem.

Jochen Topf  jochen at remote.org  http://www.remote.org/jochen/  +49-721-388298

More information about the dev mailing list