QGIS Algorithm provided by QGIS (native c++) K-means clustering (native:kmeansclustering). Calculates the 2D distance based k-means cluster number for each input feature. This algorithm calculates the 2D distance based k-means cluster number for each input feature. If input geometries are lines or polygons, the clustering is based on the centroid of the feature. References: Arthur, David & Vassilvitskii, Sergei. (2007). K-Means++: The Advantages of Careful Seeding. Proc. of the Annu. ACM-SIAM Symp. on Discrete Algorithms. 8. Bhattacharya, Anup & Eube, Jan & Röglin, Heiko & Schmidt, Melanie. (2019). Noisy, Greedy and Not So Greedy k-means++
qgis_kmeansclustering(
INPUT = qgisprocess:::qgis_default_value(),
CLUSTERS = qgisprocess:::qgis_default_value(),
METHOD = qgisprocess:::qgis_default_value(),
FIELD_NAME = qgisprocess:::qgis_default_value(),
SIZE_FIELD_NAME = qgisprocess:::qgis_default_value(),
OUTPUT = qgisprocess:::qgis_default_value(),
...,
.complete_output = .complete_output_option(),
.quiet = .quiet_option(),
.messages = .message_option()
)source - Input layer. Path to a vector layer.
number - Number of clusters. A numeric value. field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field. expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression.
enum of ("Farthest points", "K-means++") - Method. Number of selected option, e.g. '1'. Comma separated list of options, e.g. '1,3'.
string - Cluster field name. String value. field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field. expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression.
string - Cluster size field name. String value. field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field. expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression.
sink - Clusters. Path for new vector layer.
further parameters passed to qgisprocess::qgis_run_algorithm()
logical specifying if complete out of qgisprocess::qgis_run_algorithm() should be used (TRUE) or first output (most likely the main) should read (FALSE). Default value is TRUE.
logical specifying if parameter .quiet for qgisprocess::qgis_run_algorithm() Default value is TRUE.
logical specifying if messages from qgisprocess::qgis_run_algorithm() should be printed (TRUE) or not (FALSE). Default value is FALSE.