Struct supercluster::Supercluster
source · pub struct Supercluster { /* private fields */ }Expand description
A spatial clustering configuration and data structure
Implementations§
source§impl Supercluster
impl Supercluster
sourcepub fn get_clusters(&self, bbox: [f64; 4], zoom: i32) -> Vec<Feature>
pub fn get_clusters(&self, bbox: [f64; 4], zoom: i32) -> Vec<Feature>
Retrieve clustered features within the specified bounding box and zoom level.
Arguments
bbox: The bounding box as an array of four coordinates [min_lng, min_lat, max_lng, max_lat].zoom: The zoom level at which to retrieve clusters.
Returns
A vector of GeoJSON features representing the clusters within the specified bounding box and zoom level.
sourcepub fn get_leaves(
&self,
cluster_id: usize,
limit: usize,
offset: usize
) -> Vec<Feature>
pub fn get_leaves( &self, cluster_id: usize, limit: usize, offset: usize ) -> Vec<Feature>
Retrieve individual leaf features within a cluster.
Arguments
cluster_id: The unique identifier of the cluster.limit: The maximum number of leaf features to retrieve.offset: The offset to start retrieving leaf features.
Returns
A vector of GeoJSON features representing the individual leaf features within the cluster.
sourcepub fn get_tile(&self, z: i32, x: f64, y: f64) -> Option<Tile>
pub fn get_tile(&self, z: i32, x: f64, y: f64) -> Option<Tile>
Retrieve a vector of features within a tile at the given zoom level and tile coordinates.
Arguments
z: The zoom level of the tile.x: The X coordinate of the tile.y: The Y coordinate of the tile.
Returns
An optional Tile containing a vector of GeoJSON features within the specified tile, or None if there are no features.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Supercluster
impl Send for Supercluster
impl Sync for Supercluster
impl Unpin for Supercluster
impl UnwindSafe for Supercluster
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