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: StringXYZ 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: OnMissingWhat 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: boolIf 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: f32Value subtracted from each decoded sample (metres). Useful for rebasing geoid-relative datasets.