Re: [LAStools] Cyclone PTS files to LAS

2,230 views
Skip to first unread message

Volker Wichmann

unread,
Sep 25, 2012, 10:51:24 AM9/25/12
to last...@googlegroups.com
Hi,

I haven't tried this myself, but I think all you should need are the
following parameter flags:

-skip 1 (>> skip first line containing the number of points)
-parse xyziRGB (>> the columns to parse)
-translate_then_scale_intensity <offset> <factor>

I think the latter could be
-translate_then_scale_intensity 1024 65535
for the first file and
-translate_then_scale_intensity 0 65535
for the second one.

Best regards,
Volker


On 09/25/2012 01:30 PM, Steven Ramsey wrote:
> Hi All
>
> I have 2 .PTS files exported from Leica Cyclone and am having issues
> running txt2las I don't seem to be getting the format right.
> The two files are the same except the Intensity values.
>
> a PTS files looks like this
>
> 12345 (number of points in the file)
> x,y,z,i,r,g,b where Intensity is in the range -1024 to 1024
> x,y,z,i,r,g,b
> x,y,z,i,r,g,b etc
>
> The other
>
> 12345 (number of points in the file)
> x,y,z,i,r,g,b where Intensity is an interger 0-1
> x,y,z,i,r,g,b
> x,y,z,i,r,g,b
> x,y,z,i,r,g,b etc.
>
>
> Any help would be much apreciated
>
> Steven Ramsey
>
> Leica HDS Technical Specialist
>
> --
> Download LAStools at
> http://lastools.org/
> Visit the LAStools group at
> http://groups.google.com/group/lastools/
> Be social with LAStools at
> http://www.facebook.com/LAStools
> http://www.twitter.com/LAStools


--
______________________________________________

Dr. Volker Wichmann
Technische Leitung / Senior Technical Manager

LASERDATA GmbH
Management and analysis of LiDAR data
Technikerstrasse 21a, A-6020 Innsbruck

phone: +43 (0)512 507 48 66
fax: +43 (0)512 507 48 69
mail: wich...@laserdata.at
web: http://www.laserdata.at
______________________________________________


Martin Isenburg

unread,
Oct 2, 2012, 4:27:42 PM10/2/12
to LAStools - efficient tools for LiDAR processing
Hello Steven,

from my understanding a PTS file from Leica Cyclone looks like this:

12345 (number of points in the file)
x,y,z,i,r,g,b (where Intensity is an integer in the range -2048 to
2047)
x,y,z,i,r,g,b
x,y,z,i,r,g,b
...
x,y,z,i,r,g,b

while the "i,r,g,b" or the "r,g,b" part per point are optional whereas
a PTX file from Leica Cyclone looks like this:

12345 (number of points in the file)
16 (number of columns)
42 (number of points per column)
0 0 0 (xyz offset)
1 0 0 (transformation matrix)
0 1 0
0 0 1
1 0 0 0 (angular transformation matrix)
0 1 0 0
0 0 1 0
0 0 0 1
x,y,z,i,r,g,b (where Intensity is a fraction in the range 0.0 to 1.0)
x,y,z,i,r,g,b
x,y,z,i,r,g,b
...
x,y,z,i,r,g,b

while the "i,r,g,b" or the "r,g,b" part per point are again optional.
At least that's what I have been reading out of your comments from the
laser scanning forum:

http://www.laserscanning.org.uk/forum/viewtopic.php?p=2199
http://www.laserscanning.org.uk/forum/viewtopic.php?p=4758

assuming these are indeed the correct formatting and intensity scaling
for Leica Cyclone PTS and PTX file you can either use pointzip &
pointunzip from http://pointzip.org to convert between PTS/PTX and LAS/
LAZ or you use txt2las with these special parameters:

txt2las -i input.pts -ipts -o output.las
txt2las -i input.ptx -iptx -o output.las

Regards,

Martin @rapidlasso

On Sep 25, 4:30 am, Steven Ramsey <stevenramsey...@googlemail.com>

Martin Isenburg

unread,
Oct 5, 2012, 7:39:55 AM10/5/12
to LAStools - efficient tools for LiDAR processing
Hello,

in the meantime Steven provided me with a large RAR file containing the two files in question. As WinRAR is not actually free software I always use the "unrar.exe" command-line freeware that can only decompress RAR data but that is good enough for me:

C:\lastools\bin>unrar v EynshamHall.rar
UNRAR 3.91 freeware      Copyright (c) 1993-2009 Alexander Roshal
Name Size Packed Ratio
-----------------------------------------------------------------------------------
 EynshamHall.pts          2,385,743,633 617,553,320  25%
 EynshamHallscale.pts  2,802,733,415 601,619,636  21%
-----------------------------------------------------------------------------------

Unfortunately unrar.exe does not support *streaming* decompression of individual files. In contrast, with zip or gzip I can compress the PTS file to LAZ while the *.zip or *.gz file is decompressing. As I am neither in the mood to create two 2 GB large ASCII files nor have sufficient hard disk space (see below) I restrict my experiments so smaller subsets that I extract by running the following commands and then killing the process once I see the process has written about 200 MB.

unrar e -nEynshamHall.pts EynshamHall.rar
unrar e -nEynshamHallscale.pts EynshamHall.rar

C:\lastools\bin>dir Eynsham*
10/04/2012  04:24 AM       209,702,252 EynshamHall.pts
09/30/2012  12:51 AM     1,219,173,108 EynshamHall.rar
10/04/2012  04:29 AM       222,284,385 EynshamHallscale.pts
               3 File(s)  1,651,159,745 bytes
               0 Dir(s)     414,998,528 bytes free

At the end of this message you can see the first few lines of each of the two files. The first file is what I would consider a "proper" PTS file. The second file is not a PTS file but a regular ASCII file. How was the second got created from the first as the only differences are that the header point counter was stripped, the intensity translated and scaled, and commas used as separators instead of spaces.

The first can be compressed with (or with http://pointzip.org)

txt2las -i EynshamHall.pts -parse xyziRGB -translate_intensity 2048 -rescale 0.001 0.001 0.001 -olaz

the second one is a regular ASCII file and can be processed with

txt2las -i EynshamHallscale.pts -parse xyziRGB -scale_intensity 4096 -rescale 0.001 0.001 0.001 -olaz

and you get approximately a 10:1 compression ratio:

C:\lastools\bin>dir Eynsham*
10/05/2012  04:24 AM        21,160,282 EynshamHall.laz
10/04/2012  04:24 AM       209,702,252 EynshamHall.pts
09/30/2012  12:51 AM     1,219,173,108 EynshamHall.rar
10/05/2012  04:27 AM        19,315,269 EynshamHallscale.laz
10/04/2012  04:29 AM       222,284,385 EynshamHallscale.pts

Regards,

Martin @lastools

C:\lastools\bin>more EynshamHall.pts
50396590
27.280418 135.863427 -7.914423 -1282 125 148 77
132.181818 -229.429579 -14.734766 -1725 84 96 50
145.550617 -219.173592 -13.859156 -1709 73 84 44
164.942664 -198.605224 -15.532221 -1627 83 96 45
171.029915 -143.889493 -12.135309 -1735 29 33 19
179.877828 -162.537500 -12.086298 -1626 32 30 19
187.144809 -170.665851 -10.431910 -1724 37 33 21
172.190708 -141.120132 -14.399683 -1653 30 31 20
177.668125 -131.674761 -10.864832 -1684 29 29 18
[...]

C:\lastools\bin>more EynshamHallscale.pts
27.280418,135.863427,-7.914423,0.18701171875,125,148,77
132.181818,-229.429579,-14.734766,0.078857421875,84,96,50
145.550617,-219.173592,-13.859156,0.082763671875,73,84,44
164.942664,-198.605224,-15.532221,0.102783203125,83,96,45
171.029915,-143.889493,-12.135309,0.076416015625,29,33,19
179.877828,-162.537500,-12.086298,0.10302734375,32,30,19
187.144809,-170.665851,-10.431910,0.0791015625,37,33,21
172.190708,-141.120132,-14.399683,0.096435546875,30,31,20
177.668125,-131.674761,-10.864832,0.0888671875,29,29,18
[...]

Peter Dean

unread,
Jul 31, 2018, 11:30:29 PM7/31/18
to LAStools - efficient tools for LiDAR processing


On Wednesday, October 3, 2012 at 6:27:42 AM UTC+10, Martin Isenburg wrote:
Hello Steven,

from my understanding a PTS file from Leica Cyclone looks like this:

12345 (number of points in the file)
x,y,z,i,r,g,b (where Intensity is an integer in the range -2048 to
2047)
x,y,z,i,r,g,b
x,y,z,i,r,g,b
...
x,y,z,i,r,g,b



This is wrong, the first number isn't the number of points in the file. It's the number of points following.  Then there may be another count, followed by count points, followed by count, followed by count points etc etc.  This shows up as a bug in txt2las and also the pointzip program.  We have a 30gig pts file with about 555 million points.  The first line has 514795 and that is what is written to the las header!

 
 

Martin Isenburg

unread,
Aug 2, 2018, 3:00:53 AM8/2/18
to LAStools - efficient command line tools for LIDAR processing
Hello Peter,

that is a bummer. I've been reading up on and answering questions about the unwieldy PTS format for many years but this is the first time that I hear that multiple outputs can be appended to another this way.


This means that the main advantage of a PTS file over a simple XYZ is also toast: knowing how many points are in a file. This information requires parsing all lines of a file (an operation that can take a long time for a 48GB text file) and until know I was under the impression that the PTS file had the advantage that at least this information was readily available after reading only the first line. 


Is there an official PTS format description that I might have missed? A few years back when googling and posting about the PTS format I never found a specification that pointed that out.

Regards,

Martin

--
Download LAStools at
http://lastools.org

Be social with LAStools at
Reply all
Reply to author
Forward
0 new messages