pub struct Metadata {Show 16 fields
pub name: String,
pub description: String,
pub attribution: String,
pub bounds: BoundingBox,
pub time_range: TimeRange,
pub min_zoom: u8,
pub max_zoom: u8,
pub tile_count: u64,
pub feature_count: u64,
pub layers: Vec<String>,
pub properties: BTreeMap<String, String>,
pub temporal_bucket_ms: u64,
pub summary_tier: Option<SummaryTier>,
pub temporal_lod: Option<Vec<TemporalLodLevel>>,
pub heatmap_domain: Option<HeatmapDomain>,
pub style_hints: Option<StyleHints>,
}Expand description
Archive metadata.
Stored in the archive as UTF-8 JSON — small, human-inspectable, and versionless thanks to serde’s field defaults.
Fields§
§name: StringArchive name
description: StringDescription
attribution: StringAttribution text
bounds: BoundingBoxBounding box
time_range: TimeRangeTime range
min_zoom: u8Minimum zoom level
max_zoom: u8Maximum zoom level
tile_count: u64Total number of tiles. For packed manifests this is derived from the
directory at write time (PackWriter::finalize); caller-set values are
ignored there.
feature_count: u64Total feature records summed across tiles — a feature that lands in N
tiles (zoom pyramid, clipping, temporal LOD) counts N times. Matches
stt-validate’s feature_count_index; derived from the directory at
write time for packed manifests.
layers: Vec<String>Layer names
properties: BTreeMap<String, String>Custom properties. A BTreeMap so the serialized JSON key order is
deterministic across processes — the packed manifest embeds this map,
and byte-reproducible builds must not depend on hash-map iteration order.
temporal_bucket_ms: u64Temporal bucket size in milliseconds for tile chunking Tiles are organized into fixed temporal intervals (e.g., 3600000 = 1 hour)
summary_tier: Option<SummaryTier>Optional server-side aggregated summary tier. v2/v3 archives without a summary tier round-trip cleanly via the field default.
temporal_lod: Option<Vec<TemporalLodLevel>>Optional temporal LOD pyramid (orthogonal to summary tier). When present, the archive carries aggregate tiles at coarser temporal granularities so a reader animating decades of data at “year scale” can fetch coarser tiles instead of streaming per-hour base tiles.
heatmap_domain: Option<HeatmapDomain>Optional bake-time HeatmapLayer intensity domains. When set, the
renderer’s HeatmapLayer skips its runtime colorDomain default of
[0, 1] and uses these per-class entries instead — vital when the
configured weightProperty carries values far outside that range
(earthquake magnitudes, AIS speed, etc.).
style_hints: Option<StyleHints>Optional build-time style hints (per-property statistics + suggested
rendering defaults). Baked by stt-build --style-hints; always
overridable by the renderer/user, ignored by older readers.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set description
Sourcepub fn with_attribution(self, attribution: impl Into<String>) -> Self
pub fn with_attribution(self, attribution: impl Into<String>) -> Self
Set attribution
Sourcepub fn with_bounds(self, bounds: BoundingBox) -> Self
pub fn with_bounds(self, bounds: BoundingBox) -> Self
Set bounds
Sourcepub fn with_time_range(self, time_range: TimeRange) -> Self
pub fn with_time_range(self, time_range: TimeRange) -> Self
Set time range
Sourcepub fn with_zoom_levels(self, min_zoom: u8, max_zoom: u8) -> Self
pub fn with_zoom_levels(self, min_zoom: u8, max_zoom: u8) -> Self
Set zoom levels
Sourcepub fn with_temporal_bucket_ms(self, temporal_bucket_ms: u64) -> Self
pub fn with_temporal_bucket_ms(self, temporal_bucket_ms: u64) -> Self
Set temporal bucket size in milliseconds
Sourcepub fn with_temporal_lod(self, levels: Vec<TemporalLodLevel>) -> Result<Self>
pub fn with_temporal_lod(self, levels: Vec<TemporalLodLevel>) -> Result<Self>
Attach a temporal LOD pyramid.
Each level’s bucket_ms MUST be a strict multiple of the archive’s
base temporal_bucket_ms and MUST be strictly greater than it; levels
MUST be sorted by ascending bucket_ms. Returns Err if the input
breaks any of those invariants — the build pipeline relies on them
when re-bucketing features into LOD aggregates.
Sourcepub fn temporal_lod_for_zoom(&self, zoom: u8) -> Option<&TemporalLodLevel>
pub fn temporal_lod_for_zoom(&self, zoom: u8) -> Option<&TemporalLodLevel>
Return the LOD level that applies at zoom, if any. The largest
matching bucket_ms (coarsest level) wins — at a global zoom, you
want the coarsest available aggregate, not the finest.
Sourcepub fn with_property(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_property( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a custom property
Sourcepub fn with_summary_tier(self, tier: SummaryTier) -> Self
pub fn with_summary_tier(self, tier: SummaryTier) -> Self
Attach an aggregated summary-tier descriptor.
Sourcepub fn with_heatmap_domain(self, domain: HeatmapDomain) -> Self
pub fn with_heatmap_domain(self, domain: HeatmapDomain) -> Self
Attach a bake-time HeatmapLayer intensity-domain block.
Sourcepub fn with_style_hints(self, hints: StyleHints) -> Self
pub fn with_style_hints(self, hints: StyleHints) -> Self
Attach a build-time style-hints block.
Sourcepub fn to_json_bytes(&self) -> Result<Vec<u8>>
pub fn to_json_bytes(&self) -> Result<Vec<u8>>
Serialise to the JSON byte form stored in an archive.
Sourcepub fn from_json_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_json_bytes(bytes: &[u8]) -> Result<Self>
Parse from the JSON byte form stored in an archive.
Sourcepub fn to_tilejson(&self, tile_url_template: Option<&str>) -> Value
pub fn to_tilejson(&self, tile_url_template: Option<&str>) -> Value
Render a TileJSON 3.0 descriptor (with a STAC-style temporal
extension) for this archive.
This is the self-describing, ecosystem-recognisable face of the archive:
MapLibre / Leaflet / OpenLayers understand the core TileJSON fields, and
the additive temporal block — an ISO-8601 interval à la STAC, plus
the bucket size/step and any LOD pyramid — carries the time dimension the
spatial-only standard lacks (unknown keys are ignored by existing
clients). tile_url_template is the {z}/{x}/{y}/{t} URL the host serves
tiles at; when None, a relative template is emitted.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnsafeUnpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more