find_las_centroid: Find centroid of large *.las

View source: R/clip_lidR_ctgs.R

find_las_centroidR Documentation

Find centroid of large *.las

Description

This function takes a lidR::LAS object, and reads it in quickly by dropping most points using subsample. The function returns an sf::POINT object containing the coordinates of the centroid. Note that centroid is only approximate and may be imprecise if subsample is large (i.e., > 1000) or LAS point density is low.

Usage

find_las_centroid(las, subsample = 1e+05)

Arguments

las

a lidR::LAS object for which you want to find a centroid

subsample

drop every nth return to speed up processing time

Examples

# Load large LAS file and identify the centroid (i.e., scan location)
library(lidR)
library(sf)
#' las = readLAS('large_las_file.las')
cent = find_las_centroid(las)
plot(cent$geom)

jbcannon/landecoutils documentation built on July 16, 2025, 10:17 p.m.