itacart.serialization.tree_blob.prefix_at_resolution_binary
- itacart.serialization.tree_blob.prefix_at_resolution_binary(node, resolution)[source]
Truncate an encoded node to a coarser resolution.
Monotone: truncating twice equals truncating once to the coarser of the two levels.
- Parameters:
- Return type:
- Returns:
The truncated node bytes.
- Raises:
MalformedBlobError – If
nodeis not a valid node.ResolutionError – If
resolutionis finer than the node’s.
Example
>>> deep = encode_node("NE(0625/0451(3))") >>> prefix_at_resolution_binary(deep, 1) == encode_node("NE(0625/0451)") True