Page 1 of 1

command line mode - skipping rows not working?

Posted: Mon Sep 09, 2024 10:24 am
by wojman
Hello,
so I have an ascii file PCfile.csv:

Code: Select all

X,Y,Z,Intensity,Gps Time
3.3833150887628816,6.979393482208252,4.130593689034995,2,105.000023
3.5784558360938767,9.697367668151855,4.81136836963311,7,105.000043
3.455694084029676,7.1844482421875,3.995544543273466,5,105.000063
3.166857437205203,6.628635406494141,3.67181704860269,3,105.000083
3.447285683223771,7.266369342803955,3.6280596335927977,42,105.000103
...
and I want to export it as LAS file (after some more operations like subsample etc). This works pretty well when doing it manully: import ascii file, skip one row - the header, check extract scalar field names from first line, load, ..., export as LAS -> all fileds are correctly saved within LAS format.
Now I have plenty of similar pointcloud files and I want to automatize it with use of command line mode. My code:

Code: Select all

CloudCompare -O -SKIP 1 -GLOBAL_SHIFT AUTO PCfile.csv -C_EXPORT_FMT LAS -EXT laz -SS SPATIAL 0.01
The process went to succesfull end but fields Intesity and Gps Time is saved as "Scalar field" and "Scalar field #2". Console output says
...
[LOAD]
Will skip 1 lines
Opening file: 'PCfile.csv'
[AsciiFilter :: Load] Line 1 is corrupted (non numerical value found)
...
[LAS] scalar field Scalar field will be saved automatically in the extra fields of the output file
[LAS] scalar field Scalar field #2 will be saved automatically in the extra fields of the output file
...
So I guess it won't skip the first line and/or didn't use column names.

I tried to solve it by renaming SF but I couldn't figure out how to rename field to "Gps Time" with space.
Thanks for your help in advance.
Vojtech

Re: command line mode - skipping rows not working?

Posted: Mon Sep 09, 2024 11:27 am
by daniel
Hum, indeed, this use case might not be properly handled with the command line mode. You would need to be able to extract the SF names from the first line ideally.

And I don't believe it's possible to input a SF name with a space character either...

Something (or 2 things) to add to the TODO list!