一个简单的Python包来读取LAZ文件(LAS too)。
simplaz的Python项目详细描述
辛普拉兹
一个Python包来读取LAZ文件(lastoo)。 基本上它是Rust las的包装器,它公开了最有用的方法。在
如果没有内存,你就不能按顺序读取整个内存。在
现在只看书,以后再写。在
安装
皮普
要安装最新版本:pip install simplaz
发展
文件
pydoc可以找到here。在
示例
importsimplazimportnumpyasnpds=simplaz.read_file("/Users/hugo/data/ahn3/crop.laz")header=ds.headerprint("LAS v{}".format(header.version))print("Point count: {}".format(header.number_of_points))#-- using numpy functions#-- define a specific numpy typemypoint=np.dtype([('x','float64'),('y','float64'),('z','float64'),('intensity','int16')])pts=np.zeros((ds.header.number_of_points,),dtype=mypoint)#-- iterate over all the points and store in numpy array only #-- the ground point (classification=2)for(i,p)inenumerate(ds):ifp.classification==2:pts[i][0]=p.xpts[i][1]=p.ypts[i][2]=p.zpts[i][3]=p.classificationprint(len(pts))
支持什么,不支持什么?在
支持大多数LAS v1.4,除了:
- v1.4支持每个点后的额外位
LAS类
Classification | description |
---|---|
0 | Created, never classified |
1 | Unclassfied |
2 | Ground |
3 | Low Vegetation |
4 | Medium Vegetation |
5 | High Vegetation |
6 | Building |
7 | Low Point (noise) |
8 | Model Key-point (mass point) |
9 | Water |
10 | Reserved for ASPRS definition |
11 | Reserved for ASPRS definition |
12 | Overlap Points |
13-31 | Reserved for ASPRS definition |
LAS点格式
这是很好的解释on this page。在
- 项目
标签: