I have five LAScatalog
objects from five different subfolders present in the same parent folder. I would like to plot them together on an interactive Leaflet
plot using lidR
?
Please note that I know I can copy all the files into one folder, but the files are too many and R
cannot handle those many points even though I do have 64 GB RAM.
How can I do this?
Sample Code:
library(lidR)
# Import the list of LAS files in the folder
FL_LAS_List = readLAScatalog("ParentFolder/SubFolder1")
BC_LAS_List_NE = readLAScatalog("ParentFolder/SubFolder2")
BC_LAS_List_NW = readLAScatalog("ParentFolder/SubFolder3")
BC_LAS_List_SW = readLAScatalog("ParentFolder/SubFolder4")
BC_LAS_List_SE = readLAScatalog("ParentFolder/SubFolder5")
# Plot individual LAS objects
plot(FL_LAS_List, mapview = TRUE,
map.type = "OpenStreetMap")
# Plot all five LAS catalog objects on a single map using the above plot code
# Stuck!!!....
Best Answer
I can see two options here.
Use only one collection
Either using
or reading the files recursively from subfolders with
Cast each catalog into
sf
objectsThen use
mapview
or other packages likeleaflet