1

I am trying to save the dtm generated using plot command. The dtm has been generated from las using lidR using this code

dtm1_tin <- rasterize_terrain(las1, res = 1, algorithm = tin())
plot_dtm3d(dtm1_tin, bg = "white")
 
# Trying to save my plot using
savePlot("dtm1_tin", type = "tiff", device = dev.cur(), restoreConsole = TRUE)
#> Error in savePlot("dtm1_tin", type = "tiff", device = dev.cur(), restoreConsole = TRUE) : 
no such device
JRR
  • 3,024
  • 2
  • 13
  • 37
  • Do you want to save the raster or do you want to save an image of the 3D rendering? This is unclear. – JRR Jan 19 '23 at 00:58

1 Answers1

0

Looks like you should be able to use the generic terra::writeRaster with your dtm1_tin object.

So:

terra::writeRaster(dtm1_tin, "your_data_dir/your_file_name.tif", filetype = "GTiff", overwrite = TRUE)
aclong
  • 181
  • 2
  • 7