Expand description
Reusable geospatial visualization primitives.
This module provides map-coupled, simulation-agnostic data structures and layer implementations for scientific and analytical overlays:
GeoGrid– georeferenced regular grid descriptorScalarField2D– grid-aligned scalar values with generation trackingColorRamp/ColorStop– interpolated colour transfer functionLegendSpec/LabeledStop– legend metadata for client-side UIColumnInstance/ColumnInstanceSet– instanced column descriptorsPointInstance/PointInstanceSet– point-cloud / scatter descriptorsVisualizationOverlay– tagged enum forFrameOutputintegrationGridScalarLayer– flat colour grid overlay (impl Layer)GridExtrusionLayer– extruded grid overlay (impl Layer)InstancedColumnLayer– instanced column overlay (impl Layer)PointCloudLayer– point-cloud / scatter overlay (impl Layer)
§Design
All types are pure Rust data models with no Bevy or WGPU dependencies.
Renderers consume these via [FrameOutput::visualization] or by
downcasting through [Layer::as_any].
§Client ownership model
Rustial provides the rendering and geo-anchoring side of the visualization stack. The following concerns belong in the host application, not in the map engine:
| Concern | Belongs in |
|---|---|
| Domain-specific data transforms (aggregation, filtering, binning) | Host application |
| Simulation adapters (CFD, traffic, weather model connectors) | Host application |
| Legend / colour-bar UI rendering | Host application (use LegendSpec metadata) |
| Time-series animation orchestration | Host application (update_values() per frame) |
| KPI dashboards and non-geographic widgets | Host application |
| Colour ramp presets for specific domains | Host application (construct ColorRamp) |
Rustial provides:
| Concern | Provided by engine |
|---|---|
| Geo-referenced grid/column/point placement | GeoGrid, ColumnInstance, PointInstance |
| GPU-accelerated rendering (flat grid, extruded grid, instanced columns, point cloud) | Both WGPU and Bevy renderers |
| Value-only retained updates (no GPU resource rebuild) | ScalarField2D::update_values, ColumnInstanceSet / PointInstanceSet generation tracking |
| CPU picking with stable pick IDs | GeoGrid::cell_at_geo, nearest-column/point picking |
| Legend metadata for host UI | LegendSpec |
| Colour transfer functions | ColorRamp / ColorStop |
§Retained-update contract
The visualization pipeline distinguishes two update paths:
-
Value-only update: call
ScalarField2D::update_valuesor replace theColumnInstanceSet/PointInstanceSetwith a new generation. Renderers detect the generation bump and update only the data texture or instance buffer – no vertex/index/bind-group rebuild. -
Structural update: change grid geometry, colour ramp, or layer identity. This triggers a full GPU resource rebuild.
For large datasets, prefer value-only updates to stay within the 60 FPS frame budget. Structural updates are amortised across frames but may cause a one-frame stall for very large grids.
§Async preprocessing
For very large visualization structural updates (>100k cells or >50k
instances), use AsyncVisualizationPipeline
to offload heavy data preparation (binning, normalisation, colour ramp
evaluation) to a background thread. The pipeline integrates with the
existing DataTaskPool infrastructure.
§Picking
Grid layers support CPU-based picking via GeoGrid::cell_at_geo.
Column layers support nearest-column picking. Both integrate with
MapState::pick through the standard
[Layer] trait.
Structs§
- Color
Ramp - An interpolated colour transfer function defined by ordered stops.
- Color
Stop - A single stop in a
ColorRamp. - Column
Instance - A single column instance anchored to a geographic position.
- Column
Instance Set - A collection of
ColumnInstances with a generation counter. - Extrusion
Params - Extrusion rendering parameters.
- GeoGrid
- A georeferenced regular grid anchored to a geographic origin.
- Grid
Extrusion Layer - An extruded georeferenced grid overlay.
- Grid
Scalar Layer - A flat georeferenced colour grid overlay.
- Instanced
Column Layer - An instanced column overlay layer.
- Labeled
Stop - A labeled stop in a legend.
- Legend
Spec - Legend metadata sufficient for client-side UI rendering.
- Point
Cloud Layer - A point-cloud / scatter visualization layer.
- Point
Instance - A single point-cloud instance anchored to a geographic position.
- Point
Instance Set - A collection of
PointInstances with a generation counter. - Scalar
Field2D - A 2D scalar field aligned to a
GeoGrid.
Enums§
- Normalization
Mode - Normalization mode for legend value display.
- Visualization
Overlay - A single visualization overlay collected from the layer stack during
MapState::update_with_dt.