Skip to main content

profile_properties

Function profile_properties 

Source
pub fn profile_properties(
    props: &[(String, PropertyValues)],
    time_range_ms: u64,
    temporal_bucket_ms: u64,
    layer_kind_hint: Option<&str>,
) -> StyleHints
Expand description

Profile a set of per-property value collections into a StyleHints block.

  • Numeric properties yield min/p50/p90/p95/p97/p99/max plus a suggested_domain of [min, p97] with each endpoint rounded OUTWARD to 2 significant figures (the “domain clamps at ~p97” convention). A property whose values are all non-finite (or empty) is omitted.
  • Categorical properties yield ONLY name + cardinality.
  • suggested_playback_seconds = clamp(round(sqrt(bucket_count)), 20, 90) where bucket_count = time_range_ms / temporal_bucket_ms; absent when temporal_bucket_ms is 0.
  • layer_kind_hint passes through only when it is one of the pinned "points" | "paths" | "trips" | "polygons" vocabulary.