r-lidar / lidR

Airborne LiDAR data manipulation and visualisation for forestry application
https://CRAN.R-project.org/package=lidR
GNU General Public License v3.0
601 stars 131 forks source link

Manually adding treetops kills Z attribute #567

Closed nbrodic88 closed 2 years ago

nbrodic88 commented 2 years ago

Hi, If I perform manually adding some treetops:

f <- function(x) { x * 0.07 + 4 }
ttops <- find_trees(las, lmf(f, shape = c("circular")))
ttops = find_trees(las, manual(ttops))
plot(ttops, add = TRUE)
writeSpatialShape(ttops, "ttopsVar.shp")

I loose height in the attributes of SHP, possibly because I get some new attribute as id.

Jean-Romain commented 2 years ago

Fixed. Thank you for reporting

nbrodic88 commented 2 years ago

Thank you for all the good work!