GridBasedAlgorithm

Groups markers into a grid for clustering. This algorithm organizes items into a two-dimensional grid, facilitating the formation of clusters based on proximity within each grid cell. The grid size determines the spatial granularity of clustering, and clusters are created by aggregating items within the same grid cell.

The effectiveness of clustering is influenced by the specified grid size, which determines the spatial resolution of the grid. Smaller grid sizes result in more localized clusters, whereas larger grid sizes lead to broader clusters covering larger areas.

Parameters

<T>

The type of ClusterItem to be clustered.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun addItem(item: T): Boolean
Adds an item to the algorithm
Link copied to clipboard
open fun addItems(items: Collection<T>): Boolean
Adds a collection of items to the algorithm
Link copied to clipboard
open fun clearItems()
Link copied to clipboard
open fun getClusters(zoom: Float): Set<out Cluster<T>>
Link copied to clipboard
open fun getItems(): Collection<T>
Link copied to clipboard
open fun lock()
Link copied to clipboard
open fun removeItem(item: T): Boolean
Removes an item from the algorithm
Link copied to clipboard
open fun removeItems(items: Collection<T>): Boolean
Removes a collection of items from the algorithm
Link copied to clipboard
Link copied to clipboard
open fun unlock()
Link copied to clipboard
open fun updateItem(item: T): Boolean
Updates the provided item in the algorithm