## Description

This tool can be used to extract a subset of points from an input LiDAR point cloud (`input_lidar`) that satisfy a `query` relation with a user-specified raster reference surface (`ref_surface`). For example, you may use this function to extract all of the points that are below (`query="<"` or `query="<="`) or above (`query=">"` or `query=">="`) a surface model. The default query mode is "within" (i.e. `query="within"`), which extracts all of the points that are within a specified absolute vertical distance (`threshold`) of the surface. Notice that the `threshold` parameter is ignored for query types other than "within".

By default, the function will return a point cloud containing only the subset of points in the input dataset that satisfy the condition of the query. Setting the `classify` parameter to True modifies this behaviour such that the output point cloud will contain all of the points within the input dataset, but will have the classification value of the query-satifying points will be set to the `true_class_value` parameter (0-255) and points that do not satisfy the query will be assigned the `false_class_value` (0-255). By setting the `preserve_classes` paramter to True, all points that do not satisfy the query will have unmodified class values from the input dataset.

Unlike many of the LiDAR functions, this function does not have a batch mode and operates on single tiles only.

## See Also

filter_lidar

## Function Signature

`def filter_lidar_by_reference_surface(self, input_lidar: Lidar, ref_surface: Raster, query: str = "within", threshold: float = 0.0) -> Lidar: ...`

## Project Links

WbW Homepage User Manual Support WbW