change extended classification

403 views
Skip to first unread message

Juan Lopez Bojorquez

unread,
Sep 20, 2017, 6:03:44 PM9/20/17
to LAStools - efficient tools for LiDAR processing

I am trying to change_classification_from 0 to 40 and from 9 to 42.
When I do that, it create a new class 0 with the total number of records that were on class 0 and class 9.
When I tried to create a new las files, keeping all the class I need, but class 0,  it came empty.
When I tried to drop class 0, it drops class 40 and 42 as well.
I am using Las version 1.4
Andy idea how can I solve my problem?

Thanks,
Juan

Martin Isenburg

unread,
Sep 20, 2017, 8:54:18 PM9/20/17
to LAStools - efficient command line tools for LIDAR processing
Hello Juan,

it would help if you could include a lasinfo report of the LAS files [1] from before and after your conversion as well as the exact las2las (?!?) command line that you used for conversion.

Regards,

Martin


PS: Want to meet rapidlasso GmbH in person and talk LiDAR, photogrammetry points and LAStools? See our upcoming schedule here: http://rapidlasso.com/events


Juan Lopez Bojorquez

unread,
Sep 21, 2017, 11:04:58 AM9/21/17
to LAStools - efficient tools for LiDAR processing
Thanks Martin for your message.

Please see the Before and after Las report of one file and the script I used.
********************
::Allows to run LASTools from any drive location
path=c:\lastools\bin

Las2las    -i  LAS14\*.las -change_extended_classification_from_to 9 40 -change_extended_classification_from_to 0 42 -set_extended_overlap_flag 1 -set_extended_scanner_channel 2
********************************

Thanks,
Juan
Before.jpg
After.jpg

cai...@vicforests.com.au

unread,
Sep 28, 2017, 3:22:57 AM9/28/17
to last...@googlegroups.com
Hi Martin,

Our current las file format is 1.3 but i need a format 1.2 las file.

How can i get a right format las file


Regards

Cai Li  I  GIS Analyst, Resources  I  VicForests

Level 12, 461 Bourke Street, Melbourne  Vic  3000  I  G P O Box 191, Melbourne   Vic   3001

T:  +61 03 9608 9571  I   F:  +61 03 9608 9566  I  E:  cai...@vicforests.com.au

Notice:

This email and any attachments may contain information that is personal,
confidential, legally privileged and/or copyright. No part of it should be
reproduced, adapted or communicated without the prior written consent of the
copyright owner.

It is the responsibility of the recipient to check for and remove viruses.

If you have received this email in error, please notify the sender by return
email, delete it from your system and destroy any copies. You are not authorised
to use, communicate or rely on the information contained in this email.

Please consider the environment before printing this email.

David Friedrich

unread,
Sep 28, 2017, 10:53:55 AM9/28/17
to last...@googlegroups.com
Hi Cai,

well with las2las for example you have the option -set_version 1.2.
For this basic question the readme files are gold. You will find them inside the bin folder. 
Every module brings its own readme.

Cheers,
David

------ Originalnachricht ------
Gesendet: 27.09.2017 21:53:10
Betreff: [LAStools] How to change las format from 1.3 to 1.2

--

Martin Isenburg

unread,
Sep 30, 2017, 6:20:13 AM9/30/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

the most efficient way to "downgrade" a LAS 1.3 file to a LAS 1.2 file would be to simply rewrite the version number in the LAS header *in-place* (i.e. without rewriting the file) as 1.2 using the corresponding '-set_version 1.2' option in lasinfo [1]. This will result in a valid LAS 1.2 when your files are using point type 0, 1, 2, or 3.

lasinfo -i lidar\*.laz -set_version 1.2 -nc -nv 


Regards,

Martin @rapidlasso

PS: Want to meet rapidlasso GmbH in person and talk LiDAR, photogrammetry points and LAStools? See our upcoming event schedule here: http://rapidlasso.com/events




Martin Isenburg

unread,
Sep 30, 2017, 10:17:42 AM9/30/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

I think all is good just that the reporting of (an older version of) lasinfo confuses you. For all extended_classifications of 32 or higher the legacy classification was not just set to zero but also counted as zero in the histogram. I believe that this was fixed in the later versions of LAStools. Below a similar example:
 
:: creating a LAS 1.4 file

las2las -i ..\data\fusa.laz -set_point_type 6 -o fusa14.laz

:: this is how it looks now

lasinfo -i fusa14.laz
lasinfo (170915) report for fusa14.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.4
  system identifier:          'LAStools (c) by rapidlasso GmbH'
  generating software:        'las2las (version 170915)'
  file creation day/year:     40/2010
  header size:                375
  offset to point data:       469
  number var. length records: 1
  point data format:          6
  point data record length:   30
  number of point records:    0
  number of points by return: 0 0 0 0 0
  scale factor x y z:         0.01 0.01 0.01
  offset x y z:               0 0 0
  min x y z:                  277750.00 6122250.00 42.21
  max x y z:                  277999.99 6122499.99 64.35
  start of waveform data packet record: 0
  start of first extended variable length record: 0
  number of extended_variable length records: 0
  extended number of point records: 277573
  extended number of points by return: 263413 13879 281 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 1:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34735
  length after header  40
  description          'by LAStools of Martin Isenburg'
    GeoKeyDirectoryTag version 1.1.0 number of keys 4
      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected
      key 3072 tiff_tag_location 0 count 1 value_offset 32754 - ProjectedCSTypeGeoKey: WGS 84 / UTM 54S
      key 3076 tiff_tag_location 0 count 1 value_offset 9001 - ProjLinearUnitsGeoKey: Linear_Meter
      key 4099 tiff_tag_location 0 count 1 value_offset 9001 - VerticalUnitsGeoKey: Linear_Meter
LASzip compression (version 3.1r0 c3 50000): POINT14 3
reporting minimum and maximum for all LAS point record entries ...
  X            27775000   27799999
  Y           612225000  612249999
  Z                4221       6435
  intensity          10      62293
  return_number       1          3
  number_of_returns   1          3
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      1          6
  scan_angle_rank    79        103
  user_data           0        197
  point_source_ID     1          1
  gps_time 5880.963028 5886.739738
  extended_return_number          1      3
  extended_number_of_returns      1      3
  extended_classification         1      6
  extended_scan_angle         13167  17167
  extended_scanner_channel        0      0
number of first returns:        263413
number of intermediate returns: 283
number of last returns:         263370
number of single returns:       249493
overview over extended number of returns of given pulse: 249493 27232 848 0 0 0 0 0 0 0 0 0 0 0 0
histogram of classification of points:
           17553  unclassified (1)
          180868  ground (2)
           37030  high vegetation (5)
           42122  building (6)

:: modify the LAS file

las2las -i fusa14.laz ^
            -change_extended_classification_from_to 6 40 ^
            -change_extended_classification_from_to 1 42 ^
            -set_extended_overlap_flag 1 ^
            -set_extended_scanner_channel 2 ^
            -odix _mod -olaz

:: this is how it looks now after the modifications

lasinfo -i fusa14_mod.laz
lasinfo (170915) report for fusa14_mod.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.4
  system identifier:          'LAStools (c) by rapidlasso GmbH'
  generating software:        'las2las (version 170915)'
  file creation day/year:     40/2010
  header size:                375
  offset to point data:       469
  number var. length records: 1
  point data format:          6
  point data record length:   30
  number of point records:    0
  number of points by return: 0 0 0 0 0
  scale factor x y z:         0.01 0.01 0.01
  offset x y z:               0 0 0
  min x y z:                  277750.00 6122250.00 42.21
  max x y z:                  277999.99 6122499.99 64.35
  start of waveform data packet record: 0
  start of first extended variable length record: 0
  number of extended_variable length records: 0
  extended number of point records: 277573
  extended number of points by return: 263413 13879 281 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 1:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34735
  length after header  40
  description          'by LAStools of Martin Isenburg'
    GeoKeyDirectoryTag version 1.1.0 number of keys 4
      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected
      key 3072 tiff_tag_location 0 count 1 value_offset 32754 - ProjectedCSTypeGeoKey: WGS 84 / UTM 54S
      key 3076 tiff_tag_location 0 count 1 value_offset 9001 - ProjLinearUnitsGeoKey: Linear_Meter
      key 4099 tiff_tag_location 0 count 1 value_offset 9001 - VerticalUnitsGeoKey: Linear_Meter
LASzip compression (version 3.1r0 c3 50000): POINT14 3
reporting minimum and maximum for all LAS point record entries ...
  X            27775000   27799999
  Y           612225000  612249999
  Z                4221       6435
  intensity          10      62293
  return_number       1          3
  number_of_returns   1          3
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      0          5
  scan_angle_rank    79        103
  user_data           0        197
  point_source_ID     1          1
  gps_time 5880.963028 5886.739738
  extended_return_number          1      3
  extended_number_of_returns      1      3
  extended_classification         2     42
  extended_scan_angle         13167  17167
  extended_scanner_channel        2      2
number of first returns:        263413
number of intermediate returns: 283
number of last returns:         263370
number of single returns:       249493
overview over extended number of returns of given pulse: 249493 27232 848 0 0 0 0 0 0 0 0 0 0 0 0
histogram of classification of points:
          180868  ground (2)
           37030  high vegetation (5)
 +-> flagged as extended overlap: 277573
histogram of extended classification of points:
           42122  extended classification (40)
           17553  extended classification (42)
Reply all
Reply to author
Forward
0 new messages