【laspy】点云合并,多个las格式点云文件合并一个

import open3d as o3d
import numpy as np
import laspy
import copy

def do_merge():
    las1 = laspy.read('#114-#115.las')
    las2 = laspy.read('#115-#116.las')

    output_file = laspy.LasData(las1.header)

    append = np.append(las1.points.array, las2.points.array)
    output_file.points.array = append

    x_append = np.append(las1.xyz[:, 0], las2.xyz[:, 0])
    y_append = np.append(las1.xyz[:, 1], las2.xyz[:, 1])
    z_append = np.append(las1.xyz[:, 2], las2.xyz[:, 2])

    output_file.x = x_append
    output_file.y = y_append
    output_file.z = z_append
    
    output_file.write('all.las')


if __name__ == '__main__':
    do_merge()

你可能感兴趣的:(点云分析,点云应用,点云分析)