Hello,
Jonathan had clarified this question off list:
"Sorry if my previous question wasn't clear. I'll try to make an example, but given two .laz files representing lidar data collected at time 1 and time 2, e.g. T1.laz and T2.laz, what I'm trying to do is determine the change in e.g. voxelized point counts between those two time periods. The way I was thinking about it was I voxelize T1, separately voxelize T2, export both to a CSV file, and then merge the two based on their x,y,z positions. I'm trying to end up with a database that looked something like:
Voxel X, Voxel Y, Voxel Z, # of points in T1, # of points in T2
The issue I'm thinking I'm going to run into is that the origin of the voxels in T1 and T2 will likely be different, e.g. say T1 the origin corner coordinate is 0, 0, 0 and T2 its 0.5, 0.5, 0.5. Say I use a 1m voxel. The resultant x,y,z of the voxels from T1 and T2 will be off by 0.5 meters (so I can't do a join without fixing this) and will represent slightly different volumes of space. What I'd like to use is the same voxel origin for BOTH time periods (e.g. the voxels always start at 0,0,0 even if the actual .laz origin has some decimal)."
Turns out this question was unnecessary because the voxel locations are globally unique as the voxel grid is globally aligned and uniquely defined by the step size. There should not be a shift.
The other question was: How do I get the number of points per voxel?
This is stored in the intensity. Below an example.
C:\LAStools\bin>lasvoxel -i ..\data\fusa.laz -step 2 -compute_mean_xyz -o fusa_v.laz
done with 'fusa_v.laz'. took 0.186 sec.
C:\LAStools\bin>lasview -i fusa_v.laz
C:\LAStools\bin>las2txt -i fusa_v.laz -parse ixyz -stdout | more
17 277750.97 6122251.04 42.30
17 277752.98 6122251.01 42.29
12 277754.87 6122250.93 43.06
3 277756.79 6122251.60 42.30
1 277758.40 6122251.12 42.60
1 277760.04 6122251.03 43.25
1 277767.15 6122251.80 43.59
18 277768.78 6122251.06 43.59
22 277770.98 6122250.91 43.63
13 277773.15 6122251.02 43.67
15 277774.76 6122250.88 43.70
22 277776.93 6122250.96 43.74
17 277779.09 6122251.03 43.82
16 277781.14 6122250.96 43.84
16 277783.02 6122251.03 43.91
15 277784.95 6122250.98 43.96
2 277786.64 6122250.25 43.99
15 277750.89 6122253.00 42.39
16 277752.98 6122253.04 42.38
6 277754.54 6122253.08 42.50
4 277757.20 6122252.50 42.34
2 277758.38 6122252.32 42.33
3 277762.56 6122253.11 43.44
7 277767.28 6122252.86 43.59
[...]
C:\LAStools\bin>lasinfo -i fusa_v.laz
lasinfo (180907) report for 'fusa_v.laz'
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 0
global_encoding: 0
project ID GUID data 1-4: 00000000-0000-0000-0000-000000000000
version major.minor: 1.2
system identifier: 'LAStools (c) by rapidlasso GmbH'
generating software: 'lasvoxel (180907) commercial'
file creation day/year: 0/0
header size: 227
offset to point data: 227
number var. length records: 0
point data format: 0
point data record length: 20
number of point records: 26837
number of points by return: 26837 0 0 0 0
scale factor x y z: 0.01 0.01 0.01
offset x y z: 200000 6100000 0
min x y z: 277750.05 6122250.01 42.26
max x y z: 277999.97 6122499.87 64.32
LASzip compression (version 3.2r4 c2 50000): POINT10 2
reporting minimum and maximum for all LAS point record entries ...
X 7775005 7799997
Y 2225001 2249987
Z 4226 6432
intensity 1 32
return_number 1 1
number_of_returns 1 1
edge_of_flight_line 0 0
scan_direction_flag 0 0
classification 0 0
scan_angle_rank 0 0
user_data 0 0
point_source_ID 0 0
number of first returns: 26837
number of intermediate returns: 0
number of last returns: 26837
number of single returns: 26837
overview over number of returns of given pulse: 26837 0 0 0 0 0 0
histogram of classification of points:
26837 never classified (0)