Skip to main content

Metadata

Struct Metadata 

Source
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: String

Archive name

§description: String

Description

§attribution: String

Attribution text

§bounds: BoundingBox

Bounding box

§time_range: TimeRange

Time range

§min_zoom: u8

Minimum zoom level

§max_zoom: u8

Maximum zoom level

§tile_count: u64

Total 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: u64

Total 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: u64

Temporal 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

Source

pub fn new(name: impl Into<String>) -> Self

Create a new metadata object

Source

pub fn with_description(self, description: impl Into<String>) -> Self

Set description

Source

pub fn with_attribution(self, attribution: impl Into<String>) -> Self

Set attribution

Source

pub fn with_bounds(self, bounds: BoundingBox) -> Self

Set bounds

Source

pub fn with_time_range(self, time_range: TimeRange) -> Self

Set time range

Source

pub fn with_zoom_levels(self, min_zoom: u8, max_zoom: u8) -> Self

Set zoom levels

Source

pub fn with_temporal_bucket_ms(self, temporal_bucket_ms: u64) -> Self

Set temporal bucket size in milliseconds

Source

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.

Source

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.

Source

pub fn with_property( self, key: impl Into<String>, value: impl Into<String>, ) -> Self

Add a custom property

Source

pub fn with_summary_tier(self, tier: SummaryTier) -> Self

Attach an aggregated summary-tier descriptor.

Source

pub fn with_heatmap_domain(self, domain: HeatmapDomain) -> Self

Attach a bake-time HeatmapLayer intensity-domain block.

Source

pub fn with_style_hints(self, hints: StyleHints) -> Self

Attach a build-time style-hints block.

Source

pub fn to_json_bytes(&self) -> Result<Vec<u8>>

Serialise to the JSON byte form stored in an archive.

Source

pub fn from_json_bytes(bytes: &[u8]) -> Result<Self>

Parse from the JSON byte form stored in an archive.

Source

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 Clone for Metadata

Source§

fn clone(&self) -> Metadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Metadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Metadata

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Metadata

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Metadata

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool