PBF Parser v0.1.0 PBFParser.Decoder View Source

This module provides function for decoding block data into appropriate structs representing OSM entities (Nodes, relations and ways).

Link to this section Summary

Functions

Decodes the raw PrimitiveBlock (as obtained from Decoder.decompress_block/1) into a more usable format. Each block usually contains around 8000 densely packed node entities and a number of relation and way entities. Those are extracted along with accompanying metadata

Decompresses zlib encoded block data (as obtained from Reader.stream/1)

Decompresses zlib encoded blockheader data (as obtained from Reader.stream/1)

Link to this section Functions

Link to this function decode_block(primitive_block) View Source
decode_block(PBFParser.Proto.OsmFormat.PrimitiveBlock.t()) :: [
  Data.Node.t() | Data.Relation.t() | Data.Way.t()
]

Decodes the raw PrimitiveBlock (as obtained from Decoder.decompress_block/1) into a more usable format. Each block usually contains around 8000 densely packed node entities and a number of relation and way entities. Those are extracted along with accompanying metadata.

Returns a list containing Data.Node, Data.Relation and Data.Way structs.

Link to this function decompress_block(data) View Source
decompress_block(iodata()) :: PBFParser.Proto.OsmFormat.PrimitiveBlock.t()

Decompresses zlib encoded block data (as obtained from Reader.stream/1).

Returns PrimitiveBlock, a struct generated directly from PBF protobuf specification.

Link to this function decompress_header(data) View Source
decompress_header(iodata()) :: PBFParser.Proto.OsmFormat.HeaderBlock.t()

Decompresses zlib encoded blockheader data (as obtained from Reader.stream/1).

Returns HeaderBlock, a struct generated directly from PBF protobuf specification.