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

Zoe
  • 906
  • 4
  • 15
  • This chapter of the book might help you https://jean-romain.github.io/lidRbook/outbox.html#outbox-multispectral-coloring. There is not a single way to achieve that so you must be more specific on how you want to aggregate your point cloud. – JRR Mar 28 '21 at 19:07

1 Answers1

1

Okay, so I figured out how to do it, although it's not very elegant:

# 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)
Zoe
  • 906
  • 4
  • 15