How to bring las/laz-file to user defined point density [points per squaremeter] using lidR?

166 Views Asked by At

I have a las/laz-file with a point density of 72.91 points/m² which I want to bring to point density of 4 points/m² using lidR::voxelize() from package {lidR}.

However, I do not know how to achieve that with the given argument <res = >.

What I have tried so far:

# original las dataset
original_las
class        : LAS (v1.4 format 6)
memory       : 5.3 Mb 
extent       : ??????.?, ??????.?, ???????, ??????? (xmin, xmax, ymin, ymax)
coord. ref.  : ETRS89 / UTM zone 32N 
area         : 828 m²
points       : 60.4 thousand points
density      : 72.91 points/m²
density      : 36.43 pulses/m²

lowres_las <- lidR::voxelize_points(las = original_las, 
                    res = lidR::density(original_las)/18.2275)
# 72.91 points/m² divided by 4 points/m² should bring me 
# to a resolution argument of ~18.2275

lowres_las
class        : LAS (v1.4 format 6)
memory       : 23.9 Kb 
extent       : ??????.?, ??????.?, ???????, ??????? (xmin, xmax, ymin, ymax)
coord. ref.  : ETRS89 / UTM zone 32N 
area         : 767.9623 m²
points       : 304  points
density      : 0.4 points/m²
# however, I do not only get the wrong points/m², but also an altered area
1

There are 1 best solutions below

0
On

You want to reach a density expressed in pts/m² by decimating/voxelizing in 3D. It don't think it is even possible. If you want to reach 4 pts/m² use decimate_points() which is designed for such purpose.

If you really want to voxelize and reach 4 pts/m² you must think in 3D. Estimate the density per m³. Assuming you have homogeneously 20 m height trees and 800 m² it means you have approx 16000 m³. You want 4 pts/m² so 4×800 = 3200 points or voxels in 16000 m³. Do the math to estimate a voxel resolution that solve approximately the problem.

For the altered area think about it a bit you will find that it is expected