1

I am trying to use catalog_apply on a LAScatalog of 151 las tiles for my research. I have experimented with a catalog of 10 of these tiles, and with automerge = TRUE, the catalog_apply returns a huge and cumbersome las file, not a LASCatalog. I cannot use this huge las file to create a dem or anything because it crashes even the GIS computers in our computer lab. And this is just from 10 of the tiles! I dread to think of what would happen if I try to give the catalog of all 151 to the catalog_apply function.

My question is, is there some way that catalog_apply can ever return a LASCatalog, not a las file? This will be essential for me to use all 151 las tiles.

0

1 Answer 1

0

By default the engine returns in memory what the user's function returns and merge everything in memory. Your function returns LAS objects so every objects are added successively in memory one after the other. This is indeed a bad idea as you noticed.

The LAScatalog processing engine has the capability to put each output in files instead of in memory. You must redirect the output to files using a templated path such as:

opt_output_files(ctg) <- "/directory/{ORIGINALFILENAME}_normalized"
# or
opt_output_files(ctg) <- "/directory/{XLEFT}_{YBOTTOM}"

If LAS files are written the output will automatically be a LAScatalog if automerge = TRUE.

See also

1
  • That worked great! All I had to do was specify the output files and it did indeed change the output from a las file to a LASCatalog. Thank you so much!
    – kah574
    Commented May 19, 2021 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.