Geographic Information Systems Asked on May 28, 2021
I am studying the foliage density of forest plots below 2 metres in height using mobile terrestrial laser scanning. I want to filter out the tree stems from the point clouds so that the point density estimates do not include them. I have been using the lidR and TreeLS packages to process my point clouds. So far I have normalized the clouds and classified the tree stems using example code given in the TreeLS package documentation:
tls1 = readTLS("tls1.las") %>%
tlsNormalize %>%
tlsSample
map = treeMap(tls1, map.hough())
tls2 = treePoints(tls1, map, trp.crop(circle=FALSE))
tls3 = stemPoints(tls2, stm.hough(pixel_size = 0.03))
This successfully identifies the tree stems.
To filter the stems out, I have tried using the filter_poi() function:
tls4 <- filter_poi(tls3, Stem = "FALSE")
There is a column in the point cloud dataset entitled "Stem" with TRUE/FALSE values so I thought this would work, but I get this error:
Error in lasfilter_(las, lazyeval::dots_capture(...)) :
`conditions` must be logical.
Try classifying the stems in the 'Classification' column after calling stemPoints
.
I've used the following code to classify and then filter stems:
Classify
tls@data[Stem == T, Classification := 20]
then filter
stems = filter_poi(tls, Classification == 20L)
Correct answer by Derelict on May 28, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP