fixing "corrupt" LAS or LAZ tiles with "zero" point records

381 views
Skip to first unread message

Martin Isenburg

unread,
Jul 23, 2016, 5:25:20 AM7/23/16
to LAStools - efficient command line tools for LIDAR processing
Hello,

recently I received a LAS file with a request for help. Something was wrong with this file. Looking at the bounding box in the header and the name of that file already gives us some clue: There seem to be some points included that have the coordinate (0, 0, 0). Also all the other point attributes seem to be zero (oddly enough except for the classification) as the lasinfo report tells us (see below). 

How the zero entries destroy the bounding box is easily visualized by running lasindex and then looking at the tile in the GUI as you can see in the attached screenshot.

lasindex -i min_e656000_n5849500_max_e656500_n5850000.las 
las2las -i min_e656000_n5849500_max_e656500_n5850000.las -gui

The zero entries offer us a number of ways to *fix* the data set (e.g. kick out the returns close to zero) as listed here:

las2las -i min_e656000_n5849500_max_e656500_n5850000.las ^
              -drop_return 0 ^
              -odix _fixed -olaz

las2las -i min_e656000_n5849500_max_e656500_n5850000.las ^
              -drop_gps_time_below 5 ^
              -odix _fixed -olaz

las2las -i min_e656000_n5849500_max_e656500_n5850000.las ^
              -drop_x_below 1 ^
              -odix _fixed -olaz

las2las -i min_e656000_n5849500_max_e656500_n5850000.las ^
              -drop_x_below y ^
              -odix _fixed -olaz

///////////////////////////////////////
/////////// BEFORE ///////////
///////////////////////////////////////
D:\LAStools\bin>lasinfo min_e656000_n5849500_max_e656500_n5850000.las
lasinfo (160721) report for min_e656000_n5849500_max_e656500_n5850000.las
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.0
  system identifier:          ''
  generating software:        'TerraScan'
  file creation day/year:     0/0
  header size:                227
  offset to point data:       229
  number var. length records: 0
  point data format:          1
  point data record length:   28
  number of point records:    630839
  number of points by return: 571753 57168 1895 23 0
  scale factor x y z:         0.01 0.01 0.01
  offset x y z:               0 0 0
  min x y z:                  0.00 0.00 0.00
  max x y z:                  656550.00 5850049.99 1279.08
the header is followed by 2 user-defined bytes
reporting minimum and maximum for all LAS point record entries ...
  X                   0   65655000
  Y                   0  585004999
  Z                   0     127908
  intensity           0        174
  return_number       0          4
  number_of_returns   0          4
  edge_of_flight_line 0          1
  scan_direction_flag 0          0
  classification      1          8
  scan_angle_rank     0        106
  user_data           0          5
  point_source_ID     0       9999
  gps_time 0.000000 520538.698475
number of first returns:        571753
number of intermediate returns: 1900
number of last returns:         572257
number of single returns:       515071
WARNING: for return 1 real number of points by return (471753) is different from header entry (571753).
WARNING: there are 100000 points with return number 0
overview over number of returns of given pulse: 415071 110118 5559 91 0 0 0
WARNING: there are 100000 points with a number of returns of given pulse of 0
histogram of classification of points:
          434468  unclassified (1)
            9717  ground (2)
           16274  low vegetation (3)
          101761  medium vegetation (4)
           64518  high vegetation (5)
            1099  noise (7)
            3002  keypoint (8)

//////////////////////////////////////
/////////// AFTER ///////////
//////////////////////////////////////

D:\LAStools\bin>lasinfo min_e656000_n5849500_max_e656500_n5850000_fixed.laz
lasinfo (160721) report for min_e656000_n5849500_max_e656500_n5850000_fixed.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.0
  system identifier:          'LAStools (c) by rapidlasso GmbH'
  generating software:        'las2las (version 160721)'
  file creation day/year:     0/0
  header size:                227
  offset to point data:       229
  number var. length records: 0
  point data format:          1
  point data record length:   28
  number of point records:    530839
  number of points by return: 471753 57168 1895 23 0
  scale factor x y z:         0.01 0.01 0.01
  offset x y z:               0 0 0
  min x y z:                  655950.01 5849450.00 316.44
  max x y z:                  656550.00 5850049.99 1279.08
the header is followed by 2 user-defined bytes
LASzip compression (version 2.4r2 c2 50000): POINT10 2 GPSTIME11 2
reporting minimum and maximum for all LAS point record entries ...
  X            65595001   65655000
  Y           584945000  585004999
  Z               31644     127908
  intensity          10        174
  return_number       1          4
  number_of_returns   1          4
  edge_of_flight_line 1          1
  scan_direction_flag 0          0
  classification      1          8
  scan_angle_rank    60        106
  user_data           3          5
  point_source_ID     3       9999
  gps_time 86072.386134 520538.698475
number of first returns:        471753
number of intermediate returns: 1900
number of last returns:         472257
number of single returns:       415071
overview over number of returns of given pulse: 415071 110118 5559 91 0 0 0
histogram of classification of points:
          334468  unclassified (1)
            9717  ground (2)
           16274  low vegetation (3)
          101761  medium vegetation (4)
           64518  high vegetation (5)
            1099  noise (7)
            3002  keypoint (8)

las2las_fix_zero_points_before.png
las2las_fix_zero_points.png
las2las_fix_zero_points_after.png
Reply all
Reply to author
Forward
0 new messages