ptx plain text data format

Compiled by Paul Bourke
October 2015


A simple text file to store point data typically from LIDAR scanners. Consists of a number of header lines followed by lines consisting of a vertex (x,y,z), a scalar, and a colour as a r,g,b integer value each between 0 and 255 (although they can sometimes be floats from 0 to 1)..

For LIDAR scanners the header contains the scanner location and any transformation matrices to transform multiple scans into one coordinate system. The LIDAR position can be important for various processing as it gives an orientation to each point. The fourth value is usually an intensity value for the point, range is usually 0 to 1.

The Leica header is as follows.

number of columns
number of rows 
st1 st2 st3 ; scanner registered position 
sx1 sx2 sx3 ; scanner registered axis 'X' 
sy1 sy2 sy3 ; scanner registered axis 'Y' 
sz1 sz2 sz3 ; scanner registered axis 'Z' 
r11 r12 r13 0 ; transformation matrix 
r21 r22 r23 0 ; this is a simple rotation and translation 4x4 matrix 
r31 r32 r33 0 ; just apply to each point to get the transformed coordinate 
tr1 tr2 tr3 1 ; use double-precision variables 

An example file is shown below, with of course the bulk of the points skipped. Note that for simple points clouds the r,g,b values are often missing, so only 4 columns per point. The file can contain multiple scans, so one normally reads the header followed by the number of columns times the number of rows for that scan. If there are additional scans then what follows will be another header followed by scan data ... etc.

6282
157
558312.218127 5240857.469093 76.298415
0.644200 -0.764857 0.000038
0.764857 0.644200 -0.000027
-0.000004 0.000047 1
0.644200 -0.764857 0.000038 0
0.764857 0.644200 -0.000027 0
-0.000004 0.000047 1.000000 0
558312.218127 5240857.469093 76.298415 1
0 0 0 0.500000 0 0 0
12.032272 -2.613480 -2.036392 0.159304 168 183 142
12.860123 -2.793289 -2.162979 0.183719 118 121 94
12.881760 -2.798019 -2.153061 0.183963 103 105 84
12.896347 -2.801193 -2.141922 0.188357 100 111 97
   :
   :
   :
1.310898 -0.674240 1.076859 0.156863 17 17 19
1.310837 -0.674210 1.079025 0.144411 27 26 24
1.310196 -0.673874 1.080795 0.096803 25 24 22


Notes

  • There does not seem to be a flag to indicate how many parameters per line, 4 or 7.

  • While there is nothing that dictates that a ptx file cannot be used for a 1 dimensional list of points, some software does expect a 2D grid from a regular laser scan process.