Is there any tool available for extracting the X, Y and Z coordinates from a .las file and exporting them to a .csv or similar file?
2 Answers
las2txt from liblas.org may do what you want:
Assume the following:
- .las file =
input.las
. input.las
path:C:\lidar\input.las
.- .csv file:
output.csv
. output.csv
path:C:\lidar\output.csv
.
With Fusion, the command line to export as CSV is LDA2ASCII
. Its syntax is:
LDA2ASCII InputFile OutputFile format
Write the following:
C:\Fusion\LDA2ASCII C:\lidar\input.las C:\lidar\output.csv. 0
The argument 0
will export only the x, y and z coordinates (use 1
to also export: nadir angle and intensity values). It will create the file output.csv
in the folder c:\lidar
.
In the example above, Fusion was installed under C:\Fusion
.
With R, there is the readLAS
function from the rLiDAR
package, which can be used to import .las files. Then, converting it as CSV is simple.
library(rLiDAR)
rLAS <- readLAS("C:\\lidar\\input.las", short=TRUE) #use short = FALSE to display more columns with data associated to each return. For example: classification code, gps time, etc.
rLAS <- data.frame(rLAS)
head(rLAS,3) #see first three rows
X Y Z Intensity ReturnNumber
732652.6 7459140 31.194 24 1
732652.7 7459141 31.426 58 1
732652.7 7459141 31.253 17 1
write.csv(rLAS,"C:\\lidar\\output.csv")