Skip to contents

This function reads a LAS file, assigns a new coordinate reference system (CRS) to both the point cloud and the AOI, clips the point cloud to the AOI, and optionally saves the clipped point cloud to a new LAS file.

Usage

cliping_cloud_to_aoi(las_path, aoi, folder, crs_def, save_las)

Arguments

las_path

Path to the input LAS file containing the point cloud data.

aoi

An sf object defining the Area of Interest to which the point cloud will be clipped.

folder

Path to the folder where the output LAS file will be saved, if saving is enabled.

crs_def

Coordinate Reference System definition to be applied to both the point cloud and the AOI.

save_las

Logical flag indicating whether to save the clipped point cloud to a new LAS file. Set to TRUE to save.

Value

Returns the clipped point cloud as a lidR las object.

Examples

if (FALSE) { # \dontrun{
# Assuming 'path_to_las', 'aoi_sf', 'output_folder', and 'crs_definition' are predefined:
clipped_las <- cliping_cloud_to_aoi("path_to_las", aoi_sf, "output_folder", "crs_definition", TRUE)
} # }