pub struct TarTilesReader { /* private fields */ }Expand description
Reader for tiles stored inside a tar archive.
Merges TileJSON from recognized metadata files, builds a map from {z,x,y} to
byte ranges within the archive, infers uniform format/compression, and exposes
tiles via TileSource.
Implementations§
Source§impl TarTilesReader
impl TarTilesReader
Sourcepub fn open_path(path: &Path) -> Result<TarTilesReader>
pub fn open_path(path: &Path) -> Result<TarTilesReader>
Open a tar archive and build an index of tiles and metadata.
Scans regular entries in the archive, recognizing:
- tiles at
{z}/{x}/{y}.<format>[.<compression>] - metadata files:
meta.json,tiles.json,metadata.json(optionally.gz/.br)
Determines a uniform tile format and compression, and computes a bbox pyramid from discovered coordinates.
§Errors
Returns an error if the file cannot be opened, if no tiles are found, or if mixed formats/compressions are encountered.
Trait Implementations§
Source§impl Debug for TarTilesReader
impl Debug for TarTilesReader
Source§impl TileSource for TarTilesReader
impl TileSource for TarTilesReader
Source§fn metadata(&self) -> &TileSourceMetadata
fn metadata(&self) -> &TileSourceMetadata
Returns the parameters of the tiles reader.
Source§fn get_tile<'life0, 'life1, 'async_trait>(
&'life0 self,
coord: &'life1 TileCoord,
) -> Pin<Box<dyn Future<Output = Result<Option<Tile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tile<'life0, 'life1, 'async_trait>(
&'life0 self,
coord: &'life1 TileCoord,
) -> Pin<Box<dyn Future<Output = Result<Option<Tile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch a single tile by XYZ coordinate.
Looks up the coordinate in the prebuilt index and reads the corresponding byte range
from the underlying DataReaderFile. Returns Ok(None) if the tile is absent.
§Errors
Propagates I/O errors while reading the tar entry.
Source§fn source_type(&self) -> Arc<SourceType>
fn source_type(&self) -> Arc<SourceType>
Source§fn get_tile_stream<'life0, 'async_trait>(
&'life0 self,
bbox: TileBBox,
) -> Pin<Box<dyn Future<Output = Result<TileStream<'_, Tile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_tile_stream<'life0, 'async_trait>(
&'life0 self,
bbox: TileBBox,
) -> Pin<Box<dyn Future<Output = Result<TileStream<'_, Tile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream_individual_tiles<'life0, 'async_trait>(
&'life0 self,
bbox: TileBBox,
) -> Pin<Box<dyn Future<Output = Result<TileStream<'_, Tile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for TarTilesReader
impl RefUnwindSafe for TarTilesReader
impl Send for TarTilesReader
impl Sync for TarTilesReader
impl Unpin for TarTilesReader
impl UnwindSafe for TarTilesReader
Blanket Implementations§
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.