0

Is there a way to export a *.las point cloud in R to a orthomosaic? I loaded my las-file containing the points with the package lidR. I want to export a tif which shows the point cloud from above in RGB, similar to what an orthophoto would look like. The data was collected using a terrestrial laser scanner.

point cloud

this is what I want

4

1 回答 1

1

好的,所以我想出了如何做到这一点,虽然它不是很优雅:

# load data
points <- readLAS(input_path)

# returns the RGB values for the highest points
RGBZ <- function(r,g,b,z) {
  bands = list(
    R = r[which.max(z)],
    G = g[which.max(z)],
    B = b[which.max(z)]
  )
  return(bands)
}

# create & save ortho
ortho <- grid_metrics(points, ~RGBZ(R,G,B,Z), res = 0.1)
writeRaster(ortho, output_path)
于 2021-03-29T12:20:37.927 回答