1

I have loaded both raster and lidR packages within RStudio and I am trying to export the IDW DTM files but have been receiving errors about 'format'. I have exported a TIN DTM already however with IDW it will not seem to work?

setwd("C:/Users/niall/OneDrive - Maynooth University/GY641 Aerial Surveys & Drone/LiDAR Assignment/LiDAR Files/Ppointcloud")

las = readLAS("subsubset_ca.las")

dtm_idw <- rasterize_terrain(las, algorithm = knnidw(k = 10L, p = 2))

writeRaster(dtm_idw, filename = "C:/Users/niall/OneDrive - Maynooth University/GY641 Aerial Surveys & Drone/LiDAR Assignment/Lidr/IDW DEM.tif", format = "GTiff")

To which I receive the error:

Error: [write] unknown option(s): format

2 Answers 2

1

dtm_idw is a SpatRaster from terra. terra::writeRaster does not have format argument. Load terra and remove format

0
setwd("C:/Users/niall/OneDrive - Maynooth University/GY641 Aerial Surveys & Drone/LiDAR Assignment/LiDAR Files/Ppointcloud")

las = lidR::readLAS("subsubset_ca.las")

dtm_idw <- lidR::rasterize_terrain(las, algorithm = knnidw(k = 10L, p = 2))

terra::writeRaster(dtm_idw, filename = "C:/Users/niall/OneDrive - Maynooth University/GY641 Aerial Surveys & Drone/LiDAR Assignment/Lidr/IDW DEM.tif")

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.