Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there any tool available for extracting the X, Y and Z channels from a .las file and exporting them to a .csv or similar file?

share|improve this question
1  
Welcome to GIS SE! Are you looking for new software or do you already have GIS software and are just looking for a tool you have not used? –  PolyGeo Jul 22 '13 at 11:01
1  
Thanks. Just any piece of software would be fine. –  Dan Jul 22 '13 at 11:38
add comment

2 Answers 2

up vote 4 down vote accepted

las2txt from liblas.org may do what you want:

http://www.liblas.org/utilities/las2txt.html

share|improve this answer
add comment

I will present two solutions, but firstly let's assume a hypothetical situation to make the example easier to understand.
Let's suppose:

i) operational system: Windows
ii) ".las" file name = project_x.las
iii) the place the "project_x.las" is stored = c:\lidar\las_files\project_x.las
iv) output ".csv" file will be named = project_x.csv
v) the file "project_x.csv" will be saved at the following directory = c:\lidar\csv_files\project_x.csv
vi) fusion is installed under the following directory = c:\FUSION

Solution 1 (Fusion/LDV):

I like to use Fusion/LDV, the U.S. Forest Service's free software for lidar visualization and processing.

It runs on DOS and it is very easy to use. There is also manual explaining the program commands and available ".las" data for training (it comes with a tutorial too).

hint: instal the Notepad++, so you can write the commands previous to run them on DOS.

To answer you question there is a specific program command to accomplish this task: LDA2ASCII.
See Fusion manual's page 98.

step 1: open the Notepad++ ".txt" file, and save it as ".bat" file.
Then, open it (do not double click it, because it runs the file, but just right click the icon with mouse button and click "Edit with Notepad++).

Write the following script: (assuming the example given in the question's beginning)

REM LDA2ASCII InputFile OutputFile format (this is the raw syntax of LDA2ASCII command)

*the word REM is just to make it possible to insert commentaries, which are useful to write above the actual syntax command you are running. So one can remember later what it was done, among other commentaries worthy to be written.

c:\FUSION\LDA2ASCII c:\lidar\las_files\project_x.las c:\lidar\csv_files\project_x.csv. 0  

REM The number 0 (zero) is one option to convert just x, y and z information.  
REM There are other options of information if stored in ".las" files one can also convert such as: intensity, number of returns, etc.
REM However, I will keep focused on this question.

After writing the script, save the the ".bat" file document and run it.
To do that, close the file and just double click the icon with mouse left button, or
With the file opened just press F5, browse the file and run it.

It should create the file project_x_csv on the folder c:\lidar\csv_files

Solution 2 (R)

There is an R function to read ".las" files created by Michael Sumner and published on internet.
The function name is readLAS.

step 1: execute the readLAS function in R, and it will be stored in the R's workspace.
Then,

nfile = paste("c:\\lidar\\las_files\\project_x.las", sep="")
lasfiles = readLAS(nfile)
head(lasfiles) #see example bellow

            x       y      z  gpstime intensity
[1,] 732652.7 7459141 31.413 566219.0        58
[2,] 732655.2 7459144 28.600 566633.1        50
[3,] 732660.2 7459140 25.680 566633.0        52
[4,] 732654.4 7459145 30.461 566633.1        17
[5,] 732654.1 7459144 30.475 566633.1        77
[6,] 732655.1 7459144 28.329 566633.1        72  

lasframe = data.frame(lasfiles)
write.csv(lasframe,"c:\\lidar\\csv_files\\project_x.csv")

I hope it helps you. Any doubts, just leave comment. Regards.

share|improve this answer
    
Great solutions. Thanks a lot. –  Dan Jul 22 '13 at 15:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.