pub struct RasterTile {
pub x: u32,
pub y: u32,
pub zoom: u8,
pub data: Vec<u8>,
}Expand description
A single raster tile at a specific zoom level and tile coordinate.
Follows the XYZ / WMTS slippy-map convention used by web mapping libraries (Leaflet, MapLibre, OpenLayers, etc.).
Fields§
§x: u32Tile column index (0 … 2^zoom − 1, left to right)
y: u32Tile row index (0 … 2^zoom − 1, top to bottom)
zoom: u8Zoom level (0 = world overview, higher = more detail)
data: Vec<u8>Raw tile image bytes (PNG, JPEG, WebP, etc.)
Implementations§
Source§impl RasterTile
impl RasterTile
Sourcepub fn tiles_per_axis(zoom: u8) -> u32
pub fn tiles_per_axis(zoom: u8) -> u32
Return the number of tiles per axis at this zoom level: 2^zoom.
Saturates at u32::MAX for zoom ≥ 32 (which is never useful in
practice, but avoids overflow).
Sourcepub fn normalised_bbox(&self) -> (f64, f64, f64, f64)
pub fn normalised_bbox(&self) -> (f64, f64, f64, f64)
Return the normalised bounding box (min_x, min_y, max_x, max_y) for
this tile, where coordinates are in the range [0.0, 1.0].
Useful for converting to geographic coordinates when combined with the
dataset’s crate::DatasetInfo::geotransform.
Trait Implementations§
Source§impl Clone for RasterTile
impl Clone for RasterTile
Source§fn clone(&self) -> RasterTile
fn clone(&self) -> RasterTile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RasterTile
impl Debug for RasterTile
impl Eq for RasterTile
Source§impl PartialEq for RasterTile
impl PartialEq for RasterTile
impl StructuralPartialEq for RasterTile
Auto Trait Implementations§
impl Freeze for RasterTile
impl RefUnwindSafe for RasterTile
impl Send for RasterTile
impl Sync for RasterTile
impl Unpin for RasterTile
impl UnsafeUnpin for RasterTile
impl UnwindSafe for RasterTile
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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