# -*- conding: utf-8 -*-
'''
创建las文件
'''
import numpy as np
from laspy.file import File
from laspy import header
from laspy.util import LaspyException
def get_header(x_min, y_min, z_min,
x_max, y_max, z_max,
x_scale=0.001, y_scale=0.001, z_scale=0.001
):
'''
设置las文件header,并返回header
Arguments:
x_min x坐标最小值
y_min y坐标最小值
z_min z坐标最小值
x_max x坐标最大值
y_max y坐标最大值
z_max z坐标最大值
x_scale x缩放因子
y_scale y缩放因子
z_scale z缩放因子
Returns:
las_header las文件头
'''
las_header = header.Header()
las_header.version_major = 1
las_header.version_minor = 2
las_header.x_min = x_min*x_scale
las_header.y_min = y_min*y_scale
las_header.z_min = z_min*z_scale
las_header.x_max = x_max*x_scale
las_header.y_max = y_max*y_scale
las_header.z_max = z_max*z_scale
las_header.x_scale = x_scale
las_header.y_scale = y_
Python代码创建las文件
最新推荐文章于 2024-05-09 22:47:04 发布
本文详细介绍了如何利用Python编程创建LAS文件,涵盖了 LAS 文件格式的基础知识和使用相关库进行数据写入的步骤,帮助读者掌握这一实用技能。

最低0.47元/天 解锁文章
696

被折叠的 条评论
为什么被折叠?



