I have a text file I want to convert txt to las

3,853 views
Skip to first unread message

Mite Zsz

unread,
Apr 20, 2016, 5:27:36 AM4/20/16
to LAStools - efficient tools for LiDAR processing
I use lastools to convert text to las but i don't know the parameter in txt file

exaple text file

427,614895.36,1734004.56,23.18,4
428,614897.55,1734003.88,28.96,1
429,614895.50,1734004.55,23.18,4
430,614897.61,1734003.90,28.69,1
431,614897.75,1734003.90,28.62,1
432,614897.94,1734003.88,28.68,1
433,614898.05,1734003.89,28.50,1
434,614898.18,1734003.89,28.39,1
435,614896.57,1734004.42,23.84,4

first column i know it mean the no. of data
second column is coordinate x
third column is coordinate y
forth column is coordinate z
but i don't know what the last column mean ? 

Q: I want to  know what does last column mean? and i want to convert it to las file how to do that because i use txt to las but it doesn't work.

Kirk Waters - NOAA Federal

unread,
Apr 20, 2016, 8:58:54 AM4/20/16
to LAStools - efficient command line tools for LIDAR processing
Mite,
Do you have any more information about the origins of the data? Are there more values for the last column besides 1 and 4? If I were to guess with the information you provided, I'd think the last column was a classification. All the 4's are around 23 and all the 1's are around 28. That makes sense for ASPRS class 1 as unclassified and clearly not ground points, but ASPRS class 4 would be unusual. It could be a different class scheme though or I could be wrong about it being the class.

Kirk Waters, PhD                     | NOAA Office for Coastal Management
Applied Sciences Program      | 2234 South Hobson Ave
843-740-1227                          | Charleston, SC 29405    

Andrew Hewitt

unread,
Apr 20, 2016, 8:59:53 AM4/20/16
to LAStools - efficient tools for LiDAR processing
Hey Mite, 

try using this command:
txt2las -i example.txt -parse sxyzc -o mylas.las

the parse parameter tells the program how to read the fields:
-s skips the first field, 
-xyz gives the order of the xyz poitns, and
-c I'm guessing the last value is classification

Terje Mathisen

unread,
Apr 20, 2016, 9:01:35 AM4/20/16
to last...@googlegroups.com
Mite Zsz wrote:
> I use lastools to convert text to las but i don't know the parameter
> in txt file
>
> exaple text file
>
> 427,614895.36,1734004.56,23.18,4
> 428,614897.55,1734003.88,28.96,1
> 429,614895.50,1734004.55,23.18,4
> 430,614897.61,1734003.90,28.69,1
> 431,614897.75,1734003.90,28.62,1
> 432,614897.94,1734003.88,28.68,1
> 433,614898.05,1734003.89,28.50,1
> 434,614898.18,1734003.89,28.39,1
> 435,614896.57,1734004.42,23.84,4
>
> first column i know it mean the no. of data
> second column is coordinate x
> third column is coordinate y
> forth column is coordinate z
> but i don't know what the last column mean ?Â
>
Do you see any other numbers in that column besides 1 and 4?

If you also see a bunch of 2s and 3s then it is likely that this is the
return number, otherwise I would just ignore both the first and last
column and only convert the (x,y,z) triplets to LAZ.

Terje

--
- <Terje.M...@tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Nicolas Cadieux

unread,
Apr 20, 2016, 9:31:55 AM4/20/16
to last...@googlegroups.com, mitez...@gmail.com

Second try. The first message was filtered out as a spam I think.
Cheers
Nicolas

On Apr 20, 2016 07:11, Nicolas Cadieux <nicolas...@archeotec.ca> wrote:

>

> Hi,
>
> The all mighty missing metadata.  Could be return number , number of returns (both 1 to 4 usually for older scanner models) but it could be a classification (although 1 (not classified) and 2 (bare earth) are usually seen). 
>
> The best way to find out is to figure out the full range of values in your column.  You could use lasinfo and guess the parsing of the last column.  You can also visualize it in lasview or cloud compare and select the last column for the viewing parameter. 
>
> Worse case scenario, you are getting errors because the file are not all identical because of missing data or swapped fields or the use of a different splitting character (space vs comma).  Explaining the lastools error you are getting would also help Id the field. 
>
> If you are really in a bind, contact me directly.  I can have a look at the problem if you can upload the txt files. I have been working on a number of tools for this type of problems in large txt files.
>
> Nicolas
>
> Nicolas dot Cadieux at archeotec dot ca.


>
> On Apr 20, 2016 03:39, Mite Zsz <mitez...@gmail.com> wrote:

>>

>> I use lastools to convert text to las but i don't know the parameter in txt file
>>
>> exaple text file
>>
>> 427,614895.36,1734004.56,23.18,4
>> 428,614897.55,1734003.88,28.96,1
>> 429,614895.50,1734004.55,23.18,4
>> 430,614897.61,1734003.90,28.69,1
>> 431,614897.75,1734003.90,28.62,1
>> 432,614897.94,1734003.88,28.68,1
>> 433,614898.05,1734003.89,28.50,1
>> 434,614898.18,1734003.89,28.39,1
>> 435,614896.57,1734004.42,23.84,4
>>
>> first column i know it mean the no. of data
>> second column is coordinate x
>> third column is coordinate y
>> forth column is coordinate z

>> but i don't know what the last column mean ? 
>>
>> Q: I want to  know what does last column mean? and i want to convert it to las file how to do that because i use txt to las but it doesn't work.
>>

Martin Isenburg

unread,
Apr 21, 2016, 2:16:21 AM4/21/16
to LAStools - efficient command line tools for LIDAR processing, mitez...@gmail.com
Hello,

Mite shared his data with me. You can find it here:


This is what I tried. It is definitely not a classification value. Looks more like some way of encoding multiple returns (see attached pictures). Who can solve the riddle ... ?

D:\LAStools\bin>txt2las -i 504031636_org.txt -parse sxyzc -o 504031636_org.laz
WARNING: written 3880446 points but expected 0 points

D:\LAStools\bin>lasinfo -i 504031636_org.laz
lasinfo (160411) report for 504031636_org.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:        'txt2las (version 160411)'
  file creation day/year:     112/2016
  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:    3880446
  number of points by return: 3880446 0 0 0 0
  scale factor x y z:         0.01 0.01 0.01
  offset x y z:               600000 1700000 0
  min x y z:                  616000.00 1736000.00 19.88
  max x y z:                  617999.99 1737999.99 128.54
LASzip compression (version 2.4r1 c2 50000): POINT10 2
reporting minimum and maximum for all LAS point record entries ...
  X             1600000    1799999
  Y             3600000    3799999
  Z                1988      12854
  intensity           0          0
  return_number       1          1
  number_of_returns   1          1
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      1          4
  scan_angle_rank     0          0
  user_data           0          0
  point_source_ID     0          0
number of first returns:        3880446
number of intermediate returns: 0
number of last returns:         3880446
number of single returns:       3880446
overview over number of returns of given pulse: 3880446 0 0 0 0 0 0
histogram of classification of points:
         3661840  unclassified (1)
            7454  ground (2)
          211152  medium vegetation (4)

D:\LAStools\bin>lasview -i 504031636_org.laz -drop_class 1

D:\LAStools\bin>lasview -i 504031636_org.laz -drop_class 2 4
txt2las_codes_2_4_dropped_1.jpg
txt2las_code_1_dropped_2_4.jpg

Edgar Veldman

unread,
Apr 21, 2016, 10:17:22 AM4/21/16
to LAStools - efficient tools for LiDAR processing, mitez...@gmail.com
Hi Martin,

Terrascan has (or used to have) a habit of using coding of 1,2,3 of 4 to separate the echo/return type:

1 - only echo
2 - first of many
3 - intermediate
4 - last of many

Could that be it?

Edgar
Reply all
Reply to author
Forward
0 new messages