LAStools Qgis Toolbox on Ubuntu 14.04

1,583 views
Skip to first unread message

Stéphane Henriod

unread,
Dec 16, 2015, 3:05:22 AM12/16/15
to LAStools - efficient tools for LiDAR processing
Dear all

my first message here, please accept my apologies if I have overlooked something but it seems to me that most messages related to my issue are quite old.

Basically, I would like to get LAStools to work in Qgis 2.12  on Ubuntu 14.04

I have read lots of things about compiling those files http://lastools.org/download/LAStools.zip or using Wine.

But when I download the LAStools zip, I can read, in the /LAStools/QGIS_toolbox/ReadMe file:

For QGIS 2.10 all is great.

I would naively assume that all the tools are natively included in the toolbox but this is obviously not the case: when I activate the Lidar toolbox, I only get those 22 tools, while I would actually need the tools necessary to perform this: http://rapidlasso.com/2015/09/21/creating-dtms-from-dense-matched-points-of-uav-imagery-from-senseflys-ebee/

Can anyone hint me on the current procedure? Where do I have to copy the content of the zip file? Do I need to compile anything? Do I need to install Wine?

Thanks a lot in advance for your help!

Cheers

Stéphane

Martin Isenburg

unread,
Dec 20, 2015, 6:50:59 AM12/20/15
to LAStools - efficient command line tools for LIDAR processing, Victor Olaya
Hello,

When using LAStools on Ubuntu or MacOS you need to run all tools that are only available as *.exe through winE. It was the idea that as soon as you also give Processing the location to the folder containing WinE (see attached picture) that it will list all the available LAStools just like under Windows. 

However. That does not seem to work properly. I tried to simulate using WinE under windows using a "fake" wine.exe that does nothing else than execute the command that follows. This "fake" wine.exe is attached if you want to follow this experiment under window. Just rename it from wine.eee to wine.exe and you can run

wine lasview -i ..\data\fusa.laz

So continue the experiment I changed the relevant parts of the Python so simulate that I am not on Windows. Simply modify the lines 141, 164, and 184 of this file 

C:\Program Files\QGIS Lyon\apps\qgis\python\plugins\processing\algs\lidar\LidarToolsAlgorithmProvider.py

from 

        if (isWindows() or LAStoolsUtils.hasWine()):

to

        if (LAStoolsUtils.hasWine()):

But after putting wine.exe into a newly created D:\wine folder and setting that folder as shown in the attached picture only a part of the LAStools were listed under the LiDAR tools of Processing. It seems that the LAStoolsUtils.hasWine() call returns False in the moment that it is called for the purpose of populating the toolbox and I have not yet determined why. As a temporary fix you can simply change the lines 141, 164, and 184 of this file 

C:\Program Files\QGIS Lyon\apps\qgis\python\plugins\processing\algs\lidar\LidarToolsAlgorithmProvider.py

from 

        if (isWindows() or LAStoolsUtils.hasWine()):

to

        if (True):

and correctly set up the path to Wine as shown in the attached picture. Then it should work. I'll have to powhow with Victor Olaya (the creator of the Processing framework who is cc-ed) how we can change the scripts to make hasWine() work properly ...

Regards,

Martin @rapidlasso

qgis_wine_folder.jpg
wine.eee

Stéphane Henriod

unread,
Dec 21, 2015, 7:18:12 AM12/21/15
to LAStools - efficient tools for LiDAR processing, vol...@gmail.com
Hi Martin

thanks a lot for your answer!

Unfortunately, it still doesn't work for me...

I have updated the lines 141, 164, and 184 from /usr/share/qgis/python/plugins/processing/algs/lidar/LidarToolsAlgorithmProvider.py to

if (True):

And I have added the paths as in the attached screenshot, but I still only have the 22 algorithms.

Can you tell me what should contain the folder given under LASToolsFolder?

I have tried with the one containing the *.exe and with the one containing the *.py but it doesn't work in either case. Maybe this is where I go wrong...

Thanks in advance and best wishes

Stéphane
Processing options_001.png

Martin Isenburg

unread,
Dec 21, 2015, 10:52:21 AM12/21/15
to LAStools - efficient command line tools for LIDAR processing, Victor Olaya
Hi Stephane,

I have updated the lines 141, 164, and 184 from /usr/share/qgis/python/plugins/processing/algs/lidar/LidarToolsAlgorithmProvider.py to

if (True):

And I have added the paths as in the attached screenshot, but I still only have the 22 algorithms.

This cannot be. Even if those listed tools could not possibly work (given your LAStools path setting) the toolbox in processing should definitely list all tools (such as lasground, lasheight, las2dem, lasgrid, ... etc.) because that is what this change will instruct the Python script to do. Maybe the file is read only and was not actually changed? Or the *.pyc file was not recompiled.
 
Can you tell me what should contain the folder given under LAStoolsFolder?
 
You will need to download the LAStools.zip distribution from http://rapidlasso.com/LAStools and then extract the LAStools folder that is inside this ZIP archive. The path to this LAStools folder (ending in ...\LAStools) should be entered in the QGIS Processing Settings as shown in the attached picture. My LAStools folder resides in the main directory of the D: drive, hence the short path name of only D:\LAStools

I have tried with the one containing the *.exe and with the one containing the *.py but it doesn't work in either case. 
Maybe this is where I go wrong...

Both those are wrong. But neither should affect what tools are *listed* in the QGIS LAStools toolbox.

Regards,

Martin @rapidlasso

qgis_wine_folder.jpg

Stéphane Henriod

unread,
Dec 21, 2015, 11:24:39 AM12/21/15
to LAStools - efficient tools for LiDAR processing, vol...@gmail.com
Hi Martin

I was also quite surprised but I can prove that I actually change those lines, see the attached file ;-)  (I indeed edited the file as root)

The only explanation I can think of is that there are maybe various versions of this file and I didn't edit the good one?

I edited the one under /usr/share/qgis/python/plugins/processing/algs/lidar  Anyone familiar with Ubuntu who could tell me if the path should actually be different?

For your second point, I now changed the path to the root of the folder in the ZIP archive that I had already downloaded. Once I manage to get all the tools listed, I'll see if that works as well

Thanks again and cheers

Stéphane
LidarToolsAlgorithmProvider.py

Stéphane Henriod

unread,
Dec 22, 2015, 6:02:35 AM12/22/15
to LAStools - efficient tools for LiDAR processing, Victor Olaya
Dear all

PROBLEM SOLVED, thanks to Martin's explanation and Victor's offline message.

So let me summarize here, in case someone stumbles upon the same issue later:


To get LAStools working in Qgis on Ubuntu:

1) Download the LAStools.zip distribution from http://rapidlasso.com/LAStools
2) Extract the zip archive anywhere
3) Install Wine (available through the Ubuntu Software Center)
4) In Qgis, edit the processing options (Providers / Tools for LiDAR data):
    - LasTools folder: enter here the path to the folder that you have extracted from the zip archive (/some_path/LASTools)
    - Wine folder: enter the path to the Wine binary (typically /usr/bin ). Alternatively, you can find where Wine is installed with the command   whereis wine
5) Since this is apparently not (yet) sufficient to get all the tools working, you still need to edit the file LidarToolsAlgorithmProvider.py  In my case, for any obscure reason, I have 2 installations of the processing toolbox and thus 2 instances of this file:
    - /usr/share/qgis/python/plugins/processing/algs/lidar/LidarToolsAlgorithmProvider.py
    - /home/[user]/.qgis2/python/plugins/processing/algs/lidar/LidarToolsAlgorithmProvider.py

    The second one is the one actually used by Qgis and this is where I had to edit LidarToolsAlgorithmProvider.py. :
    line 145:         if (True):
    line 168:         if (True):
    line 188:         if (True):

 I can now start experimenting with LasTools!

Thanks a lot for your help and for this tool, that looks quite amazing :-)

Cheers

Stéphane

Martin Isenburg

unread,
Jan 29, 2016, 8:31:28 AM1/29/16
to LAStools - efficient command line tools for LIDAR processing, Victor Olaya
Hello,

the issue is finally resolved. My constant nagging of Victor combined with Victor's coding heroics nailed the bug dead: 


Works now perfectly when I "simulate" my Windows machine to be a "non-Windows" machine and provide a PATH to the the wine.exe file I had attached in an earlier message.

I hope this makes it into the next QGIS release.


Martin Isenburg

unread,
Jan 8, 2017, 1:15:20 PM1/8/17
to LAStools - efficient tools for LiDAR processing
Hello,

got an inquiry (off-list) about using LAStools with QGIS 2.18.2 las palmas on Ubuntu 16.04LTS as some of the algorithms (for instance las2view and las2ground) were missing. The question was:

"What might be missing or where might i have gone wrong? I have installed wine and enabled it but the menu still doesn't update, could the problem be as a result of not replacing the "lidar" folder that comes by default with my version of QGIS and the LAStools.zip "lidar" folder contents?" 

My answer was that one needs to install (and enable) Wine because only Window's *.exe binaries are available for those. Then the menu should update. You only need to set the .\LAStools folder (and the .\Wine folder) for the newer version. My "lidar" folders are for much older versions of QGIS only. See and ask here please:

https://groups.google.com/forum/#!searchin/lastools/ubuntu$20qgis$20wine%7Csort:relevance

A few minutes later all was solved as evidenced by the screen shots that were sent (see attached) and I got the message "I really appreciate the help, it has managed to work, all i had to do was restart my ubuntu pc and reload the lastools algorithms. And the binaries are working perfectly via teminal and wine."

Regards,

Martin @rapidlasso
lastools_working_in_QGIS_via_Wine_on_ubuntu.jpg
lasground_GUI_via_Wine_on_ubuntu.png
Reply all
Reply to author
Forward
0 new messages