filters.divider#

The Divider Filter breaks a point view into a set of smaller point views based on criteria. The filter supports three modes – partition, round_robin, and expression. With partition mode, the number of subsets can be specified explicitly. round_robin allows you to specify a maximum point count for each subset. Finally, expression mode breaks up the point view based on a given expression and count.

Points can be divided into subsets to facilitate output by writers that support creating multiple output files with a template (LAS and BPF are notable examples).

Default Embedded Stage

This stage is enabled by default

partition Example#

This pipeline will create 10 output files from the input file readers.las.

[
    "example.las",
    {
        "type":"filters.divider",
        "count":"10"
    },
    {
        "type":"writers.las",
        "filename":"out_#.las"
    }
]

round_robin Example#

This pipeline will create 10 output files where each consecutive point is inserted into a new view.

[
    "example.las",
    {
        "type":"filters.divider",
        "mode":"round_robin",
        "count":"10"
    },
    {
        "type":"writers.las",
        "filename":"out_#.las"
    }
]

expression Example#

This pipeline will create a new view every time a point that satisfies the expression UserData == 122 is encountered. Use in combination with filters.sort to control ordering of points to determine split locations.

[
    "example.las",
    {
        "type":"filters.divider",
        "expression":"UserData == 122"
    },
    {
        "type":"writers.las",
        "filename":"out_#.las"
    }
]

Options#

mode

A mode of partition will write sequential points to an output view until the view meets its predetermined size. round_robin mode will iterate through the output views as it writes sequential points. expression will iterate write sequential points into an output view until the view meets the expression and count size. [Default: “partition”]

count

Number of output views. [Default: none]

capacity

Maximum number of points in each output view. Views will contain approximately equal numbers of points. [Default: none]

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 or if no views are returned, placed in their own view. 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, otherwise the skipped points are placed in their own view.

[Default: auto]

Warning

You must specify exactly one of either [count] or [capacity].