I have used the lidR
package in R to run a point cloud segmentation of trees using the li2012
algorithm. I am interested in exporting my results to a csv file, but the methods I have tried did not include the treeID
column.
As suggested in this post: (Exporting coordinates from LAS files to CSV?) I used las2txt and rLiDAR but neither option included the treeID
column in the csv it generated.
- How is it possible to export to csv and include the tree segmentation results?
- Would it work best to create a spatial points data frame following
lidR
book Chapter 11 then use the SF or SP package to convert it to a csv? (https://jean-romain.github.io/lidRbook/tba.html)
Additionally as a second topic, I am interested in linking my results with a postgresql / postGIS database. Is a conversion to csv followed by a table creation in postgresql efficient? Any better way?
tree_metrics
uses the highest point. Use that, then write the spatial object to CSV.