risky behaviour of CLI hwen using -FEATURE

If you are allergic to bug trackers, you can post here any remarks, issues and potential bugs you encounter
Post Reply
PablerasBCN
Posts: 296
Joined: Sat Jan 20, 2018 1:57 pm

risky behaviour of CLI hwen using -FEATURE

Post by PablerasBCN »

Hello

I've noticed a never before seen behaviour at the time of saving when using CLI. I can´t tell right now if I had never used -feat before, yet I would say I doubt.

The thing is that I was not seeing any file output, and when reading command line I noticed:

[SAVING]
[LAS] scalar field Eigenentropy (0.132) will be saved automatically in the extra fields of the output file
[I/O] File 'E:**************/08OE2704_temp.las' saved successfully
Processed finished in 305.32 s.

So I opened and I confirmed it was overwriting files.

THANKFULLY.

theese files had already the SF removed because are the output files of a .bin, but could have been cathastrophic.

I've been few months without using CLI, but I would say, that even without timestamp, which I allways remove, there was extra info added to the name, like the commands used and may be values, but not this time.

The very least would be at the launch of the bat to be warned that files will be overwritten.

my .bat file looks like:

for %%f in (E:\************\02_VegetationOnly_ColorFixed\*.las) DO "C:\Program Files\CloudCompare\cloudcompare.exe" -SILENT -O -GLOBAL_SHIFT AUTO %%f -AUTO_SAVE OFF -C_EXPORT_FMT LAS -NO_TIMESTAMP -REMOVE_ALL_SFS -FEATURE EIGENTROPY 0.132 -SAVE_CLOUDS
PablerasBCN
Posts: 296
Joined: Sat Jan 20, 2018 1:57 pm

Re: risky behaviour of CLI hwen using -FEATURE

Post by PablerasBCN »

So I did a test just in case this issue was not specific to -Feature command but to other commands.

tested both with timestamp and without, and seems to be working nicely by outputing renamed files, not overwritting.

This time I did filter a scalar field and perform a duplicate removal.

the file output naming being like "08OE1794_temp_FILTERED_[0_0.05]_REMOVED_DUPLICATE_POINTS" where input was "08OE1794_temp".

So. I would request the -FEATURE command to work in a similar fashin, writting into the name the computed faature, and may be scale.
HeadLess
Posts: 56
Joined: Mon Mar 25, 2019 9:27 pm

Re: risky behaviour of CLI hwen using -FEATURE

Post by HeadLess »

I've did a PR to CloudCompare git it should fix your problem as soon as it's merged, and built.

https://github.com/CloudCompare/CloudCompare/pull/1913
PablerasBCN
Posts: 296
Joined: Sat Jan 20, 2018 1:57 pm

Re: risky behaviour of CLI hwen using -FEATURE

Post by PablerasBCN »

Thank you so much. I'm sure this will save someone from data loss in the future :D
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: risky behaviour of CLI hwen using -FEATURE

Post by daniel »

Yes this is now merged. Thanks @HeadLess.

I'll updated the 2.13.beta version later during the week-end.
Daniel, CloudCompare admin
PablerasBCN
Posts: 296
Joined: Sat Jan 20, 2018 1:57 pm

Re: risky behaviour of CLI hwen using -FEATURE

Post by PablerasBCN »

-Remove_SF command also overwrites source file. Not sure if this is intended behaviour, but there is some data loss risk as it behaves different from the most common behaviour that is to create a new file with the commands used in the name.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: risky behaviour of CLI hwen using -FEATURE

Post by daniel »

I've just looked at the code, and I don't see any 'auto-save' call associated to this option.

So you have to manually call -SAVE_CLOUDS. But by default a timestamp is added to the original filename. Therefore, the only way to overwrite the original file is either to voluntarily disable the timestamp, or to use the FILE sub-option with a specific filename that would the original filename.

Did you observe another behavior?
Daniel, CloudCompare admin
PablerasBCN
Posts: 296
Joined: Sat Jan 20, 2018 1:57 pm

Re: risky behaviour of CLI hwen using -FEATURE

Post by PablerasBCN »

Not 100% sure this was the .bat at the moment of making this post.

But still, yes, as a rule of thum I dissable timestamp to avoid bloat in naming and save clouds on my command.

"for %%f in (E:\--the path---\*.las) DO "C:\Program Files\CloudCompare\cloudcompare.exe" -SILENT -O -GLOBAL_SHIFT AUTO %%f -AUTO_SAVE OFF -C_EXPORT_FMT LAS -NO_TIMESTAMP -SET_ACTIVE_SF R -REMOVE_SF -1 -SET_ACTIVE_SF G -REMOVE_SF -1 -SET_ACTIVE_SF B -REMOVE_SF -1 -SET_ACTIVE_SF Alpha -REMOVE_SF -1 -SET_ACTIVE_SF Composite -REMOVE_SF -1 -SAVE_CLOUDS"

With other commands, like filter etc, the name of the output file has the commands in the name that led to that output file, like could be "08OE0748_PCV_FILTERED_[3.1_5]_C2C_DIST_MAX_DIST_0.25"

May be there is a reason for this notn to be the case.

Now that I know with this command I'll be more carefull, yet, as said, this one behaves differently to others when no timestamp breaking the coherence in the behaviour.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: risky behaviour of CLI hwen using -FEATURE

Post by daniel »

It's just that it's a 'utility' function and not a real algorithm/process. You could call it 3 or 5 times with different SF names, and that would make a super long 'composite' name...
Daniel, CloudCompare admin
Post Reply