Merge overlaid las files #737
-
Hi everyone, I have two registered las files that I am attempting to merge. Is there a recommended way to do this within the lidR package? Currently, I have come up with the following but this method is slow for pairs of large tls las files (>3 gb): library(lidR)
las1 <- LAS(data = data.frame(
X = runif(100, 1, 10),
Y = runif(100, 1, 10),
Z = runif(100, 1, 10)
))
las2 <- LAS(data = data.frame(
X = runif(100, 1, 10),
Y = runif(100, 1, 10),
Z = runif(100, 20, 30)
))
merge_df <- rbind(las1@data, las2@data)
merge_las <- LAS(merge_df)
Thank you! I really appreciate any suggestions. Sean |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can use the ctg = readLAScatalog(...)
opt_chunk_size(ctg) = 2000 #large enough to encompass your tiles
opt_chunk_alignment(ctg) = c(...) # may be required to make only one chunk
plot(ctg, chunk = T) # to check if there is only one chunk
new_ctg = catalog_retile(ctg) This should use very little memory. Yet the output file will be large. You can also have a look to my new package |
Beta Was this translation helpful? Give feedback.
You can use the
catalog_retile
being clever on how to make chunksThis should use very little memory. Yet the output file will be large.
You can also have a look to my new package
lasR
. There is merge file section in the tutorial https://r-lidar.github.io/lasR/articles/lasR2.html#write-las