TransWikia.com

Can catalog_apply output a LAScatalog?

Geographic Information Systems Asked by kah574 on July 6, 2021

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.

One Answer

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

Answered by JRR on July 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP