pub struct Supercluster { /* private fields */ }
Expand description

A spatial clustering configuration and data structure

Implementations§

source§

impl Supercluster

source

pub fn new(options: Options) -> Self

Create a new Supercluster instance with the specified configuration settings

source

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

source

pub fn get_clusters(&self, bbox: [f64; 4], zoom: i32) -> Vec<Feature>

Retrieve clustered features within the specified bounding box and zoom level

source

pub fn get_children( &self, cluster_id: usize ) -> Result<Vec<Feature>, &'static str>

Retrieve the cluster features for a specified cluster ID

source

pub fn get_leaves( &self, cluster_id: usize, limit: usize, offset: usize ) -> Vec<Feature>

Retrieve individual leaf features within a cluster

source

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

source

pub fn get_cluster_expansion_zoom(&self, cluster_id: usize) -> usize

Determine the zoom level at which a specific cluster expands

Trait Implementations§

source§

impl Debug for Supercluster

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.