lidR (version 1.4.1)

lasclip: Clip LiDAR points

Description

Clip LiDAR points within a given geometry and convenient wrappers for most common geometries

Usage

lasclip(x, geometry, ofile = "")

lasclipRectangle(x, xleft, ybottom, xright, ytop, ofile = "")

lasclipPolygon(x, xpoly, ypoly, ofile = "")

lasclipCircle(x, xcenter, ycenter, radius, ofile = "")

Arguments

x

An object of class LAS or LAScatalog.

geometry

a geometric object. Currently Polygon from sp is supported.

ofile

character. Path to an output file (only with a LAScatalog). If ofile = "" the result is loaded into R, otherwise the result is written to a file while reading. This is much more memory efficient than loading into R first, then writing.

xleft

scalar of left x position of rectangle.

ybottom

scalar of bottom y position of rectangle.

xright

scalar of right x position of rectangle.

ytop

scalar of top y position of rectangle.

xpoly

numerical array. x-coordinates of polygon.

ypoly

numerical array. y-coordinates of polygon.

xcenter

scalar of x disc center.

ycenter

scalar of y disc center.

radius

scalar of disc radius.

Value

An object of class LAS or NULL if the result is immediately written to a file.

Examples

Run this code
# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las = readLAS(LASfile)
subset = lasclipRectangle(las, 684850, 5017850, 684900, 5017900)
plot(subset)
# }

Run the code above in your browser using DataCamp Workspace