Page 1 of 2

Converting LAS file into PCD doesn't preserve coordinates?

Posted: Sat Jun 29, 2019 3:01 am
by Shukhrat
Hi,
I need to save LAS files into PCD format in order to run them in PCL algorithm. However, saving as PCD format in CC is not preserving original coordinates of points, it is converting into some local coordinates. Is it possible to preserve original coordinates after converting into PCD file?

Thank you,

Kind regards,
Shukhrat

Re: Converting LAS file into PCD doesn't preserve coordinates?

Posted: Sun Jun 30, 2019 8:03 pm
by daniel
I think the issue was that PCD files are using 32 bit floating point values. Hence they don't allow for storing large coordinates (without losing accuracy). This is why CC is not able to 'restore' the original coordinate system.

One option is to reject the 'Global Shift' suggested by CC when loading the LAS file (especially if it's not that big) and then save the cloud as PCD. But beware of the loss of numerical accuracy if the coordinates are huge.

Re: Converting LAS file into PCD doesn't preserve coordinates?

Posted: Mon Jul 01, 2019 6:05 am
by Shukhrat
Thanks for your quick reply Daniel.

If I reject the 'Global Shift' as you suggested, projected coordinates are not imported at all which I won't be able to save them in PCD format. But I need projected coordinates for my analysis. Coordinates look like eg. X = 696056.000 Y = 6106512.000. Is there any other option you can suggest?
Thanks

Re: Converting LAS file into PCD doesn't preserve coordinates?

Posted: Mon Jul 01, 2019 8:53 pm
by daniel
What do you call 'projected coordinates'? I thought you wanted to keep the original coordinates? (which is what you should get when rejecting the Global Shift...).

Re: Converting LAS file into PCD doesn't preserve coordinates?

Posted: Tue Jul 02, 2019 1:41 am
by Shukhrat
Original point cloud has EPSG:28355. If I reject Global Shift while importing the point cloud, coordinates are changing into some local coordinates. And if I export into PCD, it doesn't restore original EPSG:28355 but saving local coordinates. I need original EPSG 28355 in output PCD file.
Thanks

Re: Converting LAS file into PCD doesn't preserve coordinates?

Posted: Tue Jul 02, 2019 8:22 pm
by daniel
If you reject the Global Shift, then you really get what's inside the file... CloudCompare doesn't change anything in this case.

Re: Converting LAS file into PCD doesn't preserve coordinates?

Posted: Wed Jul 03, 2019 1:46 am
by Shukhrat
It doesn't look like that. Because, please look at the first attached image (prtscr1.jpeg), print screen from point cloud, it was taken by checking "Preserve global shift on save". As you can see it shows original (Xg, Yg, Zg) and local coordinates (XI, YI,ZI). If I export this file in PCD format, original coordinates disappear, but preserves local coordinates.

The second attached file (prtscr2.jpeg) is taken by unchecking "Preserve global shift on save". And it has no original coordinates but has local coordinates only. If I export it into PCD format, output file has only local coordinates.
Therefore I am stuck here, I need to export into PCD by preserving original coordinates. Am I missing something?
Thanks,

Re: Converting LAS file into PCD doesn't preserve coordinates?

Posted: Wed Jul 03, 2019 8:19 pm
by daniel
Ah ah, what I mean by rejecting the Global Shift, is actually to click "No" when the Global shift/scale dialog appears.

If you just play with the checkbox, then you accept ("Yes") the Global Shift anyway. You just change whether CC tries to restore it when saving the file or not (which is actually never possible with PCD files).

Re: Converting LAS file into PCD doesn't preserve coordinates?

Posted: Thu Jul 04, 2019 12:40 am
by Shukhrat
Ah, really sorry for misunderstanding. It worked now.
Thank you so much!

Re: Converting LAS file into PCD doesn't preserve coordinates?

Posted: Fri Jul 12, 2019 5:11 am
by Shukhrat
Hi Daniel,
Sorry I am back to this question again. I need this LAS to PCD conversion in order to run PCL package. I tried to import LAS file with Global Shift "No" and it is converting into PCD by preserving coordinates. However, if I open PCD file in CC, point cloud turned into some strip lines, it doesn't look like LAS file one. Please have a look images below. And outputs from PCL package with Global shift and without Global shift are totally different. With Global Shift "No", PCL output is returning poor result (prscn4), Global Shift "Yes" is perfectly what I want for output (prscn3), but no coordinates preserved. Do you know how to avoid strip lines in point cloud when importing with Global Shift "No"? Thanks so much for your help.
Global shift "Yes" (prscn2.png)
and Global Shift "No" (prscn1.png)