pub struct RasterTileFetcher<D: Clone + Default + GetRasterTileValue> { /* private fields */ }Available on crate feature
std only.Expand description
§Raster Tiles Fetcher
§Description
Read an entire archive of raster tiles, where the max zoom data is iterated upon
Supports reading either RGB(A) data, RGB(A) encoded elevation data, or build your own structure.
Implements the FeatureReader and TileFetcher traits
§Usage
The methods you have access to:
RasterTileFetcher::new: Create a new RasterTileFetcherRasterTileFetcher::get_metadata: Get the metadata of the tilesetRasterTileFetcher::has_tile_wm: Check if it is WM tileRasterTileFetcher::has_tile_s2: Check if it is S2 tileRasterTileFetcher::get_tile_wm: Get an WM tileRasterTileFetcher::get_tile_s2: Get an S2 tileRasterTileFetcher::iter: Iterate over the tiles
use gistools::{parsers::{RGBA, FeatureReader}, readers::{TileFetcher, RasterTileFetcher}};
use std::path::PathBuf;
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push("tests/readers/tile/fixtures/wm/satellite");
// read the RGBA data of each tile. Each pixel is stored as a VectorPoint
let reader = RasterTileFetcher::<RGBA>::new(path, Some(1));
let tiles: Vec<_> = reader.iter().collect();
assert_eq!(tiles.len(), 4);§Links
Trait Implementations§
Source§impl<D: Clone + Clone + Default + GetRasterTileValue> Clone for RasterTileFetcher<D>
impl<D: Clone + Clone + Default + GetRasterTileValue> Clone for RasterTileFetcher<D>
Source§fn clone(&self) -> RasterTileFetcher<D>
fn clone(&self) -> RasterTileFetcher<D>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<D: Debug + Clone + Default + GetRasterTileValue> Debug for RasterTileFetcher<D>
impl<D: Debug + Clone + Default + GetRasterTileValue> Debug for RasterTileFetcher<D>
Source§impl<D: Clone + Default + GetRasterTileValue> FeatureReader<TileMetadata, D, D> for RasterTileFetcher<D>
impl<D: Clone + Default + GetRasterTileValue> FeatureReader<TileMetadata, D, D> for RasterTileFetcher<D>
Source§type FeatureIterator<'a> = RasterIterator<'a, D>
where
Self: 'a
type FeatureIterator<'a> = RasterIterator<'a, D> where Self: 'a
The Feature Reader should implement an iterator of some kind
Source§fn iter(&self) -> Self::FeatureIterator<'_>
fn iter(&self) -> Self::FeatureIterator<'_>
All readers have an iter function that returns a Iterator struct
Source§impl<D: Clone + Default + GetRasterTileValue> TileFetcher<D, D, RasterTileReader<D>> for RasterTileFetcher<D>
impl<D: Clone + Default + GetRasterTileValue> TileFetcher<D, D, RasterTileReader<D>> for RasterTileFetcher<D>
Source§fn new<P: AsRef<Path>>(path: P, threshold: Option<u8>) -> RasterTileFetcher<D>
fn new<P: AsRef<Path>>(path: P, threshold: Option<u8>) -> RasterTileFetcher<D>
Creates a new file reader from a file path
Source§fn get_metadata(&self) -> &Metadata
fn get_metadata(&self) -> &Metadata
Get the Tile Store’s Metadata
Source§fn has_tile_s2(&self, face: Face, zoom: u8, x: u32, y: u32) -> bool
fn has_tile_s2(&self, face: Face, zoom: u8, x: u32, y: u32) -> bool
Check if an S2 Geometry tile exists
Source§fn get_tile_wm(&self, zoom: u8, x: u32, y: u32) -> RasterTileReader<D>
fn get_tile_wm(&self, zoom: u8, x: u32, y: u32) -> RasterTileReader<D>
Get a WebMercator tile
Source§fn get_tile_s2(
&self,
face: Face,
zoom: u8,
x: u32,
y: u32,
) -> RasterTileReader<D>
fn get_tile_s2( &self, face: Face, zoom: u8, x: u32, y: u32, ) -> RasterTileReader<D>
Get an S2 Geometry tile
Auto Trait Implementations§
impl<D> Freeze for RasterTileFetcher<D>
impl<D> RefUnwindSafe for RasterTileFetcher<D>where
D: RefUnwindSafe,
impl<D> Send for RasterTileFetcher<D>where
D: Send,
impl<D> Sync for RasterTileFetcher<D>where
D: Sync,
impl<D> Unpin for RasterTileFetcher<D>where
D: Unpin,
impl<D> UnwindSafe for RasterTileFetcher<D>where
D: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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>
Converts
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>
Converts
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