G’day Lastools forum
I’ve just got stuck into my honors project after a sizable absence and I’m struggling to get Lastools to work for me.
I’ve designed an elaborate algorithm to extract detailed structural data from vegetation. Its output however takes the form of txt files and in order to test and confirm its effectiveness I need to view the data in lasedit.
I know it is possible to convert and view a txt file in lasedit using Lastools as I’ve done it before however I’m buggered if I can work out how I did it.
I’m attempting to write up a procedure to achieve this however I’m stuck in commander.
My test dataset looks something like figure 1, for simplicity sake this txt file and the Lastools folder are both stored in my Documents folder and when opened looks like figure 2.
Figure 1
Figure 2
At present my procedure is as follows;
So that the entire combined code reads;
C:\Users\Matt\Documents> txt2las -i lidar.txt.gz -o lidar.las -parse xyz
When I hit ‘Enter’ however, I am returned the error in figure 3, reading “‘txt2las’ is not recognized as an internal or external command, operable program or batch file”.
Figure 3.
Hi,
Windows does not know where lastools is found on your computer. This is normal for programs that don't have a windows install launcher.
You have three options.
1: use the txt2las graphical interface (GUI) by clicking on txt2las.exe found in the lastools folder.
2: Go to the txt2las.exe folder (for example c:\lastools\bin)
And do the command from there. This time you will need to give the files complete path: like
txt2las -i C:\Users\Matt\Documents\lidar.txt.gz -o C:\Users\Matt\Documents\lidar.las -parse xyz
Or best, add the lastools folder to your Windows systems variables so that windows will know in what folder to look for to find lastools. Look that up in the net. It is easy to do.
Nicolas Cadieux M.Sc.
Les Entreprises Archéotec inc.
8548, rue Saint-Denis Montréal H2P 2H2
Téléphone: 514.381.5112 Fax: 514.381.4995
www.archeotec.ca
--
Download LAStools at
http://lastools.org
http://rapidlasso.com
Be social with LAStools at
http://facebook.com/LAStools
http://twitter.com/LAStools
http://linkedin.com/groups/LAStools-4408378
Manage your settings at
http://groups.google.com/group/lastools/subscribe
Cheers for the prompt responses guys
I tried to add the Lastools folder to my windows system variables, using the following procedure;
Windows Vista and Windows 7 users
1. From the Desktop, right-click the Computer icon and select Properties. If you don't have a Computer icon on your desktop, click the Start button, right-click the Computer option in the Start menu, and select Properties.2. Click the Advanced System Settings link in the left column.
3. In the System Properties window, click on the advanced tab, then click the Environment Variables button near the bottom of that tab.
4. In the Environment Variables window, highlight the Path variable in the "System variables" section and click the Edit button. Add or modify the path lines with the paths you want the computer to access. Each different directory is separated with a semicolon.
The original path looked something like this;
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\COMMON~1\ULEADS~1\MPEG;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
The new path looked something like this;
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\COMMON~1\ULEADS~1\MPEG;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Users\Matt\Documents\LAStools
I still get the same result when I run the code, returning me the error in figure 3 of my previous post, reading “‘txt2las’ is not recognized as an internal or external command, operable program or batch file”.
I then attempted to run the command from the bin folder by changing directory and then changing the path until I got to the bin folder and then pasting in the line you recommended (txt2las -i C:\Users\Matt\Documents\lidar.txt.gz -o C:\Users\Matt\Documents\lidar.las -parse xyz) however that did not work either, returning ‘ERROR: no input specified’.
In the end however I was able to navigate the GUI with relative ease to convert the data which seemed to work quite well initially and the test dataset seemed to look fine when I viewed it in the GUI however when I opened the resultant las file in LASedit I ended up with an unusual result;
In Lastools;
Wow. This looks beautiful ... (-:
Maybe it is best you upload your data somewhere and send us a link. There is no other way for anyone of us to know what is really going on ...
Martin
--
Ah yes I apologize for the unconventional point values I should have explained that the data I’ve attached is an artificial analogue to test my algorithm before I start trying to run it for real field data.
I’ve made this data using simple values without the many decimal places so I can track the calculations in the algorithm more clearly. The values are relative to one and other in a 3D Cartesian plane with coordinates centered around a growth point (at X = 0, Y = 0 and Z = 0) from which my hypothetical tree grows.
Forgive my ignorance but I still can’t seem to understand why your viewer shows the data perfectly but the LASEdit viewer shows such a radically different structure for the exact same data when it is converted to a las file.
Below is a run through of the process and results I am getting, still using the same files as above;
I open the txt2las GUI (Lastools>Bin>txt2las).
Select browse, navigate to my lidar.txt file and double click.
I click view and start and subsequently the data is presented exactly as it should be in the ‘just a
little LAS and LAZ viewer’ viewer (I’ve hit ‘=’ half a dozen times to make it
clearer as seen in figure 1).
Figure 1
The image in the viewer is exactly as I expect the data to look.
I then change the format to ‘las’ of the right hand side of the GUI and hit run and start.
When I double click on the subsequent LASEdit LiDAR file which appears in my folders (figure 2)…
Figure 2
… I’m given the option to select meters or feet, for which I select meters (figure 3)
Figure 3
And the following text box (figure 4), which I simply dismiss by hitting cancel…
Figure 4
This is where I’m getting lost, I don’t understand why the data looks so different and has such a different structure (figure 5) to that in the ‘just a little LAS and LAZ viewer’
Figure 5