I have canopy height model calculated from high density TLS data on 60 by 200 meter plot. I tried to calculate voxels with LAStools and lidR and got significantly different results. I was wondering if someone can make clear what is happening. Lastools script that I used:
lasvoxel -i infile.laz -drop_class 2 -step 0.5 -o outfile.las
number of voxels: 189077
lidR code:
las = readLAS("infile.laz", select = "xyzc", filter = "-drop_class 2 -drop_z_below 0 ")
voxels <- voxelize_points(las, res = 0.5)
number of voxels: 196257
Also calculated canopy height skewness and kurtosis: LAStools:
lascanopy -i infiles\*.laz -kur -ske -height_cutoff 1.3 -files_are_plots -names -o outfile.csv
Result:
plots ske kur
72a-4.laz 1.0905 5.58125
11a-4.laz 0.362 2.594
34-2.laz 0.1675 2.00875
63a-1.laz -0.3115 2.36
lidR:
library(e1071)
files <- list.files(path= "/files", pattern= "*.laz", full.names = TRUE, recursive = FALSE)
O = lapply(files, function(x) {
las <- readLAS(x, select = "xyzc")
z <- las$Z
z_canopy <- z[z>=1.3]
skew <- skewness(z_canopy)
kur <- kurtosis(z_canopy)
return(data.frame(file=x, skewH = skew, kurH=kur))
})
Result:
plots ske kur
72a-4.laz 1.090595768 2.58132381
11a-4.laz 0.362007296 -0.40599745
34-2.laz 0.167542141 -0.991227478
63a-1.laz -0.311523396 -0.640029907
As we can see, the results for skewness are the same, but kurtosis values are very different. Can someone please help me understand why there is such a big difference?
points
and make a valid and reproducible code example.points>1.3m
is not a valid R syntax.