pub struct Recipe {
pub name: &'static str,
pub dataset: Dataset,
pub epsilon_m: f64,
pub quant_bits: QuantBits,
pub grid_deg: f64,
pub simplify_algorithm: SimplifyAlgorithm,
pub geom: GeomEncoding,
pub codec: Codec,
pub density_weight_floor_e4: u16,
}Expand description
One preset’s complete build recipe: the name and every encoder knob that determines the shipped asset’s provenance stamp.
Fields§
§name: &'static strThe preset name, e.g. "tiny-static", as spelled in feature
names, crate names (with - as _), and asset file names.
dataset: DatasetThe dataset the asset is built from.
epsilon_m: f64The simplification tolerance in meters, as the builder takes it
(the header stores the f32 cast).
quant_bits: QuantBitsThe coordinate quantization width.
grid_deg: f64The grid cell size in degrees, as the builder takes it (the
header stores the f32 cast).
simplify_algorithm: SimplifyAlgorithmThe simplification algorithm the encoder runs.
geom: GeomEncodingThe geometry encoding.
codec: CodecThe payload compression codec.
density_weight_floor_e4: u16The population-density weight floor in fixed-point 1e-4, the
header’s representation; 0 means unweighted. The builder-side
fraction is density_weight_floor().
Implementations§
Source§impl Recipe
impl Recipe
Sourcepub fn density_weight_floor(&self) -> Option<f64>
pub fn density_weight_floor(&self) -> Option<f64>
Returns the density floor as the fraction the builder takes,
None when the recipe is unweighted. The division is exact:
both operands are exactly representable and every 4-decimal
fraction rounds to the same nearest f64 its literal parses to,
so the derived value is bit-identical to the fraction the asset
was generated with.
Trait Implementations§
impl Copy for Recipe
Source§impl From<&Recipe> for Provenance
impl From<&Recipe> for Provenance
Source§fn from(recipe: &Recipe) -> Provenance
fn from(recipe: &Recipe) -> Provenance
Source§impl From<&Recipe> for Config
Converts a recipe, typically one of the utz_common::presets
constants, into a config carrying its knobs. The named preset
constructors are thin wrappers over this; use it directly to drive
the builder from the table (e.g. iterating presets::ALL).
impl From<&Recipe> for Config
Converts a recipe, typically one of the utz_common::presets
constants, into a config carrying its knobs. The named preset
constructors are thin wrappers over this; use it directly to drive
the builder from the table (e.g. iterating presets::ALL).