I have a small issue with configuring the lidR
package for parametrizing the extracted raster files with grid_metrics()
function.
My question is how to set in the catalog options that:
- be able to overwrite the results with a second run if I want to run my script several times and I do not want to name each output differently.
- instead of
.tif
I would like to get.grd
files as output.
My current code (which is working) is the following:
normalizedctg = catalog(workingdirectory)
opt_output_files(normalizedctg) <- paste(workingdirectory,"/clipped/normalized/{XLEFT}_{YBOTTOM}_height",sep="")
height = grid_metrics(normalizedctg, max(Z),res = resolution)
But with a second run on the same code I get the following error:
Error in .getGDALtransient(x, filename = filename, options = options, :
filename exists; use overwrite=TRUE