pub struct Supercluster {
pub points: Vec<Feature>,
/* private fields */
}Expand description
A spatial clustering configuration and data structure.
Fields§
§points: Vec<Feature>Input data points.
Implementations§
Source§impl Supercluster
impl Supercluster
Sourcepub fn get_clusters(&self, bbox: [f64; 4], zoom: u8) -> Vec<Feature>
pub fn get_clusters(&self, bbox: [f64; 4], zoom: u8) -> 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: u8, x: f64, y: f64) -> Option<FeatureCollection>
pub fn get_tile(&self, z: u8, x: f64, y: f64) -> Option<FeatureCollection>
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§
Source§impl Clone for Supercluster
impl Clone for Supercluster
Source§fn clone(&self) -> Supercluster
fn clone(&self) -> Supercluster
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for Supercluster
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