quantization sign flip

100 views
Skip to first unread message

Drexel Peter

unread,
Dec 6, 2011, 5:16:00 AM12/6/11
to LAStools - efficient tools for LIDAR processing
Martin,
as I am new to las-Files may I ask you some Questions?

I am trying to convert older Lidar-Data-Files held in
ASCII-Format GPS-Time, x,y,z (UTM32) ,intensity(8bit)

212581.453941 32574491.32 5209835.70 1658.28 37
212581.453981 32574490.16 5209834.48 1657.51 42
212581.454021 32574489.05 5209833.33 1656.44 38
212581.454061 32574487.93 5209832.16 1655.87 45
212581.454101 32574486.99 5209831.19 1655.04 44
212581.454141 32574485.83 5209829.97 1654.30 49
212581.454181 32574484.92 5209829.02 1653.58 37
212581.454221 32574484.04 5209828.11 1653.02 36
...

As the easting is with the 32 million offset I try
las2las -i lidar.txt -o lidar.las -iparse txyzi -reoffset 500000
5200000 0 -translate_x -32000000 -scale_intensity 256

to convert to a EPSG 25832 (UTM32) .las-File (and scaling the
Intensity from 8 bit to 16bit).

I get a warning:

WARNING: quantization sign flip for min_x from 3.25745e+007 to
-1.03752e+007.
set scale factor for x coarser than 0.01 with '-scale'
WARNING: quantization sign flip for max_x from 3.25794e+007 to
-1.03703e+007.
set scale factor for x coarser than 0.01 with '-scale'

Can you tell me what that means?. As when I load the resultig .las-
File and the original ASCII-File into a GIS-Viewer they perfectly
match...

But if I do not use -reoffset 500000 5200000 the resultig .las-File
ist shifted to nowhere...

Thanks
Peter

Martin Isenburg

unread,
Dec 6, 2011, 10:05:04 AM12/6/11
to LAStools - efficient tools for LIDAR processing
Hello,

interesting question. assuming these x y z coordinates in the file
'lidar.txt' and the call to las2las shown below

32,574,491.32 5,209,835.70 1,658.28
32,574,490.16 5,209,834.48 1,657.51
32,574,489.05 5,209,833.33 1,656.44

las2las -i lidar.txt -o lidar.las

will - by default - choose result in an of offset 32,500,000 5,200,000
0 and a scale of 0.01 0.01 0.01 to create the LAS file. that means the
scaled and offset integer numbers stored internally in the LAS file
will be

7,449,132 983,570 165,828
7,449,016 983,448 165,751
7,448,905 983,333 165,644

adding '-reoffset 500,000 5,200,000 0' to the command line forces
las2las to use an offset of only 500,000 for the x coordinate. this
will essentially add 32,000,000/0.01 = 3,200,000,000 to the numbers
above. Since this number is too big to be represented as a 32 bit
integer we get a wrap around to negative for the scaled and offset
integer numbers. Therefore the lasreader warns that a sign flip will
occur.

-1,087,518,164 983,570 165,828
-1,087,518,280 983,448 165,751
-1,087,518,391 983,333 165,644

However, adding '-translate_x -32000000' subsequently subtracts
32,000,000/0.01 = 3,200,000,000 from those numbers again and move
these huge x coordinates back into the range of the forced offset
500,000 and we get exactly what we got before

7,449,132 983,570 165,828
7,449,016 983,448 165,751
7,448,905 983,333 165,644

So yes, you are doing it exactly right. But since the reoffsetting
happens on-the-fly in the LASreader_txt "before" the translate_x
transform is applied (which happens later in form of a transform
filter) you still get the warning. Just disregard it. You can check
the values of the scaled and offset integers that are stored inside
LAS with

las2txt -i lidar.las -stdout -parse XYZ | more

instead of

las2txt -i lidar.las -stdout -parse xyz | more

Cheers,

Martin @lastools

Reply all
Reply to author
Forward
0 new messages