Hello folks,
the problem with the "crappy" LAS files I am addressing in this
message is that they (a) do not compress well to LAZ files, (b)
sometimes cause troubles in LAStools, (c) make you look a bit
unprofessional when you produce and distribute such files, and (d) -
most importantly - do not please my aesthetic needs. (-:
Below are the lasinfo outputs of two of these files that caused
troubles recently. You notice them due to their unnecessarily precise
scale factors that are fine enough to store the scan of a human hair.
scale factor x y z: 4.26875e-007 5.23e-007 2.54059e-008
scale factor x y z: 1.0055e-006 9.355e-007 4.73613e-008
As a general rule these scaling factors should be no smaller than 0.01
for aerial surveys, no smaller than 0.001 for mobile surveys, and no
smaller than 0.0001 for the highly-precise terrestrial scans. These
numbers are already very very conservative and usually can be
increased. One exception: if the Easting and the Northing are
expressed in Longitude and Latitude then a scaling factor of 1e-7 for
the x coordinate and the y coordinate is required.
Another thing that I often see are very ugly offsets. Take a look
below. This offset is added to all points and its many decimal digits
means that all points are being slightly translated by this
meaningless fractional offset. The offset is supposed to be some large
number that is subtracted from all points before they are stored. This
moves the origin closer to the stored points to make the scaled-
integer storage used by the LAS format more robust (aka avoid integer
overflows).
offset x y z: 604107.62500244146 4209893
1332.2413330841064
offset x y z: 381322.40624984744 4338247.5
2907.6025392913816
So the following offsets would do the job just as well
offset x y z: 600000 4210000 0
offset x y z: 381000 4338000 3000
Other things that are bad? The return counts and numbers are not
populated for "proctor_2012.laz" and "Pine_Ridge_2012.laz" and these
files use an unnecessarily bloated point format 3 although they have
no GPS time stamp so could get away with the 8 bytes smaller point
format 2! How to fix this? EasyPeasy LazyToolsy:
las2las -i proctor_2012.laz ^
-rescale 0.01 0.01 0.01 ^
-auto_reoffset ^
-repair_zero_returns ^
-set_point_data_format 2 ^
-o proctor_2012_fixed.laz
or
las2las -i Pine_Ridge_2012.laz ^
-rescale 0.01 0.01 0.01 ^
-auto_reoffset ^
-repair_zero_returns ^
-set_point_data_format 2 ^
-o Pine_Ridge_2012_fixed.laz
or
las2las -i input\*.laz ^
-rescale 0.01 0.01 0.01 ^
-auto_reoffset ^
-repair_zero_returns ^
-set_point_data_format 2 ^
-odir output\ -olaz
Now the files are nice (see lasinfo before and after) and the
compression gains are substantial (see below).
8,676,598 proctor_2012.laz
4,248,552 proctor_2012_fixed.laz
1,173,141 Pine_Ridge_2012.laz
609,704 Pine_Ridge_2012_fixed.laz
Cheers,
Martin @lastools
--
http://rapidlasso.com - easypeasy tools to fix LiDARs
-----------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
C:\lastools\bin>lasinfo proctor_2012.laz
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 0
global_encoding: 0
project ID GUID data 1-4: 0 0 0 ''
version major.minor: 1.2
system identifier: 'libLAS'
generating software: 'libLAS 1.7.0'
file creation day/year: 23/2013
header size: 227
offset to point data: 227
number var. length records: 0
point data format: 3
point data record length: 34
number of point records: 1064634
number of points by return: 0 0 0 0 0
scale factor x y z: 4.26875e-007 5.23e-007 2.54059e-008
offset x y z: 604107.62500244146 4209893
1332.2413330841064
min x y z: 604107.62500244146 4209893
1332.2413330841064
max x y z: 604534.50000053411 4210416
1357.6472168731689
LASzip compression (version 2.1r0 c2 50000): POINT10 2 GPSTIME11 2
RGB12 2
reporting minimum and maximum for all LAS point record entries ...
X 0 999999996
Y 0 1000000000
Z 0 1000000000
intensity 0 0
edge_of_flight_line 0 0
scan_direction_flag 0 0
number_of_returns_of_given_pulse 0 0
return_number 0 0
classification 0 0
scan_angle_rank 0 0
user_data 0 0
point_source_ID 0 0
gps_time 0.000000 0.000000
Color R 2304 64512
G 0 65280
B 6144 65280
WARNING: 1 points outside of header bounding box
WARNING: there are 1064634 points with return number 0
WARNING: there are 1064634 points with a number of returns of given
pulse of 0
histogram of classification of points:
1064634 Created, never classified (0)
real max x larger than header max x by 0.000000
-----------------------------------------------------------------------
C:\lastools\bin>lasinfo proctor_2012_fixed.laz
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 0
global_encoding: 0
project ID GUID data 1-4: 0 0 0 ''
version major.minor: 1.2
system identifier: 'LAStools (c) by Martin Isenburg'
generating software: 'las2las (version 130213)'
file creation day/year: 23/2013
header size: 227
offset to point data: 227
number var. length records: 0
point data format: 2
point data record length: 26
number of point records: 1064634
number of points by return: 1064634 0 0 0 0
scale factor x y z: 0.01 0.01 0.01
offset x y z: 600000 4200000 0
min x y z: 604107.63 4209893.00 1332.24
max x y z: 604534.50 4210416.00 1357.65
LASzip compression (version 2.1r0 c2 50000): POINT10 2 RGB12 2
reporting minimum and maximum for all LAS point record entries ...
X 410763 453450
Y 989300 1041600
Z 133224 135765
intensity 0 0
edge_of_flight_line 0 0
scan_direction_flag 0 0
number_of_returns_of_given_pulse 1 1
return_number 1 1
classification 0 0
scan_angle_rank 0 0
user_data 0 0
point_source_ID 0 0
Color R 2304 64512
G 0 65280
B 6144 65280
overview over number of returns of given pulse: 1064634 0 0 0 0 0 0
histogram of classification of points:
1064634 Created, never classified (0)
-----------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
C:\lastools\bin>lasinfo Pine_Ridge_2012.laz
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 0
global_encoding: 0
project ID GUID data 1-4: 0 0 0 ''
version major.minor: 1.2
system identifier: 'libLAS'
generating software: 'libLAS 1.7.0'
file creation day/year: 24/2013
header size: 227
offset to point data: 227
number var. length records: 0
point data format: 3
point data record length: 34
number of point records: 100572
number of points by return: 0 0 0 0 0
scale factor x y z: 1.0055e-006 9.355e-007 4.73613e-008
offset x y z: 381322.40624984744 4338247.5
2907.6025392913816
min x y z: 381322.40624984744 4338247.5
2907.6025392913816
max x y z: 382327.90622314456 4339183
2954.9638674163816
LASzip compression (version 2.1r0 c2 50000): POINT10 2 GPSTIME11 2
RGB12 2
reporting minimum and maximum for all LAS point record entries ...
X 0 999999973
Y 0 1000000000
Z 0 1000000000
intensity 0 0
edge_of_flight_line 0 0
scan_direction_flag 0 0
number_of_returns_of_given_pulse 0 0
return_number 0 0
classification 0 0
scan_angle_rank 0 0
user_data 0 0
point_source_ID 0 0
gps_time 0.000000 0.000000
Color R 256 62464
G 256 57600
B 0 64512
WARNING: there are 100572 points with return number 0
WARNING: there are 100572 points with a number of returns of given
pulse of 0
histogram of classification of points:
100572 Created, never classified (0)
-----------------------------------------------------------------------
C:\lastools\bin>lasinfo Pine_Ridge_2012_fixed.laz
reporting all LAS header entries:
file signature: 'LASF'
file source ID: 0
global_encoding: 0
project ID GUID data 1-4: 0 0 0 ''
version major.minor: 1.2
system identifier: 'LAStools (c) by Martin Isenburg'
generating software: 'las2las (version 130213)'
file creation day/year: 24/2013
header size: 227
offset to point data: 227
number var. length records: 0
point data format: 2
point data record length: 26
number of point records: 100572
number of points by return: 100572 0 0 0 0
scale factor x y z: 0.01 0.01 0.01
offset x y z: 300000 4300000 0
min x y z: 381322.41 4338247.50 2907.60
max x y z: 382327.91 4339183.00 2954.96
LASzip compression (version 2.1r0 c2 50000): POINT10 2 RGB12 2
reporting minimum and maximum for all LAS point record entries ...
X 8132241 8232791
Y 3824750 3918300
Z 290760 295496
intensity 0 0
edge_of_flight_line 0 0
scan_direction_flag 0 0
number_of_returns_of_given_pulse 1 1
return_number 1 1
classification 0 0
scan_angle_rank 0 0
user_data 0 0
point_source_ID 0 0
Color R 256 62464
G 256 57600
B 0 64512
overview over number of returns of given pulse: 100572 0 0 0 0 0 0
histogram of classification of points:
100572 Created, never classified (0)