filters.lloydkmeans

Contents

filters.lloydkmeans#

K-means clustering using Lloyd’s algorithm labels each point with its associated cluster ID (starting at 0).

Default Embedded Stage

This stage is enabled by default

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. If true, the skipped points are added to the first point view returned by the skipped filter. If false, skipped points are placed in their own point view. If auto, 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]