Using lasgrid to calculate number of points in a grid size

119 views
Skip to first unread message

James Carracher

unread,
Mar 18, 2024, 3:34:25 AM3/18/24
to LAStools - efficient tools for LiDAR processing
Hi,

I seem to be having trouble getting lasgrid to successfully count the number of points within an area of a point cloud. For example, i set the step to 1m2 and I can only seem to get a relative count. Such as 10 points in the cell (when there should be millions of points). 

Can anyone see what I am doing wrong?
Generally, I want to count the points in each m2. So some cells will have a 0 value, and some will be in the millions where the cloud is more dense (This is for MLS data)

lasgrid.exe -cpu64 -i "Input_Folder\*.laz" ^
-grid_spacing 1 ^
-keep_class 2 8 ^
-counter_32bit ^
-no_kml ^
-odir "Output" ^
-oxyz ^
-cores 20

Any help would be appreciated

Jochen Rapidlasso

unread,
Mar 18, 2024, 4:20:09 AM3/18/24
to LAStools - efficient tools for LiDAR processing
Hi James,
we tried this with several files and can not see a problem.
Please run the tool with the -v option and watch/send the log output carefully.

Please try to break it down, e.g. starting with one single file and minimum of additional arguments, like
    lasgrid64  -i in.laz -point_density_32bit -oxyz -step 1

If this gives you the expected result add other arguments, like the class filter, so see where the problem occurs.

The simplest way to calculate the density per 1m2 in general is lasinfo:
    lasinfo -i lake.las -cd

Best regards,

Jochen @rapidlasso

James Carracher

unread,
Mar 19, 2024, 4:48:26 AM3/19/24
to LAStools - efficient tools for LiDAR processing
Hi Jochen,

I had done the method you suggest a while ago but I was still finding the issue. There also did seem to be some sort of scaling of the count as well even though this wasn't specified. I.e. a cell that should only have 1 point had a count of 2048 or something like that.
That being said I did start from scratch with different data and it did appear to work. I think it was the classification filter that was causing the issue in the end. I don't really need this (it would just be nice to count the density of the ground alone)

Yes I am aware of the lasinfo method. I usually use it, but for this client I am required to test every m2 individually within survey extents against a density requirement, and not overall like lasinfo would give

Also, am I correct in thinking that the xy coordinates listed in and xyz output file are the centre of the grid cell that the calculation was done on?

Thanks for your help

James

Jochen Rapidlasso

unread,
Mar 19, 2024, 4:49:41 AM3/19/24
to LAStools - efficient tools for LiDAR processing
Hi James,
yes, the xy in the grid output are the grid center.

Best regards,

Jochen @rapidlasso

Reply all
Reply to author
Forward
0 new messages