txt2las with additional attributes

198 views
Skip to first unread message

Jung

unread,
Nov 20, 2017, 9:07:43 PM11/20/17
to LAStools - efficient tools for LiDAR processing
Hi everybody,

I am a newer to use LAStools, and trying to convert a .txt file to a .las file.

the commands I used like this:

txt2las.exe ^
-i input.txt -o output.las ^
-set_version 1.3 ^
-parse xyz0123456789 ^
-add_attribute 6 "Intensity" "intensity description" ^
-add_attribute 5 "AxesX" "AxesX description" ^
-add_attribute 5 "AxesY" "AxesY description" ^
-add_attribute 5 "Increment" "Increment description" ^
...
-add_attribute 4 "Note" "reserved column"

I used the '-add_attribute' to store extra custom column-values, but it mostly tolerate 10 extra-customs..(-parse xyz0123456789)

And I haven't found the better solutions for this......

Is it possible to store extra custom-columns more than 10?(actually I have 12 extra-columns..)

I would appreciate any help :-)

Kind regards,
Jung

Martin Isenburg

unread,
Nov 23, 2017, 12:42:33 AM11/23/17
to LAStools - efficient command line tools for LIDAR processing
Hello Jung,

thanks for your motivation with supporting more additional attributes via the "extra bytes" functionality. The next version of txt2las will support up to 32 additional attributes. 


Note you'll need to either wait for the next version for this to work or use these tools here:


Here an example of how to use it with 12 additional attributes per point that works with the file "testData.txt" that is attached to this email.

E:\LAStools\bin>txt2las -i testData.txt ^
        -parse xyz0123456789(10)(11) ^
        -set_scale 0.000001 0.000001 0.000001 ^
        -set_version 1.3 ^
        -add_attribute 3 "extra1" "extra1 blah blah" ^
        -add_attribute 5 "extra2" "extra2 blah blah" 0.000001 ^
        -add_attribute 6 "extra3" "extra3 blah blah" 0.000001 ^
        -add_attribute 5 "extra4" "extra4 blah blah" 0.000001 16 ^
        -add_attribute 5 "extra5" "extra5 blah blah" 0.000001 34 ^
        -add_attribute 6 "extra6" "extra6 blah blah" 0.000001 ^
        -add_attribute 6 "extra7" "extra7 blah blah" 0.000001 ^
        -add_attribute 6 "extra8" "extra8 blah blah" 0.000001 ^
        -add_attribute 6 "extra9" "extra9 blah blah" 0.000001 ^
        -add_attribute 6 "extra10" "extra10 blah blah" 0.000001 ^
        -add_attribute 5 "extra11" "extra11 blah blah" 0.000001 ^
        -add_attribute 3 "extra12" "extra12 blah blah" ^
        -o testData.las 

E:\LAStools\bin>lasinfo testData.las
lasinfo (171116) report for testData.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.3
  system identifier:          'LAStools (c) by rapidlasso GmbH'
  generating software:        'txt2las (version 171120)'
  file creation day/year:     325/2017
  header size:                235
  offset to point data:       2593
  number var. length records: 1
  point data format:          0
  point data record length:   64
  number of point records:    59
  number of points by return: 59 0 0 0 0
  scale factor x y z:         0.000001 0.000001 0.000001
  offset x y z:               0 0 0
  min x y z:                  0.310982 -1.066118 -1.673595
  max x y z:                  0.408369 1.278697 -0.110797
  start of waveform data packet record: 0
variable length header record 1 of 1:
  reserved             0
  user ID              'LASF_Spec'
  record ID            4
  length after header  2304
  description          'by LAStools of rapidlasso GmbH'
    Extra Byte Descriptions
      data type: 3 (unsigned short), name "extra1", description: "extra1 blah blah", scale: 1 (not set), offset: 0 (not set)
      data type: 5 (unsigned long), name "extra2", description: "extra2 blah blah", scale: 1e-006, offset: 0 (not set)
      data type: 6 (long), name "extra3", description: "extra3 blah blah", scale: 1e-006, offset: 0 (not set)
      data type: 5 (unsigned long), name "extra4", description: "extra4 blah blah", scale: 1e-006, offset: 16
      data type: 5 (unsigned long), name "extra5", description: "extra5 blah blah", scale: 1e-006, offset: 34
      data type: 6 (long), name "extra6", description: "extra6 blah blah", scale: 1e-006, offset: 0 (not set)
      data type: 6 (long), name "extra7", description: "extra7 blah blah", scale: 1e-006, offset: 0 (not set)
      data type: 6 (long), name "extra8", description: "extra8 blah blah", scale: 1e-006, offset: 0 (not set)
      data type: 6 (long), name "extra9", description: "extra9 blah blah", scale: 1e-006, offset: 0 (not set)
      data type: 6 (long), name "extra10", description: "extra10 blah blah", scale: 1e-006, offset: 0 (not set)
      data type: 5 (unsigned long), name "extra11", description: "extra11 blah blah", scale: 1e-006, offset: 0 (not set)
      data type: 3 (unsigned short), name "extra12", description: "extra12 blah blah", scale: 1 (not set), offset: 0 (not set)
reporting minimum and maximum for all LAS point record entries ...
  X              310982     408369
  Y            -1066118    1278697
  Z            -1673595    -110797
  intensity           0          0
  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:        59
number of intermediate returns: 0
number of last returns:         59
number of single returns:       59
overview over number of returns of given pulse: 59 0 0 0 0 0 0
histogram of classification of points:
              59  never classified (0)

E:\LAStools\bin>las2txt -i testData.las -parse xyz0123456789(10)(11) -stdout
0.310982 1.278697 -0.153021 22750 3.244926 -0.909524 17.006714 34.195129 0.000000 0.000000 0.000000 0.000000 0.000000 0.100000 1
0.311021 1.277097 -0.151240 23514 3.235763 -0.916025 17.006836 34.195202 0.000000 0.000000 0.000000 0.000000 0.000000 0.200000 2
0.311002 1.277977 -0.149754 23748 3.226600 -0.922526 17.007080 34.195274 0.000000 0.000000 0.000000 0.000000 0.000000 0.300000 3
0.311128 1.272698 -0.147552 25938 3.217437 -0.929027 17.007324 34.195347 0.000000 0.000000 0.000000 0.000000 0.000000 0.400000 4
0.311160 1.271388 -0.145818 29834 3.208273 -0.935528 17.007568 34.195419 0.000000 0.000000 0.000000 0.000000 0.000000 0.500000 5
0.311195 1.269977 -0.144077 31990 3.199110 -0.942029 17.007813 34.195492 0.000000 0.000000 0.000000 0.000000 0.000000 0.600000 6
0.311164 1.271345 -0.142652 32726 3.189947 -0.948530 17.007935 34.195564 0.000000 0.000000 0.000000 0.000000 0.000000 0.700000 7
0.311098 1.274202 -0.141389 31198 3.180784 -0.955031 17.008179 34.195637 0.000000 0.000000 0.000000 0.000000 0.000000 0.800000 8
0.311150 1.272089 -0.139574 28768 3.171620 -0.961532 17.008423 34.195705 0.000000 0.000000 0.000000 0.000000 0.000000 0.900000 9
0.311266 1.267190 -0.137463 29388 3.162457 -0.968033 17.008545 34.195778 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 100
0.311219 1.269246 -0.136110 27546 3.153294 -0.974534 17.008789 34.195850 0.000000 0.000000 0.000000 0.000000 0.000000 1.100000 101
0.311201 1.270108 -0.134626 25740 3.144130 -0.981035 17.009033 34.195923 0.000000 0.000000 0.000000 0.000000 0.000000 1.200000 102
0.311133 1.273057 -0.133358 26788 3.134967 -0.987536 17.009277 34.195995 0.000000 0.000000 0.000000 0.000000 0.000000 1.300000 103
0.311203 1.270136 -0.131476 31350 3.125804 -0.994037 17.009399 34.196068 -0.413735 0.184329 9.384494 -0.002120 0.001975 1.400124 104
0.311252 1.268109 -0.129693 33560 3.116641 -1.000538 17.009644 34.196140 -0.413735 0.184329 9.384494 -0.002120 0.001975 1.500124 105
0.311192 1.270754 -0.128388 30144 3.107477 -1.007038 17.009888 34.196213 -0.413735 0.184329 9.384494 -0.002120 0.001975 1.600124 106
0.311190 1.270910 -0.126828 27926 3.098314 -1.013539 17.010010 34.196285 -0.413735 0.184329 9.384494 -0.002120 0.001975 1.700124 107
0.311241 1.268777 -0.125042 27600 3.089151 -1.020040 17.010254 34.196358 -0.413735 0.184329 9.384494 -0.002120 0.001975 1.800124 108
0.311190 1.271019 -0.123688 27394 3.079988 -1.026541 17.010498 34.196430 -0.413735 0.184329 9.384494 -0.002120 0.001975 1.900124 109
0.311141 1.273160 -0.122319 26456 3.070824 -1.033042 17.010742 34.196503 -0.413735 0.184329 9.384494 -0.002120 0.001975 2.100124 201
0.311224 1.269745 -0.120221 28354 3.061661 -1.039543 17.010864 34.196575 -0.413735 0.184329 9.384494 -0.002120 0.001975 2.200124 202
0.311229 1.269574 -0.118830 31982 3.052498 -1.046044 17.011108 34.196648 -0.413735 0.184329 9.384494 -0.002120 0.001975 2.300124 203
0.311309 1.266253 -0.116755 32552 3.043334 -1.052545 17.011353 34.196716 -0.413735 0.184329 9.384494 -0.002120 0.001975 2.400124 204
0.311312 1.266178 -0.115377 33218 3.034171 -1.059046 17.011475 34.196789 -0.413735 0.184329 9.384494 -0.002120 0.001975 2.500124 205
0.311233 1.269605 -0.114118 32960 3.025008 -1.065547 17.011719 34.196861 -0.413735 0.184329 9.384494 -0.002120 0.001975 2.600124 206
0.311189 1.271554 -0.112523 31978 3.015845 -1.072048 17.011963 34.196934 0.000000 0.000000 0.000000 0.000000 0.000000 2.700000 207
0.311232 1.269799 -0.110797 30904 3.006681 -1.078549 17.012207 34.197006 0.000000 0.000000 0.000000 0.000000 0.000000 2.800000 208
0.408357 -1.065409 -1.638831 5934 3.967334 0.798644 16.167603 38.650856 0.000000 0.000000 0.000000 0.000000 0.000000 2.900000 209
0.408285 -1.062473 -1.638711 6196 3.966639 0.807635 16.167603 38.650940 0.000000 0.000000 0.000000 0.000000 0.000000 3.100000 301
0.408269 -1.061874 -1.642197 6730 3.965944 0.816626 16.167480 38.651024 0.000000 0.000000 0.000000 0.000000 0.000000 3.200000 302
0.408273 -1.062081 -1.646944 6750 3.965249 0.825616 16.167358 38.651112 0.000000 0.000000 0.000000 0.000000 0.000000 3.300000 303
0.408369 -1.066118 -1.657665 6482 3.964555 0.834607 16.167358 38.651196 0.000000 0.000000 0.000000 0.000000 0.000000 3.400000 304
0.408250 -1.061223 -1.654512 6196 3.963860 0.843598 16.167236 38.651279 0.000000 0.000000 0.000000 0.000000 0.000000 3.500000 305
0.408120 -1.055906 -1.650675 6812 3.963165 0.852588 16.167236 38.651367 0.000000 0.000000 0.000000 0.000000 0.000000 3.600000 306
0.407994 -1.050761 -1.647080 7264 3.962470 0.861579 16.167114 38.651451 0.000000 0.000000 0.000000 0.000000 0.000000 3.700000 307
0.408004 -1.051225 -1.652832 6628 3.961776 0.870570 16.166992 38.651539 0.000000 0.000000 0.000000 0.000000 0.000000 3.800000 308
0.408026 -1.052182 -1.658266 8416 3.961081 0.879561 16.166992 38.651623 -1.300744 -0.356962 9.130748 -0.005655 0.007407 3.906759 309
0.398647 -0.664805 -1.050596 9452 3.960386 0.888551 16.166870 38.651707 -1.300744 -0.356962 9.130748 -0.005655 0.007407 4.106759 401
0.389319 -0.279507 -0.442909 10398 3.959691 0.897542 16.166748 38.651794 -1.300744 -0.356962 9.130748 -0.005655 0.007407 4.206759 402
0.389320 -0.279535 -0.444310 10908 3.958997 0.906533 16.166748 38.651878 -1.300744 -0.356962 9.130748 -0.005655 0.007407 4.306759 403
0.389356 -0.281062 -0.447956 8786 3.958302 0.915523 16.166626 38.651962 -1.300744 -0.356962 9.130748 -0.005655 0.007407 4.406759 404
0.398641 -0.664679 -1.062255 5634 3.957607 0.924514 16.166504 38.652050 -1.300744 -0.356962 9.130748 -0.005655 0.007407 4.506759 405
0.398421 -0.655647 -1.050685 5760 3.956912 0.933505 16.166504 38.652134 -1.300744 -0.356962 9.130748 -0.005655 0.007407 4.606759 406
0.398374 -0.653723 -1.050470 5360 3.956217 0.942495 16.166382 38.652222 -1.300744 -0.356962 9.130748 -0.005655 0.007407 4.706759 407
0.398396 -0.654649 -1.054840 4826 3.955523 0.951486 16.166260 38.652306 -1.300744 -0.356962 9.130748 -0.005655 0.007407 4.806759 408
0.398422 -0.655775 -1.059554 4588 3.954828 0.960477 16.166260 38.652390 -1.300744 -0.356962 9.130748 -0.005655 0.007407 4.906759 409
0.407549 -1.032979 -1.673595 4960 3.954133 0.969468 16.166138 38.652477 -1.300744 -0.356962 9.130748 -0.005655 0.007407 5.106759 501
0.407290 -1.022329 -1.660896 5202 3.953438 0.978458 16.166138 38.652561 -1.300744 -0.356962 9.130748 -0.005655 0.007407 5.206759 502
0.397723 -0.626973 -1.021397 5380 3.952744 0.987449 16.166016 38.652645 -1.300744 -0.356962 9.130748 -0.005655 0.007407 5.306759 503
0.397638 -0.623423 -1.018413 5324 3.952049 0.996440 16.166016 38.652733 0.000000 0.000000 0.000000 0.000000 0.000000 5.400000 504
0.397713 -0.626550 -1.026347 5658 3.951354 1.005430 16.165894 38.652817 0.000000 0.000000 0.000000 0.000000 0.000000 5.500000 505
0.397679 -0.625186 -1.026944 5188 3.950659 1.014421 16.165771 38.652905 0.000000 0.000000 0.000000 0.000000 0.000000 5.600000 506
0.406673 -0.996973 -1.642179 4852 3.949965 1.023412 16.165771 38.652988 0.000000 0.000000 0.000000 0.000000 0.000000 5.700000 507
0.406474 -0.988795 -1.633223 4618 3.949270 1.032403 16.165649 38.653072 0.000000 0.000000 0.000000 0.000000 0.000000 5.800000 508
0.406198 -0.977437 -1.618941 5016 3.948575 1.041393 16.165527 38.653160 0.000000 0.000000 0.000000 0.000000 0.000000 5.900000 509
0.406331 -0.982981 -1.632647 5128 3.947880 1.050384 16.165527 38.653244 0.000000 0.000000 0.000000 0.000000 0.000000 6.100000 601
0.406505 -0.990191 -1.649197 4916 3.947186 1.059375 16.165405 38.653328 0.000000 0.000000 0.000000 0.000000 0.000000 6.200000 602
0.406306 -0.982003 -1.640116 4806 3.946491 1.068365 16.165283 38.653416 0.000000 0.000000 0.000000 0.000000 0.000000 6.300000 603
0.406283 -0.981119 -1.643209 4686 3.945796 1.077356 16.165283 38.653500 0.000000 0.000000 0.000000 0.000000 0.000000 6.400000 604


testData.txt

Jung

unread,
Nov 23, 2017, 8:01:58 PM11/23/17
to LAStools - efficient tools for LiDAR processing
Hi Martin,

It works!!!!!
Your help with this would be much appreciated :-)

Thank you, Martin.

Cheers,
Jung

Martin Isenburg於 2017年11月23日星期四 UTC+8下午1時42分33秒寫道:
Reply all
Reply to author
Forward
0 new messages