# filters.returns

The Returns Filter takes a single PointView as its input and creates a `PointView` for each of the user-specified groups defined below.

“first” is defined as those points whose `ReturnNumber` is 1 when the `NumberOfReturns` is greater than 1.

“intermediate” is defined as those points whose `ReturnNumber` is greater than 1 and less than `NumberOfReturns` when `NumberOfReturns` is greater than 2.

“last” is defined as those points whose `ReturnNumber` is equal to `NumberOfReturns` when `NumberOfReturns` is greater than 1.

“only” is defined as those points whose `NumberOfReturns` is 1.

Default Embedded Stage

This stage is enabled by default

## Example

This example creates two separate output files for the “last” and “only” returns.

    [
        "input.las",
        {
            "type":"filters.returns",
            "groups":"last,only"
        },
        "output_#.las"
    ]

## Options

groups

  Comma-separated list of return number groupings. Valid options are “first”, “last”, “intermediate” or “only”. [Default: “last”]

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`]