LAStools problem encoding

1,607 views
Skip to first unread message

mattia agostino

unread,
Jul 22, 2022, 6:16:32 AM7/22/22
to LAStools - efficient tools for LiDAR processing
Hi everyone, I'm trying to proces a las file with a plugin named OpenLidarToolbox.
While processing appears to me this message:

LAStools console output
Traceback (most recent call last):
File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\LAStools\LAStools\lasground.py", line 75, in processAlgorithm
LAStoolsUtils.runLAStools(commands, feedback)
File "C:\Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\LAStools\LAStoolsUtils.py", line 61, in runLAStools
feedback.pushConsoleInfo(output.decode("utf-8"))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8a in position 17: invalid start byte

Execution failed after 0.03 secondi

Then I try to remove this line from this file LAStoolsUtils.py


feedback.pushConsoleInfo(output.decode("utf-8"))

Then i use again the tool and occurs this error

thread 'main' panicked at 'Impossibile trovare il file specificato. (os error 2)', whitebox-tools-app\src\main.rs:72:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Process returned error code 101

Risultati: {'output': 'C:/Users/User/AppData/Local/Temp/processing_NNfryO/2d965460da5e473aaebf4784422adb79/gpd.tif'}

Errore: Algoritmo grass7:r.resample non trovato

Errore: Algoritmo grass7:r.resample non trovato

Execution failed after 0.28 secondi

Any suggestion?


Jochen Rapidlasso

unread,
Jul 22, 2022, 6:23:12 AM7/22/22
to LAStools - efficient tools for LiDAR processing
Hi Mattia,
we had this before in
https://groups.google.com/g/lastools/c/OPOqgEDG1Vk/m/R1ijzqS-AwAJ
As I see you removed the line as suggested there.
I think the result is no valid utf-8 and therefore the decoding fail.
If you remove the line I gues the output is suppressed - may you try the line:
 feedback.pushConsoleInfo(output)  
or
 feedback.pushConsoleInfo(output.decode('UTF-8','ignore')  

If this not work: Can you provide me the files you are testing with and I will see if I can reproduce the problem here.

Jochen @rapidlasso

mattia agostino

unread,
Jul 22, 2022, 6:35:52 AM7/22/22
to LAStools - efficient tools for LiDAR processing
This is the file


I think the problem is on my machine,
 
I try both lines: 
feedback.pushConsoleInfo(output)  --> same error
feedback.pushConsoleInfo(output.decode('UTF-8','ignore')  --> "C:/Program" non riconosciuto come comando interno o esterno,

un programma eseguibile o un file batch.

Execution completed in 0.04 secondi

Risultati:

{'': None}


Caricamento layer

Algoritmo 'lasinfo' terminato


Many thanks

Jochen Rapidlasso

unread,
Jul 22, 2022, 6:41:49 AM7/22/22
to LAStools - efficient tools for LiDAR processing
Hi Mattia,
quite often calls to the OS/QGIS/LAStools struggle with spaces in the commandline.
The output  --> "C:/Program" non ... lead me to this assumption.
So you may try to run something within  "C:\Program files\..."
Try to set your path settings to somewhere where you do not have spaces and/or UTF-8 chars in the file and/or path name.
About the path you can run the command
dir /x
to get the "spaceless" dir alternatives like
20.07.2022  14:11    <DIR>          PROGRA~1     Program Files
18.07.2022  17:34    <DIR>          PROGRA~2     Program Files (x86)
So just use e.g. "PROGRA~1" as your directory name.
Best,
Jochen @rapidlasso

mattia agostino

unread,
Jul 22, 2022, 7:20:47 AM7/22/22
to LAStools - efficient tools for LiDAR processing

I move the LAStools folder in C:/ and i think now works

Many thanks


Mattia 

Reply all
Reply to author
Forward
0 new messages