Types Reference¶
Structured return types for Yoro operations.
Pure Python dataclasses — no external dependencies.
Bounds
dataclass
¶
Geographic bounding box of a Hilbert cell.
Source code in src/yoro/types.py
as_bbox_tuple()
¶
Return (lon_min, lat_min, lon_max, lat_max) — standard GIS order.
DecodeResult
dataclass
¶
Result of decoding an Yoro string.
Source code in src/yoro/types.py
DomainInfo
dataclass
¶
EncodeResult
dataclass
¶
PrecisionLevel
dataclass
¶
A canonical precision level — one that produces a distinct grid.
Due to base-29 quantization, not every Hilbert order p yields a new code length. Only canonical precisions create distinct grids. Asking for a non-canonical p silently snaps to the nearest canonical one.
Source code in src/yoro/types.py
code_length
instance-attribute
¶
Number of base-29 characters after the domain prefix.
grid_size
instance-attribute
¶
Number of cells per axis (2 ** precision).
precision
instance-attribute
¶
Effective Hilbert order (grid is 2^p x 2^p).
resolution_m
instance-attribute
¶
Approximate cell size in meters for the given domain.
total_cells
instance-attribute
¶
Total number of cells in the domain (grid_size ** 2).