command line mode - skipping rows not working?

If you are allergic to bug trackers, you can post here any remarks, issues and potential bugs you encounter
Post Reply
wojman
Posts: 1
Joined: Mon Sep 09, 2024 8:19 am

command line mode - skipping rows not working?

Post 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
daniel
Site Admin
Posts: 7674
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: command line mode - skipping rows not working?

Post 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!
Daniel, CloudCompare admin
Post Reply