Skip to main content

Module source

Module source 

Source
Expand description

The three traits — the ONLY things that differ between a map view and a graph view.

Everything else a viewer does (cull, tessellate, place labels, composite, pick) is identical whether the thing on screen is a road or a call edge. This module names the difference and nothing else:

traitquestion it answersmap answergraph answer
PositionSourcewhere is feature id?Mercator(lat, lon)the layout’s node position
ElevationSourcehow high is it?terrain heightfield0.0, or a metric (centrality / risk)
Hierarchywhat does “one step deeper” mean?the next zoom bandexpand this cluster

§Why f64 world space

Web-Mercator at zoom 22 and a graph drilled six levels deep have the same bug: f32 runs out of mantissa and geometry jitters. The engine therefore keeps world space in f64 and only becomes f32 at the relative-to-eye split (super::rte) — one fix, both problems.

§Why object-safe

Use case 7 — a graph drawn on geography — needs two different position sources live in the same frame. That is only expressible if the engine can hold &[&dyn PositionSource], so every method here is object-safe: no generic methods, no Self: Sized, no associated types on the hot path.

Structs§

Band
One rung of a Bands hierarchy.
Bands
Bands — THE shared hierarchy. A map zoom pyramid and a graph cluster-expansion tree are both a list of Bands; nothing in the engine distinguishes them.
Flat
FlatZ = 0. Use cases 1, 3 and 4. Zero cost: the engine special-cases a z_range() of (0, 0) and skips the elevation pass entirely.
Flatten
Flatten — one level, everything in it. The honest hierarchy of a small graph or a single-zoom overlay; also the migration floor, so a renderer can move onto the engine before it has a real LOD story.
Identity
Identity — the position IS the coordinate. Use case 3 (the flat 2D overlay) and any caller that already laid its own content out.
Layout
Layout — positions produced by a layout algorithm that keeps running (force-directed, hierarchical, metro). Arithmetically identical to Identity; the difference is generation, which every engine-side cache keys on.
Metric
Metric — per-feature scalar × a scale. Use cases 5 and 6: node height IS betweenness centrality, or a Mímir risk score.
Projected
Projected — a source that pushes raw (a, b) pairs through a pure function. This is the seam a geographic projection plugs into without facett-core learning what a latitude is: facett-geomap supplies |lon, lat| mercator(lon, lat) and gets a PositionSource back.
Sampled
Sampled — height from a pure (x, y) -> z function plus a declared range. facett-geomap wraps its terrain heightfield in this; facett-core never learns what a DEM is.
WorldAabb
An axis-aligned world-space box — the culler’s unit of work, and the only thing the Hierarchy levels are really made of (a coarse level is a set of bounding volumes that stand in for the fine level beneath it).
WorldPos
A position in engine world space, always f64.

Traits§

ElevationSource
How high is feature id?
Hierarchy
What does one step deeper mean?
PositionSource
Where is feature id?