Writing LAS/LAZ

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Writing LAS/LAZ

Stephen Ferrell
I've successfully modified the point cloud classification example code to read LAS/LAZ files for input but I'm having trouble figuring out how to write out a LAS/LAZ file instead of dumping the XYZ and classification data to a text file.  Currently I write the results out in text format in the following order:

x1 y1 z1 R1 G1 B1 c1
xn yn zn Rn Gn Bn cn

Then I use the txt2las.exe app found in LASTools to parse the values and convert the results into a LAS/LAZ file with the following command:  txt2las.exe -i classification.txt -parse xyzRGBc -o my_las.las

I'd really like to be able to write out the data in LAS/LAZ format so that I don't have to use txt2las anymore.  Any help would be appreciated.  Code is attached. 

Regards,

Steve











--
-- The quality of your thoughts will determine the quality of your life.

LAS-classifiy.cpp (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Writing LAS/LAZ

Simon Giraudot-2

Hello,

CGAL also provides wrappers for the LASlib functions, see: https://doc.cgal.org/latest/Point_set_processing_3/group__PkgPointSetProcessingIOLas.html#gab458d5161d933b236ac42b03366ffeb7

You can see an example for reading a PLY point set with some properties here: https://doc.cgal.org/latest/Point_set_processing_3/Point_set_processing_3_2read_las_example_8cpp-example.html#a4

Regards,

-- 
Simon Giraudot, PhD
R&D Engineer
GeometryFactory - http://geometryfactory.com/
Le 15/03/2019 à 23:06, Stephen Ferrell a écrit :
I've successfully modified the point cloud classification example code to read LAS/LAZ files for input but I'm having trouble figuring out how to write out a LAS/LAZ file instead of dumping the XYZ and classification data to a text file.  Currently I write the results out in text format in the following order:

x1 y1 z1 R1 G1 B1 c1
xn yn zn Rn Gn Bn cn

Then I use the txt2las.exe app found in LASTools to parse the values and convert the results into a LAS/LAZ file with the following command:  txt2las.exe -i classification.txt -parse xyzRGBc -o my_las.las

I'd really like to be able to write out the data in LAS/LAZ format so that I don't have to use txt2las anymore.  Any help would be appreciated.  Code is attached. 

Regards,

Steve











--
-- The quality of your thoughts will determine the quality of your life.