joto/osmium — pull request #35 by MaZderMind (2011-12-01 12:23:55+00:00)
Title: avoid over-sized blobs / handle them nicely

The writer sometimes wrote blobs that were bigger then OSMPBF::max_uncompressed_blob_size which made the reader fail with SIGSEGV.

This pull-request modified the reader to handle this case and exit with an assertions.

The writer get's another size-check which is performed every 1000 items. It checks the current block-size against 50% of the maximum blob-size. The block-size doesn't include the stringtable- and the blob-metadata-size, so 50% is really conservative but only hit by blocks with really large relations.

Blocks with only nodes or ways usually mtake up only 1-2% of the maximum blob size.