filters.lloydkmeans#
K-means clustering using Lloyd’s algorithm labels each point with its associated cluster ID (starting at 0).
New in version 2.1.
Example#
[
"input.las",
{
"type":"filters.lloydkmeans",
"k":10,
"maxiters":20,
"dimensions":"X,Y,Z"
},
{
"type":"writers.las",
"filename":"output.laz",
"minor_version":4,
"extra_dims":"all"
}
]
Options#
- k
The desired number of clusters. [Default: 10]
- maxiters
The maximum number of iterations. [Default: 10]
- dimensions
Comma-separated string indicating dimensions to use for clustering. [Default: X,Y,Z]
- where
An expression that limits points passed to a filter. Points that don’t pass the expression skip the stage but are available to subsequent stages in a pipeline. [Default: no filtering]
- where_merge
A strategy for merging points skipped by a
where
option when running in standard mode. Iftrue
, the skipped points are added to the first point view returned by the skipped filter. Iffalse
, skipped points are placed in their own point view. Ifauto
, skipped points are merged into the returned point view provided that only one point view is returned and it has the same point count as it did when the filter was run. [Default:auto
]