mosaic.operations.cluster#
- cluster(geometry, method, drop_noise=False, use_points=True, use_normals=False, **kwargs)[source]#
Partition points into clusters.
- Parameters:
- geometryGeometry or GeometryData
Input data.
- methodstr
Clustering method to use. Options are: - ‘Connected Components’ : Connected components by spatial proximity - ‘Envelope’ : Envelope-based connected components - ‘Leiden’ : Leiden graph-based clustering - ‘DBSCAN’ : DBSCAN density-based clustering - ‘K-Means’ : K-Means partitioning - ‘Birch’ : Birch hierarchical clustering
- drop_noisebool, optional
If True, drop noise points (label -1) from results. Default is False.
- use_pointsbool, optional
If True, use point coordinates for clustering. Default is True.
- use_normalsbool, optional
If True, include normal vectors in clustering features. Default is False.
- **kwargs
Additional arguments passed to the chosen clustering method.
- Returns:
- List[
mosaic.geometry.GeometryData] List of geometries, one per cluster.
- List[
- Raises:
- ValueError
If unsupported clustering method is specified or too many clusters found.