pub struct GeospatialCache { /* private fields */ }Expand description
Geospatial cache for map tiles and geospatial data.
Implementations§
Source§impl GeospatialCache
impl GeospatialCache
Sourcepub fn new(config: GeospatialCacheConfig) -> Self
pub fn new(config: GeospatialCacheConfig) -> Self
Create a new geospatial cache.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a geospatial cache with default configuration.
Sourcepub async fn cache_tile(&self, coord: &TileCoord, url: &str) -> Result<Response>
pub async fn cache_tile(&self, coord: &TileCoord, url: &str) -> Result<Response>
Cache a map tile.
Sourcepub async fn prefetch_tiles(
&self,
bbox: &BoundingBox,
zoom_range: Range<u32>,
base_url: &str,
) -> Result<Vec<TileCoord>>
pub async fn prefetch_tiles( &self, bbox: &BoundingBox, zoom_range: Range<u32>, base_url: &str, ) -> Result<Vec<TileCoord>>
Prefetch tiles for a bounding box and zoom range.
Sourcepub fn get_tiles_in_bbox(&self, bbox: &BoundingBox, zoom: u32) -> Vec<TileCoord>
pub fn get_tiles_in_bbox(&self, bbox: &BoundingBox, zoom: u32) -> Vec<TileCoord>
Get all tile coordinates that intersect a bounding box at a given zoom.
Sourcepub async fn cache_vector_data(&self, url: &str, data: &Response) -> Result<()>
pub async fn cache_vector_data(&self, url: &str, data: &Response) -> Result<()>
Cache vector data (GeoJSON, etc.).
Sourcepub async fn get_vector_data(&self, url: &str) -> Result<Option<Response>>
pub async fn get_vector_data(&self, url: &str) -> Result<Option<Response>>
Get cached vector data.
Sourcepub async fn cache_raster_data(&self, url: &str, data: &Response) -> Result<()>
pub async fn cache_raster_data(&self, url: &str, data: &Response) -> Result<()>
Cache raster data (COG, GeoTIFF, etc.).
Sourcepub async fn get_raster_data(&self, url: &str) -> Result<Option<Response>>
pub async fn get_raster_data(&self, url: &str) -> Result<Option<Response>>
Get cached raster data.
Sourcepub async fn clear_tiles(&self) -> Result<()>
pub async fn clear_tiles(&self) -> Result<()>
Clear tile cache.
Sourcepub async fn clear_vector(&self) -> Result<()>
pub async fn clear_vector(&self) -> Result<()>
Clear vector cache.
Sourcepub async fn clear_raster(&self) -> Result<()>
pub async fn clear_raster(&self) -> Result<()>
Clear raster cache.
Sourcepub fn config(&self) -> &GeospatialCacheConfig
pub fn config(&self) -> &GeospatialCacheConfig
Get the configuration.
Auto Trait Implementations§
impl Freeze for GeospatialCache
impl RefUnwindSafe for GeospatialCache
impl Send for GeospatialCache
impl Sync for GeospatialCache
impl Unpin for GeospatialCache
impl UnsafeUnpin for GeospatialCache
impl UnwindSafe for GeospatialCache
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
Mutably borrows from an owned value. Read more