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 new(options: Options) -> Self
pub fn new(options: Options) -> Self
Create a new Supercluster instance with the specified configuration settings
sourcepub fn load(&mut self, points: Vec<Feature>) -> &mut Self
pub fn load(&mut self, points: Vec<Feature>) -> &mut Self
Load the input GeoJSON points into the Supercluster instance, performing clustering at various zoom levels
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
sourcepub fn get_children(
&self,
cluster_id: usize
) -> Result<Vec<Feature>, &'static str>
pub fn get_children( &self, cluster_id: usize ) -> Result<Vec<Feature>, &'static str>
Retrieve the cluster features for a specified cluster ID
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
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
sourcepub fn get_cluster_expansion_zoom(&self, cluster_id: usize) -> usize
pub fn get_cluster_expansion_zoom(&self, cluster_id: usize) -> usize
Determine the zoom level at which a specific cluster expands
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