我正在尝试保存使用
plot
命令生成的 dtm。 dtm
是使用lidR使用此代码从las生成的
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
看起来您应该能够将通用
terra::writeRaster
与您的 dtm1_tin
对象一起使用。
所以:
terra::writeRaster(dtm1_tin, "your_data_dir/your_file_name.tif", filetype = "GTiff", overwrite = TRUE)