I am working on the segmentation of crown canopy using LiDAR. I want to extract the crowns created after the segmentation as a shapefile. Other documentation and links show that using writeOGR I can create the shapefile from the crown canopy, but I get an error that:
inherits(obj, "Spatial") is not TRUE
Exporting crown boundaries from tree segmentation in R?
The code:
crowns <- crown_metrics(las, func = .stdtreemetrics, geom = "convex")
writeOGR(crowns, "building.shp", layer="convex", driver="ESRI Shapefile")