itacart.serialization.geometry_blob.decode_geometry

itacart.serialization.geometry_blob.decode_geometry(blob)[source]

Decode a GeometryBlob into rings and profile metadata.

Rings come back in the order they were written and with the winding they were given. The exterior of a component is its first ring.

Parameters:

blob (bytes) – The binary blob.

Return type:

dict[str, Any]

Returns:

A mapping with rings, geometry_type, edge_model, densification_model, max_segment_m and resolution.

Raises:

MalformedBlobError – If the blob fails structural validation.

Example

>>> blob = encode_geometry([["NE(0625/0451)"]], "POINT", resolution=1)
>>> decode_geometry(blob)["rings"]
[['NE(0625/0451)']]