pub struct DemAdapter {
pub id: &'static str,
pub endpoint: String,
pub zoom: u8,
}Expand description
Public, global elevation tiles in Terrarium’s 24-bit RGB elevation encoding.
endpoint is an XYZ template ({z}, {x}, {y}); a bare base URL passed to
new gets /terrarium/{z}/{x}/{y}.png appended for compatibility.
Fields§
§id: &'static str§endpoint: String§zoom: u8Implementations§
Source§impl DemAdapter
impl DemAdapter
Sourcepub fn terrarium(id: &'static str) -> Self
pub fn terrarium(id: &'static str) -> Self
Creates an adapter preset for the Terrarium tile endpoint.
Sourcepub fn with_zoom(self, zoom: u8) -> Result<Self, String>
pub fn with_zoom(self, zoom: u8) -> Result<Self, String>
Builder: pins the zoom level; error when out of range.
Sourcepub fn adapter_id(&self) -> &'static str
pub fn adapter_id(&self) -> &'static str
Stable adapter identifier.
Sourcepub fn estimate_tile_count(&self, bbox: (f64, f64, f64, f64)) -> u32
pub fn estimate_tile_count(&self, bbox: (f64, f64, f64, f64)) -> u32
Estimated tiles covering bbox at the configured zoom.
Sourcepub fn build_fetch_requests(
&self,
bbox: (f64, f64, f64, f64),
registry: &NetworkDisclosureRegistry,
) -> Result<Vec<AdapterHttpRequest>, String>
pub fn build_fetch_requests( &self, bbox: (f64, f64, f64, f64), registry: &NetworkDisclosureRegistry, ) -> Result<Vec<AdapterHttpRequest>, String>
Build every tile request needed to cover the requested geographic extent. Consent is checked against each expanded URL before requests are returned.
Sourcepub fn build_fetch_request(
&self,
bbox: (f64, f64, f64, f64),
_time_range: (u64, u64),
registry: &NetworkDisclosureRegistry,
) -> Result<AdapterHttpRequest, String>
pub fn build_fetch_request( &self, bbox: (f64, f64, f64, f64), _time_range: (u64, u64), registry: &NetworkDisclosureRegistry, ) -> Result<AdapterHttpRequest, String>
Compatibility with the single-request adapter trait. Use
build_fetch_requests for the complete extent; a bounding box can cross
tile boundaries and therefore require several requests.
Sourcepub fn fetch_region_dem(
&self,
bbox: (f64, f64, f64, f64),
registry: &NetworkDisclosureRegistry,
) -> Result<DemTerrainAsset, String>
pub fn fetch_region_dem( &self, bbox: (f64, f64, f64, f64), registry: &NetworkDisclosureRegistry, ) -> Result<DemTerrainAsset, String>
Fetch, decode, mosaic, georeference, and compile a DEM region on native targets.
Trait Implementations§
Source§impl DataAdapter for DemAdapter
impl DataAdapter for DemAdapter
Source§fn adapter_id(&self) -> &'static str
fn adapter_id(&self) -> &'static str
Registered adapter identifier (self.id).
Source§fn build_fetch_request(
&self,
bbox: (f64, f64, f64, f64),
time_range: (u64, u64),
registry: &NetworkDisclosureRegistry,
) -> Result<AdapterHttpRequest, String>
fn build_fetch_request( &self, bbox: (f64, f64, f64, f64), time_range: (u64, u64), registry: &NetworkDisclosureRegistry, ) -> Result<AdapterHttpRequest, String>
Build the Terrarium tile request via the inherent helper.
Source§fn needs_fetch_body(&self) -> bool
fn needs_fetch_body(&self) -> bool
DEM responses are binary — the body must be consumed.
Source§fn requires_specialized_fetch_path(&self) -> bool
fn requires_specialized_fetch_path(&self) -> bool
Binary PNG terrain can’t go through the text pipeline.
Source§fn handle_fetch_body(&self, _body: &str) -> Result<(), String>
fn handle_fetch_body(&self, _body: &str) -> Result<(), String>
Fail-closed: Terrarium responses are binary PNG; the typed DEM fetch methods decode them.
Source§fn fetch_region(
&self,
bbox: (f64, f64, f64, f64),
_time_range: (u64, u64),
registry: &NetworkDisclosureRegistry,
) -> Result<(), String>
fn fetch_region( &self, bbox: (f64, f64, f64, f64), _time_range: (u64, u64), registry: &NetworkDisclosureRegistry, ) -> Result<(), String>
Native: delegates to fetch_region_dem and discards the asset.
wasm32: fail-closed, directs callers to fetch_region_dem_async.
Source§fn fetch_region_features(
&self,
bbox: (f64, f64, f64, f64),
_time_range: (u64, u64),
registry: &NetworkDisclosureRegistry,
) -> Result<Vec<NQuin>, String>
fn fetch_region_features( &self, bbox: (f64, f64, f64, f64), _time_range: (u64, u64), registry: &NetworkDisclosureRegistry, ) -> Result<Vec<NQuin>, String>
Native: fetch_region_dem compiled to NQuins. wasm32:
fail-closed, directs callers to fetch_region_dem_async.
Source§fn parse_response(&self, _body: &str) -> Result<Vec<NQuin>, String>
fn parse_response(&self, _body: &str) -> Result<Vec<NQuin>, String>
Fail-closed: binary PNG cannot be parsed as text.
Source§fn primary_endpoint(&self) -> &str
fn primary_endpoint(&self) -> &str
Endpoint URL with the {z} tile template truncated.
Auto Trait Implementations§
impl Freeze for DemAdapter
impl RefUnwindSafe for DemAdapter
impl Send for DemAdapter
impl Sync for DemAdapter
impl Unpin for DemAdapter
impl UnsafeUnpin for DemAdapter
impl UnwindSafe for DemAdapter
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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