I have las files along coastal areas which include multiple flights. Usually I use both water and ground when normalizing but this data has 2 things to overcome. The first has ground at a lower level than water due to tides. The second is a problem because one flight classified vegetation as water. To help solve this (a quick attempt at ground classification didn't quite work), I want to extract water and ground, and then use point_metrics() to get the minimum value within a small neighbourhood. The idea is to use this minimum value as ground during normalization. How can I export the results of point_metrics() data table to a raster or las file (it has pointId & V1)?
[![profile of las with classification][1]][1]
library(raster)
setwd('D:/test/las')
las <- readLAS('579_4998_201801.las', filter = "-keep_class 2 9")
lasmin <- point_metrics(las, func = ~min(Z), k = 2, r = 1)
[1]: https://i.sstatic.net/7bsmC.png
las2 = LAS(lasmin, las@header)
but the xy coordinates are gone. In the end, I think I should reclassify using classify_ground. I will try and edit the code above but hope I don't confuse things more.