Metadata

Struct Metadata 

Source
pub struct Metadata {
Show 28 fields pub s2tilejson: String, pub version: String, pub name: String, pub scheme: Scheme, pub description: String, pub type: SourceType, pub extension: String, pub encoding: Encoding, pub faces: Vec<Face>, pub bounds: LonLatBounds, pub wmbounds: WMBounds, pub s2bounds: FaceBounds, pub minzoom: u8, pub maxzoom: u8, pub centerpoint: Center, pub attributions: Attributions, pub layers: LayersMetaData, pub tilestats: TileStatsMetadata, pub vector_layers: Vec<VectorLayer>, pub tilejson: Option<String>, pub tiles: Option<Vec<String>>, pub attribution: Option<String>, pub fillzoom: Option<u8>, pub center: Option<[f64; 3]>, pub data: Option<Vec<String>>, pub grids: Option<Vec<String>>, pub legend: Option<String>, pub template: Option<String>,
}
Expand description

§S2 TileJSON V1.0.0

let meta: Metadata =
  serde_json::from_str(meta_str).unwrap_or_else(|e| panic!("ERROR: {e}"));

Represents a TileJSON metadata object for the new S2 spec.

If you’re unsure of which spec you’re using, use the UnknownMetadata type.

S2TileJSON Spec

Fields§

§s2tilejson: String

The version of the s2-tilejson spec. Matches the pattern: ^\d+\.\d+\.\d+\w?[\w\d]*$.

§version: String

The version of the data. Matches the pattern: ^\d+\.\d+\.\d+\w?[\w\d]*$.

§name: String

The name of the data

§scheme: Scheme

The scheme of the data

§description: String

The description of the data

§type: SourceType

The type of the data

§extension: String

The extension to use when requesting a tile

§encoding: Encoding

The encoding of the data

§faces: Vec<Face>

List of faces that have data

§bounds: LonLatBounds

Bounding box array [west, south, east, north].

§wmbounds: WMBounds

WM Tile fetching bounds. Helpful to not make unecessary requests for tiles we know don’t exist

§s2bounds: FaceBounds

S2 Tile fetching bounds. Helpful to not make unecessary requests for tiles we know don’t exist

§minzoom: u8

minzoom at which to request tiles. [default=0]

§maxzoom: u8

maxzoom at which to request tiles. [default=27]

§centerpoint: Center

The center of the data

§attributions: Attributions

{ [‘human readable string’]: ‘href’ }

§layers: LayersMetaData

Track layer metadata

§tilestats: TileStatsMetadata

Track tile stats for each face and total overall

§vector_layers: Vec<VectorLayer>

Old spec but required for functional compatibility, track basic layer metadata

§tilejson: Option<String>

Version of the TileJSON spec used. Matches the pattern: ^\d+\.\d+\.\d+\w?[\w\d]*$.

§tiles: Option<Vec<String>>

Array of tile URL templates.

§attribution: Option<String>

Attribution string.

§fillzoom: Option<u8>

Fill zoom level. Must be between 0 and 30.

§center: Option<[f64; 3]>

Center coordinate array [longitude, latitude, zoom].

§data: Option<Vec<String>>

Array of data source URLs.

§grids: Option<Vec<String>>

Array of UTFGrid URL templates.

§legend: Option<String>

Legend of the tileset.

§template: Option<String>

Template for interactivity.

Trait Implementations§

Source§

impl Clone for Metadata

Source§

fn clone(&self) -> Metadata

Returns a duplicate of the value. Read more
1.0.0 · 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 PartialEq for Metadata

Source§

fn eq(&self, other: &Metadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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
Source§

impl StructuralPartialEq for Metadata

Auto Trait Implementations§

Blanket Implementations§

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,