# clustersKmeans

Takes a set of points and partition them into clusters using the k-mean. It uses the k-means algorithm
取一组点,并使用k-mean将它们划分为集群。它使用 K均值聚类算法


参数 类型 描述
points FeatureCollection <Point> to be clustered
options Object Optional parameters: see below


属性 类型 默认值 描述
numberOfClusters number Math.sqrt(numberOfPoints/2) numberOfClusters that will be generated
mutate boolean false allows GeoJSON input to be mutated (significant performance increase if true)


FeatureCollection <Point> - Clustered Points with an additional two properties associated to each Feature:


// create random points with random z-values in their properties
var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});
var options = {numberOfClusters: 7};
var clustered = turf.clustersKmeans(points, options);
Last Updated: 1/19/2021, 10:59:20 AM