Skip to main content

DemSource

Struct DemSource 

Source
pub struct DemSource {
    pub url: String,
    pub encoding: DemEncoding,
    pub on_missing: OnMissing,
    pub attribution: Option<String>,
    pub tile_size: u32,
    pub max_zoom: Option<u8>,
    pub neighbor_fetch: bool,
    pub elevation_offset: f32,
}
Expand description

Raster-DEM source. Tiles encode elevation in the RGB channels using either the Mapzen / Terrarium scheme (h = (R*256 + G + B/256) - 32768) or the Mapbox / MapLibre Terrain-RGB scheme (h = -10000 + (R*65536 + G*256 + B) * 0.1).

Fields§

§url: String

XYZ URL template with {z}, {x}, {y} placeholders, or a TileJSON document URL (anything ending in .json). PNG and WebP tiles are both supported (sniffed from content).

§encoding: DemEncoding§on_missing: OnMissing

What a 404 within the zoom range means — empty (zero elevation), upsample from a parent, or fail the render.

§attribution: Option<String>

Explicit attribution. When absent and url is a TileJSON, hosts inherit its attribution field.

§tile_size: u32§max_zoom: Option<u8>

Highest zoom available from the source. Requests above this zoom overzoom from an ancestor tile.

§neighbor_fetch: bool

If true, fetch the 8 neighbouring tiles in addition to the centre tile and stitch them so gradient-based ops (e.g. hillshade) have seam-free samples in the pad region.

§elevation_offset: f32

Value subtracted from each decoded sample (metres). Useful for rebasing geoid-relative datasets.

Trait Implementations§

Source§

impl Clone for DemSource

Source§

fn clone(&self) -> DemSource

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 DemSource

Source§

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

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

impl<'de> Deserialize<'de> for DemSource

Source§

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

Deserialize this value from the given Serde deserializer. Read more

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> 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, 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.