An implement based on C++ and LAStools read and write las file. In this way, if LAStools changes a lot, you do not need to change you kernel code.
For the Las IO, there is no dependency, for the Las projection converter, it depends on GDAL.
#! /bin/bash
mkdir build
cd build
cmake ..
make
This version only imports read and write uncompress las file.
This version only imports read compress/uncompress las file and write uncompress las file.
Read the "extended number of point records" for the LAS1.4 file.
There are two example in the example folder:
- LasFileExample is an example to crop the las file. After compiling the code, there is a test example in the data folder:
#! /bin/bash
./LasFileExample "../data/Vaihingen_Strip_10-sub.LAS" "../data/Vaihingen_Strip_10-cut.LAS" 497020 5420320 497040 5420420
- LasFileConvert is a tool to convert the Las file using GDAL, the projection file should be in proj4 format. In the data folder, there are two files, i.e 3943_CC43.proj4 and 2154_Lambert93.proj4, these files can be downloaded from EPSG.
![]() |
---|
Download proj4 file |
There is a testing example in the data folder:
#! /bin/bash
./LasFileConvert "../data/3943_CC43.las" "../data/3943_CC43.proj4" "../data/2154_Lambert93.proj4" "../data/3943_CC43_convert.las"
After converting, the the result has the same coordinate reference with 2154_Lambert93.las, then you can visualize them in CloudCompare:
![]() |
---|
Visulization in CloudCompare |
In the figure, the red points(3943_CC43_convert.las) are converted data, this data is from AI4GEO project. And the white points(2154_Lambert93.las) are from UMBRA data.
It is useful to use LAStools to analyze the LAS file, for example :
#! /bin/bash
lasinfo -i file.las
If you think you have any problem, contact [Teng Wu][email protected]