Skip to main content

GeomEncoding

Enum GeomEncoding 

Source
#[repr(u8)]
pub enum GeomEncoding { VarintArcs = 0, FixedWidthArcs = 1, FullRings = 2, Coarse = 3, }
Expand description

The geometry encoding, which decides how an asset stores its polygons and how lookups read them.

The three polygon encodings answer bit-identically; they trade storage for lookup speed. Coarse alone trades precision instead: it drops the polygons and answers at grid-cell precision.

The measured cost/speed ladder lives here. Every other doc site links back to this table rather than restating numbers. Size columns are whole assets relative to the VarintArcs build of the same preset; lookup speed is the flash-XIP (execute-in-place, zero RAM) leg of the embedded bench, against the same baseline.

encodinggeometry sectionrawbest-compressedXIP lookup
VarintArcsshared arcs, delta + zigzag-varint coords1×1×1×
FixedWidthArcsshared arcs, absolute quant-width coords1.4–1.7×1.15–1.3× (xz)1.3–1.5×
FullRingswhole rings, absolute quant-width coords2.1–3.2×1.4–2.1× (xz)2.0–3.3×
Coarsenone (grid only)0.05–0.33×0.01–0.14×grid probe only

Narrow-quant FullRings XIP even outran the RAM preload cache on the embedded bench. On fixed-width payloads the codec ranking flips: xz overtakes brotli at every preset. Coarse shrinks with preset fineness twice over: the grid is all it keeps, and grids compress extremely well.

The size columns come from utz_dev_cli whittle --extended (2026-07, TZBB 2026c), measuring full assets per preset recipe against the VarintArcs build. The XIP lookup column is from the 2026-07 bench-firmware runs against earlier payload revisions; read it as a relative ladder.

Variants§

§

VarintArcs = 0

This encoding stores shared arcs as delta + zigzag-varint streams; it is the default, for minimal storage size.

§

FixedWidthArcs = 1

This encoding stores shared arcs as absolute fixed-width (quant-width) coordinates, so streaming lookups no longer decode a varint per vertex, the dominant lookup cost on embedded targets. It reaches near-eager speed with no RAM cache and suits uncompressed -static assets read in place from memory-mapped flash, at a storage cost (table above).

§

FullRings = 2

This encoding stores each ring in full: coordinates are flattened per ring as quant-width pairs plus ring/poly index tables, 4-byte aligned; it is the preload cache serialized. Slice kernels read it in place: from memory-mapped flash via from_static() (eager-lookup speed with no RAM cache and no preload pass at boot) or from the decompressed buffer via from_slice(). There is no arc store, so borders shared between zones are duplicated per ring, making this the largest encoding (table above). It works on little-endian hosts only.

§

Coarse = 3

A grid-only asset carrying the header, tzid pool, parent table, and grid, with no geometry at all. lookup() answers at cell precision, the same answer lookup_coarse() gives; precision is a property of the asset, like epsilon_m. It is by far the smallest storage (table above) and works on any endianness, and a reader built only for coarse assets compiles no point-in-polygon code.

Implementations§

Source§

impl GeomEncoding

Source

pub const fn name(self) -> &'static str

The canonical CLI name (varint-arcs, fixed-width-arcs, full-rings, or coarse), a spelling from_name() accepts.

Source

pub fn from_name(name: &str) -> Option<GeomEncoding>

The encoding a name selects, the inverse of name().

Source

pub const fn from_byte(byte: u8) -> Option<GeomEncoding>

The encoding a header byte names, if any.

Trait Implementations§

Source§

impl Clone for GeomEncoding

Source§

fn clone(&self) -> GeomEncoding

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for GeomEncoding

Source§

impl Debug for GeomEncoding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for GeomEncoding

Source§

fn default() -> GeomEncoding

Returns the “default value” for a type. Read more
Source§

impl Eq for GeomEncoding

Source§

impl PartialEq for GeomEncoding

Source§

fn eq(&self, other: &GeomEncoding) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GeomEncoding

Source§

impl<'a> TryFromCtx<'a, Endian> for GeomEncoding

Source§

type Error = Error

Source§

fn try_from_ctx( src: &'a [u8], ctx: Endian, ) -> Result<(GeomEncoding, usize), <GeomEncoding as TryFromCtx<'a, Endian>>::Error>

Source§

impl TryIntoCtx<Endian> for &GeomEncoding

Source§

type Error = Error

Source§

fn try_into_ctx( self, dst: &mut [u8], ctx: Endian, ) -> Result<usize, <&GeomEncoding as TryIntoCtx<Endian>>::Error>

Source§

impl TryIntoCtx<Endian> for GeomEncoding

Source§

type Error = Error

Source§

fn try_into_ctx( self, dst: &mut [u8], ctx: Endian, ) -> Result<usize, <GeomEncoding as TryIntoCtx<Endian>>::Error>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.