最近发现的可以读取las的python包
1. pylas
GitHub上作者在不断完善: https://github.com/tmontaigu/pylas
基础教程 of pylas: https://pylas.readthedocs.io/en/latest/api/index.html
安装:pip install pylas
使用example:
import pylas
# Directly read and write las
las = pylas.read('filename.las')
las = pylas.convert(las, point_format_id=2)
las.write('converted.las')
# Open data to inspect header and then read
with pylas.open('filename.las') as f:
if f.header.point_count < 10 ** 8:
las = f.read()
print(las.vlrs)
2. laspy
GitHub: laspy
基础教程(英文): tutotial of laspy
安装:
pip install laspy
或者
python setup.py build --user
python setup.py install --user
使用example:
from laspy.file import File
import numpy as np
inFile = File('/path/to/file.las', mode='r')
I = inFile.Classification == 2
outFile = File('/path/to/output.las', mode='w', header=inFile.header)
outFile.points = inFile.points[I]
outFile.close()
3. las
GitHub: las
安装:pip install las
使用example:
import las
log = las.LASReader('example1.las')
log.start
log.data
4. pylidar
conda config --add channels conda-forge
conda config --add channels rios
conda create -n myenv pylidar
conda activate myenv
conda install pynninterp
另外python-pcl的安装:python-pcl-github