Skip to main content

Module block

Module block 

Source
Expand description

The columnar block codec of the sort runs.

A run is a sequence of blocks. A block holds a few thousand entries that are already sorted by key, and stores them column by column:

  • the sort keys as the delta to the key before (the keys of a block are close, so a delta is one to three bytes where a key is nine),
  • the layer, the geometry type, the feature id and the sort key,
  • the geometry commands,
  • the properties: a property set that one of the last SET_WINDOW sets of the block already stored is stored once and referenced; a string is stored once per block and referenced.

Every column holds values of one kind, so the general-purpose compressor that runs over the finished block finds the repeats a row layout hides. Decoding reproduces every entry exactly, bit for bit.

Structs§

BlockDecoder
Reads the entries of one decoded block in order.
BlockEncoder
Appends entries to one block.

Enums§

BlockError
The block was cut: why a block cannot be decoded.

Constants§

SET_WINDOW
How many property sets back an entry may refer to. The decoder keeps this many sets alive, which bounds its memory however long the block is.