tiagodc / TreeLS

R functions for processing individual tree TLS point clouds
GNU General Public License v3.0
82 stars 27 forks source link

Using stem point classification to filter points from the point cloud. #12

Closed spokswinski closed 4 years ago

spokswinski commented 4 years ago

Thank you for the extremely useful package. I am working on a workflow to simplify ecological, forest fuels and tree metric monitoring of large public lands using smaller TLS lasers. The stem segmentation and table generation used by the treeMap, stemPoints and stemsegmentation commands get us exactly what I need, but the fuels and ecological monitoring will require the removal of stems from the point cloud.

Right now, using the lidR package, I can classify and filter ground points. It seems that the stemPoints function in TreeLS has the ability to classify the stem point, but these classifications are either temporary or are hidden, because writing the resulting LAS files do not show this classification when inspected in Cloudcompare. Is there a way to use a command like lasfilter from lidR to either isolate tree points or segment them out from the point cloud? This would be a useful feature.

Thanks again!

caiohamamura commented 4 years ago

Stem classification is added to a custom field, you have two different options there, either you create another Classification code for stems using something like

las@data[Stem == T, Classification := 20]

Or you can make Stem field to be permanent using lidR::lasaddextrabytes function.

tiagodc commented 4 years ago

Thanks for the question, and @caiohamamura already answered perfectly.

On top of that, if you want to preserve some of the TreeLS's custom fields on your LAS files you can use lidR::add_lasattribute, this way you can visualize and explore those fields in other software, such as Cloud Compare or LAStools.

Cheers!

spokswinski commented 4 years ago

Thanks, that completely works.